KService: support for storing Actions defined in .desktop files into ksycoca4

David Faure faure at kde.org
Mon Oct 15 15:06:18 BST 2007


On Saturday 13 October 2007, David Faure wrote:
> Desktop files can defined Actions (as per the desktop entry standard). [...]
> This is simple to fix: letting KService save the information about those actions into ksycoca. [...]
> 
> Also ported KDesktopFileActions to that; changes the API slightly, KDesktopFileActions::Service
> is to be ported to KServiceAction, which is good since Service had ugly public members. This part
> will wait until Monday obviously.
Here's the patch that ports kdebase to this API change. 
Kevin used KDesktopFileActions::Service more than I expected :)

In the diff:
Index: runtime/kioslave/media/*
Index: runtime/soliduiserver/*
Index: apps/lib/konq/konq_menuactions_p.h
Index: apps/lib/konq/konq_menuactions.cpp
Index: workspace/kscreensaver/krandom_screensaver/random.cpp (Laurent, can you double-check this one?)

OK for committing this today?

> While writing the unit test for this, I noticed that the binary representation (like, in ksycoca)
> of a single KService was 3700 bytes. This is because KConfigGroup::entryMap returns all translated
> entries. After filtering those out, the KService is down to 755 bytes; and the whole ksycoca4 went
> from 9.0M to 1.5M!
> I still have to figure out how this worked in KDE3. From my tests, KConfig::entryMap(group) returned
> translated entries as well, and yet they are not seen by kservice nor end up in ksycoca3; confusing.
> Seems like KDesktopFile and KConfig behaved a bit differently on this; with KDesktopFile the entryMap
> doesn't have the translations... Anyone knows about this? (cf kconfigtest.cpp.kde3.diff)
Any input from KConfig people?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase_kserviceaction.diff
Type: text/x-diff
Size: 29872 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071015/e70f3cfd/attachment.diff>


More information about the kde-core-devel mailing list