KServiceGroup Class Reference
KServiceGroup represents a group of service, for example screensavers. Represents a group of services. More...
#include <kservicegroup.h>
Inheritance diagram for KServiceGroup:


Public Types | |
typedef KSharedPtr< KServiceGroup > | Ptr |
typedef KSharedPtr< KSycocaEntry > | SPtr |
typedef QValueList< SPtr > | List |
Public Member Functions | |
KServiceGroup (const QString &name) | |
KServiceGroup (const QString &_fullpath, const QString &_relpath) | |
KServiceGroup (QDataStream &_str, int offset, bool deep) | |
bool | isValid () const |
virtual QString | name () const |
virtual QString | relPath () const |
QString | caption () const |
QString | icon () const |
QString | comment () const |
int | childCount () |
bool | noDisplay () const |
QStringList | suppressGenericNames () const |
void | setLayoutInfo (const QStringList &layout) |
QStringList | layoutInfo () const |
virtual void | load (QDataStream &) |
virtual void | save (QDataStream &) |
List | entries (bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false) |
virtual List | entries (bool sorted, bool excludeNoDisplay) |
virtual List | entries (bool sorted=false) |
QString | baseGroupName () const |
QString | directoryEntryPath () const |
Static Public Member Functions | |
Ptr | baseGroup (const QString &baseGroupName) |
Ptr | root () |
Ptr | group (const QString &relPath) |
Ptr | childGroup (const QString &parent) |
Protected Member Functions | |
void | addEntry (KSycocaEntry *entry) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QString | m_strCaption |
QString | m_strIcon |
QString | m_strComment |
List | m_serviceList |
bool | m_bDeep |
QString | m_strBaseGroupName |
int | m_childCount |
Detailed Description
KServiceGroup represents a group of service, for example screensavers. Represents a group of services.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 ... } }
Definition at line 67 of file kservicegroup.h.
Constructor & Destructor Documentation
|
Construct a dummy servicegroup indexed with
|
|
Construct a service and take all informations from a config file.
References KConfigBase::hasKey(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KConfigBase::readListEntry(), and KConfigBase::setDesktopGroup(). |
Member Function Documentation
|
Checks whether the entry is valid, returns always true.
Implements KSycocaEntry. Definition at line 103 of file kservicegroup.h. |
|
Name used for indexing.
Implements KSycocaEntry. Definition at line 109 of file kservicegroup.h. References KSycocaEntry::entryPath(). Referenced by entries(). |
|
Returns the relative path of the service group.
References KSycocaEntry::entryPath(). Referenced by entries(). |
|
Returns the caption of this group.
|
|
Returns the name of the icon associated with the group.
|
|
Returns the comment about this service group.
|
|
Returns the total number of displayable services in this group and any of its subgroups.
References KSycocaEntry::isType(), and KService::noDisplay(). |
|
Returns true if the NoDisplay flag was set, i.e. if this group should be hidden from menus, while still being in ksycoca.
Referenced by entries(). |
|
Returns a list of untranslated generic names that should be be supressed when showing this group. E.g. The group "Games/Arcade" might want to suppress the generic name "Arcade Game" since it's redundant in this particular context.
|
|
List of all Services and ServiceGroups within this ServiceGroup.
References group(), KSortableValueList< T, Key >::insert(), KSycocaEntry::isType(), KSycocaEntry::List, m_serviceList, KService::menuId(), KSycocaEntry::name(), name(), KService::noDisplay(), noDisplay(), relPath(), and KSortableValueList< T, Key >::sort(). Referenced by entries(). |
|
List of all Services and ServiceGroups within this ServiceGroup.
References entries(). |
|
Returns a 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. The base group is defined by the X-KDE-BaseGroup key in the .directory file.
|
|
Returns a path to the .directory file describing this service group. The path is either absolute or relative to the "apps" resource.
|
|
Returns the group for the given baseGroupName. Can return 0L if the directory (or the .directory file) was deleted.
|
|
Returns the root service group.
Referenced by group(). |
|
Returns the group with the given relative path.
References root(). Referenced by entries(). |
|
Returns the group of services that have X-KDE-ParentApp equal to
|
The documentation for this class was generated from the following files: