# class KServiceGroup

###

Module | kdecore
Namespace |
Class | KServiceGroup
Inherits | KSycocaEntry

KServiceGroup represents a group of service, for example screensavers. 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().toLatin1());
    }
    else if (p->isType(KST_KServiceGroup))
    {
    KServiceGroup *g = static_cast<KServiceGroup *>(p);
    // Sub group ...
    }
    }

Represents a group of services

### enums

- EntriesOption { NoOptions, SortEntries, ExcludeNoDisplay, AllowSeparators, SortByGenericName }
  typesafe object: EntriesOptions

enum details

### methods

- KServiceGroup (name)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Construct a dummy servicegroup indexed with name.

  name - the name of the service group

- KServiceGroup (_fullpath, _relpath)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  _fullpath | QString |
  _relpath | QString |

  Construct a service and take all information from a config file

  _fullpath - full path to the config file

  _relpath - relative path to the config file

- KServiceGroup (_str, offset, deep)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  _str | QDataStream |
  offset | int |
  deep | bool |

  Internal construct a service from a stream. The stream must already be positionned at the correct offset

- addEntry (entry)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  entry | KSycocaEntry.Ptr |

  Internal Add a service to this group

- allowInline ( )

  returns bool

  Returns true if we allow to inline menu.

- baseGroup (baseGroupName)

  returns KServiceGroup.Ptr
  static

  Argument | Type | Default
  --- | --- | ---
  baseGroupName | QString |

  Returns the group for the given baseGroupName. Can return 0 if the directory (or the .directory file) was deleted. Returns the base group with the given name, or 0 if not available.

- baseGroupName ( )

  returns QString

  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 the base group name, or null if no base group

- caption ( )

  returns QString

  Returns the caption of this group. Returns the caption of this group

- childCount ( )

  returns int

  Returns the total number of displayable services in this group and any of its subgroups. Returns the number of child services

- childGroup (parent)

  returns KServiceGroup.Ptr
  static

  Argument | Type | Default
  --- | --- | ---
  parent | QString |

  Returns the group of services that have X-KDE-ParentApp equal to parent (siblings).

  parent - the name of the service's parent Returns the services group

- comment ( )

  returns QString

  Returns the comment about this service group. Returns the descriptive comment for the group, if there is one, or QString() if not set

- directoryEntryPath ( )

  returns QString

  Returns a path to the .directory file describing this service group. The path is either absolute or relative to the "apps" resource.

- entries (sorted, excludeNoDisplay, allowSeparators, sortByGenericName)

  returns KSycocaEntry.List

  Argument | Type | Default
  --- | --- | ---
  sorted | bool |
  excludeNoDisplay | bool |
  allowSeparators | bool |
  sortByGenericName | bool | 0

  List of all Services and ServiceGroups within this ServiceGroup.

  sorted - true to sort items

  excludeNoDisplay - true to exclude items marked "NoDisplay"

  allowSeparators - true to allow separator items to be included

  sortByGenericName - true to sort GenericName+Name instead of Name+GenericName Returns the list of entries

- entries (sorted, excludeNoDisplay)

  returns KSycocaEntry.List

  Argument | Type | Default
  --- | --- | ---
  sorted | bool |
  excludeNoDisplay | bool |

- entries (sorted)

  returns KSycocaEntry.List

  Argument | Type | Default
  --- | --- | ---
  sorted | bool | 0

  List of all Services and ServiceGroups within this ServiceGroup.

  sorted - true to sort items Returns the list of entried

- group (relPath)

  returns KServiceGroup.Ptr
  static

  Argument | Type | Default
  --- | --- | ---
  relPath | QString |

  Returns the group with the given relative path.

  relPath - the path of the service group Returns the group with the given relative path name.

- groupEntries (options)

  returns QList<KServiceGroup::Ptr>
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  options | KServiceGroup.EntriesOptions | KServiceGroup.ExcludeNoDisplay

  subgroups for this service group

- icon ( )

  returns QString

  Returns the name of the icon associated with the group. Returns the name of the icon associated with the group, or QString() if not set

- inlineAlias ( )

  returns bool

  Returns true to show an inline alias item into menu

- inlineValue ( )

  returns int

  Returns inline limite value

- layoutInfo ( )

  returns QStringList

  Internal Returns information related to the layout of services in this group.

- noDisplay ( )

  returns bool

  Returns true if the NoDisplay flag was set, i.e. if this group should be hidden from menus, while still being in ksycoca. Returns true to hide this service group, false to display it

- relPath ( )

  returns QString

  Returns the relative path of the service group. Returns the service group's relative path

- root ( )

  returns KServiceGroup.Ptr
  static

  Returns the root service group. Returns the root service group

- serviceEntries (options)

  returns KService.List

  Argument | Type | Default
  --- | --- | ---
  options | KServiceGroup.EntriesOptions | KServiceGroup.ExcludeNoDisplay

  entries of this service group

- setAllowInline (_b)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  _b | bool |

- setInlineAlias (_b)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  _b | bool |

- setInlineValue (_val)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  _val | int |

- setLayoutInfo (layout)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  layout | QStringList |

  Internal Sets information related to the layout of services in this group.

- setShowEmptyMenu (b)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  b | bool |

- setShowInlineHeader (_b)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  _b | bool |

- showEmptyMenu ( )

  returns bool

  Return true if we want to display empty menu entry Returns true to show this service group as menu entry is empty, false to hide it

- showInlineHeader ( )

  returns bool

  Returns true to show an inline header into menu

- suppressGenericNames ( )

  returns QStringList

  Returns a list of untranslated generic names that should be be suppressed 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.

### enums - detail

- EntriesOption { NoOptions, SortEntries, ExcludeNoDisplay, AllowSeparators, SortByGenericName }

  options for groupEntries and serviceEntries

  typesafe object: EntriesOptions

NoOptions - 0x0 -
SortEntries - 0x1 -
ExcludeNoDisplay - 0x2 -
AllowSeparators - 0x4 -
SortByGenericName - 0x8 -