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) |
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
Definition at line 43 of file kservicegroup.cpp. References KServiceGroup(). Referenced by KServiceGroup(). |
|
Construct a service and take all informations from a config file.
Definition at line 50 of file kservicegroup.cpp. References QString::findRev(), KConfigBase::hasKey(), QString::isEmpty(), KServiceGroup(), QString::left(), QString::length(), QString::mid(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KConfigBase::readListEntry(), QString::right(), 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.
Definition at line 115 of file kservicegroup.h. References KSycocaEntry::entryPath(). Referenced by entries(). |
|
Returns the caption of this group.
Definition at line 121 of file kservicegroup.h. |
|
Returns the name of the icon associated with the group.
Definition at line 128 of file kservicegroup.h. |
|
Returns the comment about this service group.
Definition at line 135 of file kservicegroup.h. |
|
Returns the total number of displayable services in this group and any of its subgroups.
Definition at line 114 of file kservicegroup.cpp. References QValueList::begin(), QValueList::end(), 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.
Definition at line 141 of file kservicegroup.cpp. References QString::startsWith(). 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.
Definition at line 146 of file kservicegroup.cpp. |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 246 of file kservicegroup.cpp. References QValueList< KSortableItem< T, Key > >::begin(), QValueList::begin(), QValueList< KSortableItem< T, Key > >::end(), QValueList::end(), entries(), group(), KSortableValueList< T, Key >::insert(), QString::isEmpty(), KSycocaEntry::isType(), QString::length(), QString::local8Bit(), m_serviceList, KService::menuId(), QString::mid(), KSycocaEntry::name(), name(), KService::noDisplay(), noDisplay(), relPath(), QValueList< KSortableItem< T, Key > >::remove(), and KSortableValueList< T, Key >::sort(). Referenced by entries(). |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 226 of file kservicegroup.cpp. 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.
Definition at line 209 of file kservicegroup.h. |
|
Returns a path to the .directory file describing this service group. The path is either absolute or relative to the "apps" resource.
Definition at line 499 of file kservicegroup.cpp. |
|
Returns the group for the given baseGroupName. Can return 0L if the directory (or the .directory file) was deleted.
Definition at line 474 of file kservicegroup.cpp. References baseGroup(). Referenced by baseGroup(). |
|
Returns the root service group.
Definition at line 480 of file kservicegroup.cpp. Referenced by group(). |
|
Returns the group with the given relative path.
Definition at line 486 of file kservicegroup.cpp. References group(), QString::isEmpty(), and root(). |
|
Returns the group of services that have X-KDE-ParentApp equal to
Definition at line 493 of file kservicegroup.cpp. References childGroup(). Referenced by childGroup(). |
The documentation for this class was generated from the following files: