# class KComponentData

###

Module | kdecore
Namespace |
Class | KComponentData
Inherits |

Per component data.

This class holds a KAboutData object or only a component name, a KStandardDirs object and a KSharedConfig object. Those objects normally are different per component but the same per instance of one component.

The application component data can always be accessed using KGlobal.mainComponent() (or the convenience function KGlobal.dirs() and KGlobal.config()) while the component data of the currently active component (mainly used for KParts) can be accessed using KGlobal.activeComponent().

Author Torben Weis Author Matthias Kretz <kretz@kde.org>

### enums

- MainComponentRegistration { RegisterAsMainComponent, SkipMainComponentRegistration }

enum details

### methods

- KComponentData ( )

  returns ctor

  Creates an invalid KComponentData object.

  See also isValid()

- KComponentData (a0)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | KComponentData |

  Copy constructor.

  It does not copy the data. The data is shared between the old and new objects.

- KComponentData (componentName, catalogName, registerAsMain)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  componentName | QByteArray |
  catalogName | QByteArray | QByteArray()
  registerAsMain | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

  Constructor.

  componentName - the name of the component.

  catalogName - the name of the translation catalog; if left empty componentName is used

  registerAsMain - whether to register the component as the main component of the application. This has no effect, if the application already has a main component.

  See also KGlobal.mainComponent

- KComponentData (aboutData, registerAsMain)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  aboutData | KAboutData |
  registerAsMain | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

  Constructor.

  A copy of the aboutData object is made.

  aboutData - data about this component

  registerAsMain - whether to register the component as the main component of the application. This has no effect, if the application already has a main component.

  See also KGlobal.mainComponent

  See also KAboutData

- KComponentData (aboutData, registerAsMain)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  aboutData | KAboutData |
  registerAsMain | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

- KComponentData (a0, a1, a2)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QByteArray |
  a1 | QByteArray | QByteArray()
  a2 | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

- KComponentData (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KAboutData |
  a1 | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

- KComponentData (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KAboutData |
  a1 | KComponentData.MainComponentRegistration | KComponentData.RegisterAsMainComponent

- aboutData ( )

  returns KAboutData

  Returns the about data of this component.

  Returns The about data of the component. If none has been set in the constructor but a component name was set, a default constructed KAboutData object is returned.

- catalogName ( )

  returns QString

  Returns the name of the translation catalog.

  Returns The catalog name.

- componentName ( )

  returns QString

  Returns the name of the component.

  Returns The component name.

- config ( )

  returns KSharedConfig.Ptr

  Returns the general config object ("appnamerc"). Returns the KConfig object for the component.

- dirs ( )

  returns KStandardDirs

  Returns the application standard dirs object. Returns The KStandardDirs of the application.

- isValid ( )

  returns bool

  Returns whether this is a valid object.

  Don't call any functions on invalid objects, that will crash. Assignment (and of course destruction) is the only valid operation you may do.

- operator != (rhs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  rhs | KComponentData |

  Returns whether two KComponentData objects do not reference the same data.

- operator == (a0)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  a0 | KComponentData |

  Returns whether two KComponentData objects reference the same data.

- setConfigName (name)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Set name of default config file.

  name - the name of the default config file

- virtual_hook (id, data)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  id | int |
  data | void |

  Standard trick to add virtuals later. Internal

### enums - detail

- MainComponentRegistration { RegisterAsMainComponent, SkipMainComponentRegistration }

  | RegisterAsMainComponent | - | - |
  | SkipMainComponentRegistration | - | - |