[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Getting available KCMs
From:       Frans Englich <frans.englich () telia ! com>
Date:       2004-02-26 19:02:08
Message-ID: 200402262002.08371.frans.englich () telia ! com
[Download RAW message or body]

On Wednesday 25 February 2004 23:41, Simon Ask Ulsnes wrote:
> Obviously, kcmshell --list isn't sufficient...
>
> Maybe I wasn't clear: The list I want is for runtime displaying of KCMs (so
> that new KCMs will be added dynamically when new ones are installed, for
> instance with some special style or something - Mosfet's comes to mind). So
> I need icons, descriptors, international icon names, etc.
>
> How is this done in KControl?

In kdebase/kcontrol/kcontrol/modules.cpp::readDesktopEntriesRecursive the code 
below can be found.

Cheers,

		Frans



  KServiceGroup::Ptr group = KServiceGroup::group(path);

  if (!group || !group->isValid()) return;

  KServiceGroup::List list = group->entries(true, true);

  for( KServiceGroup::List::ConstIterator it = list.begin();
       it != list.end(); it++)
  {
     KSycocaEntry *p = (*it);
     if (p->isType(KST_KService))
     {
        ConfigModule *module = new ConfigModule(static_cast<KService*>(p));
        if (module->library().isEmpty())
        {
           delete module;
           continue;
        }

        append(module);
        menu->modules.append(module);
     }
     else if (p->isType(KST_KServiceGroup))
     {
        readDesktopEntriesRecursive(p->entryPath());
        menu->submenus.append(p->entryPath());
     }
  }

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic