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 | |
static Ptr | baseGroup (const QString &baseGroupName) |
static Ptr | root () |
static Ptr | group (const QString &relPath) |
static 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 |
Friends | |
class | KBuildServiceGroupFactory |
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 KSycocaEntry::m_bDeleted. |
|
Construct a service and take all informations from a config file.
Definition at line 50 of file kservicegroup.cpp. References KConfigBase::hasKey(), KSycocaEntry::m_bDeleted, 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.
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 childCount(), KSycocaEntry::isType(), and KService::noDisplay(). Referenced by childCount(). |
|
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. 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 group(), KSortableValueList< T, Key >::insert(), KSycocaEntry::isType(), 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.
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 215 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 504 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 479 of file kservicegroup.cpp. |
|
Returns the root service group.
Definition at line 485 of file kservicegroup.cpp. Referenced by group(). |
|
Returns the group with the given relative path.
Definition at line 491 of file kservicegroup.cpp. References root(). Referenced by entries(). |
|
Returns the group of services that have X-KDE-ParentApp equal to
Definition at line 498 of file kservicegroup.cpp. |
The documentation for this class was generated from the following files: