[Kde-pim] Setting Akonadi agents' mime types

David Jarvie djarvie at kde.org
Fri Sep 11 00:38:40 BST 2009


I'm trying to create a new Akonadi agent and then set its mime type to one out 
of the 4 possible mime types for the resource type. (KAlarm Akonadi resources 
are defined to have 4 mime types, but any one resource will normally only have 
a single mime type.) I've only managed to come up with a fairly complex way of 
doing this, and judging by AkonadiConsole, setting the mime type doesn't work.

The method used is:

- Use AgentInstanceCreateJob to create the agent
- Use Monitor::collectionAdded signal to determine when the agent creation has 
completed.
- Because Monitor::collectionAdded has a const Collection parameter, this 
can't be modified, so the next 2 steps are needed to fetch the same 
Collection, but as a non-const:
- Use CollectionFetchJob to fetch the Collection list
- When its result() signal triggers, search the list by ID for the newly 
created Collection.
- Use Collection::setContentMimeTypes() to set the single mime type.

Questions:
Is there a shorter way of doing this operation?
Why doesn't the Collection show just a single mime type in AkonadiConsole? - 
is it necessary to do something else to save the new setting?

(Again, I've logged on too late to get answers on IRC.)

-- 
David Jarvie.
KDE developer.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list