|
|
This class is typically used like this:
// Lookup screensaver group KServiceGroup::Ptr group = KServiceGroup::baseGroup("screensavers"); if (!group || !group->isValid()) return;
KServiceGroup::List list = group->entries();
// Iterate over all entries in the group for( KServiceGroup::List::ConstIterator it = list.begin(); it != list.end(); it++) { KSycocaEntry *p = (*it); if (p->isType(KST_KService)) { KService *s = static_cast<KService *>(p); printf("Name = %s\n", s->name().latin1()); } else if (p->isType(KST_KServiceGroup)) { KServiceGroup *g = static_cast<KServiceGroup *>(p); // Sub group ... } }
typedef KSharedPtr<KServiceGroup> Ptr | Ptr |
typedef KSharedPtr<KSycocaEntry> SPtr | SPtr |
typedef QValueList<SPtr> List | List |
KServiceGroup ( const QString & _fullpath, const QString & _relpath )
| KServiceGroup |
Construct a service and take all informations from a config file
Parameters:
_fullpath | full path to the config file |
_relpath | relative path to the config file |
KServiceGroup ( QDataStream& _str, int offset, bool deep )
| KServiceGroup |
The stream must already be positionned at the correct offset
~KServiceGroup ()
| ~KServiceGroup |
[virtual]
bool isValid ()
| isValid |
[const]
Returns: true
Reimplemented from KSycocaEntry.
QString name ()
| name |
[const virtual]
Name used for indexing.
Reimplemented from KSycocaEntry.
QString relPath ()
| relPath |
[const virtual]
QString caption ()
| caption |
[const]
Returns: the caption of this group
QString icon ()
| icon |
[const]
Returns: the icon associated with the group.
QString comment ()
| comment |
[const]
Returns: the descriptive comment for the group, if there is one.
void load ( QDataStream& )
| load |
[virtual]
Load the service from a stream.
Reimplemented from KSycocaEntry.
void save ( QDataStream& )
| save |
[virtual]
Save the service to a stream.
Reimplemented from KSycocaEntry.
List entries (bool sorted = false)
| entries |
[virtual]
List of all Services and ServiceGroups within this ServiceGroup
QString baseGroupName ()
| baseGroupName |
[const]
The base group is defined by the X-KDE-BaseGroup key in the .directory file.
Returns: non-empty string if the group is a special base group. By default, "Settings/" is the kcontrol base group ("settings") and "System/Screensavers/" is the screensavers base group ("screensavers"). This allows moving the groups without breaking those apps.
Ptr baseGroup ( const QString &baseGroupName )
| baseGroup |
[static]
Returns: the group for the given baseGroupName Can return 0L if the directory (or the .directory file) was deleted.
Ptr root ()
| root |
[static]
Ptr group (const QString &relPath)
| group |
[static]
void addEntry ( KSycocaEntry *entry)
| addEntry |
[protected]
Add a service to this group
QString m_strCaption | m_strCaption |
[protected]
QString m_strIcon | m_strIcon |
[protected]
QString m_strComment | m_strComment |
[protected]
List m_serviceList | m_serviceList |
[protected]
bool m_bDeep | m_bDeep |
[protected]
QString m_strBaseGroupName | m_strBaseGroupName |
[protected]
Generated by: faure on ftp.kde.com on Wed Jun 20 13:26:37 2001, using kdoc 2.0a53. |