KDECore
KComponentData Class Reference
#include <kcomponentdata.h>
Detailed Description
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().
Definition at line 46 of file kcomponentdata.h.
Member Enumeration Documentation
Definition at line 84 of file kcomponentdata.h.
Constructor & Destructor Documentation
KComponentData::KComponentData | ( | ) |
Creates an invalid KComponentData object.
- See also:
- isValid()
Definition at line 36 of file kcomponentdata.cpp.
KComponentData::KComponentData | ( | const KComponentData & | rhs | ) |
Copy constructor.
It does not copy the data. The data is shared between the old and new objects.
Definition at line 41 of file kcomponentdata.cpp.
KComponentData::KComponentData | ( | const QByteArray & | componentName, | |
const QByteArray & | catalogName = QByteArray() , |
|||
MainComponentRegistration | registerAsMain = RegisterAsMainComponent | |||
) | [explicit] |
Constructor.
- Parameters:
-
componentName the name of the component. catalogName the name of the translation catalog; if left empty componentName
is usedregisterAsMain 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
Definition at line 68 of file kcomponentdata.cpp.
KComponentData::KComponentData | ( | const KAboutData & | aboutData, | |
MainComponentRegistration | registerAsMain = RegisterAsMainComponent | |||
) | [explicit] |
Constructor.
A copy of the aboutData object is made.
- Parameters:
-
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
Definition at line 88 of file kcomponentdata.cpp.
KComponentData::KComponentData | ( | const KAboutData * | aboutData, | |
MainComponentRegistration | registerAsMain = RegisterAsMainComponent | |||
) | [explicit] |
Definition at line 78 of file kcomponentdata.cpp.
KComponentData::~KComponentData | ( | ) | [virtual] |
Member Function Documentation
const KAboutData * KComponentData::aboutData | ( | ) | const |
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.
Definition at line 178 of file kcomponentdata.cpp.
QString KComponentData::catalogName | ( | ) | const |
Returns the name of the translation catalog.
- Returns:
- The catalog name.
Definition at line 190 of file kcomponentdata.cpp.
QString KComponentData::componentName | ( | ) | const |
Returns the name of the component.
- Returns:
- The component name.
Definition at line 184 of file kcomponentdata.cpp.
const KSharedConfig::Ptr & KComponentData::config | ( | ) | const |
Returns the general config object ("appnamerc").
- Returns:
- the KConfig object for the component.
Definition at line 164 of file kcomponentdata.cpp.
KStandardDirs * KComponentData::dirs | ( | ) | const |
Returns the application standard dirs object.
- Returns:
- The KStandardDirs of the application.
Definition at line 156 of file kcomponentdata.cpp.
bool KComponentData::isValid | ( | ) | const |
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.
Definition at line 106 of file kcomponentdata.cpp.
bool KComponentData::operator!= | ( | const KComponentData & | rhs | ) | const [inline] |
Returns whether two KComponentData objects do not reference the same data.
Definition at line 82 of file kcomponentdata.h.
KComponentData & KComponentData::operator= | ( | const KComponentData & | rhs | ) |
Assignment operator.
It does not copy the data. The data is shared between the old and new objects.
If the data of the left hand side object was only referenced from this object and no referenced KSharedConfig object needs it anymore, it is deleted
Definition at line 49 of file kcomponentdata.cpp.
bool KComponentData::operator== | ( | const KComponentData & | rhs | ) | const |
Returns whether two KComponentData objects reference the same data.
Definition at line 63 of file kcomponentdata.cpp.
void KComponentData::setConfigName | ( | const QString & | name | ) | [protected] |
Set name of default config file.
- Parameters:
-
name the name of the default config file
Definition at line 172 of file kcomponentdata.cpp.
void KComponentData::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
The documentation for this class was generated from the following files: