KCModuleInfo (Was: Strange problem with KControl)

Waldo Bastian bastian at kde.org
Wed Sep 3 12:13:50 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 02 September 2003 12:55, Sven Lueppken wrote:
> Hi!
>
> I started KControl a few minutes ago and experienced the problem which is
> shown in the attached screenshot...I don't know what's the problem though,
> I ran kbuildsycoca but no changes. Maybe the XDG changes from yesterday
> have something to do with that?

The problem is in KControl. In particular the KCModuleInfo constructor tries 
to derive the group the module should be listed under from the path of the .
desktop file. That's wrong, it's KServiceGroup that should define the 
grouping.

I don't really understand what KCModuleInfo::groups() is supposed to return. 
One constructor fills it with the path of the desktop-path, while the other 
one fills it with the contents of "X-KDE-Groups".

And to make it all slower it reads this last bit of information from the 
desktop file instead of retrieving it from the KService object.

The way it derives the filename of the .desktop file also assumes that the 
KService is of type "Service" and not of type "Application". I doubt that is 
intended since it isn't reflected in either the docs or assured with an 
assert()

The two constructors can be merged for a great deal btw when you realize that 
you can create a KService using the "KService( const QString & _fullpath );" 
constructor. For those odd cases where your service isn't stored in sycoca 
already. I doubt that happens very often in practice, you are probably better 
of with only the constructor that takes KService and in the odd case that the 
caller wants to use a KService that isn't in KSycoca he can create one 
himself.

I don't see any .desktop file that actually contains "X-KDE-Groups" btw. Is 
this a new feature?

Cheers,
Waldo
- -- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/VczvN4pvrENfboIRAgYhAJ459Y4w9VV8T17NL8IG4K5z0AFbaQCbBLSO
FybjyFML088MDjynfhk6qz4=
=8UHO
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list