[Kde-pim] Akonadi::ResourceSelectJob - why is it private?

Daniel Vrátil dvratil at redhat.com
Wed Mar 19 11:43:27 GMT 2014


On Tuesday 18 of March 2014 14:27:51 David Jarvie wrote:
> The API documentation for ItemDeleteJob says that if a remote ID is
> specified, ResourceSelectJob or CollectionSelectJob need to be called first
> to set the context for the ItemDeleteJob. Unfortunately, both of those
> SelectJob classes are private, and therefore aren't available to
> applications, so the documentation is somewhat misleading.

ItemDeleteJob uses CollectionSelectJob internally when you use the 
ItemDeleteJob(const Akonadi::Collection &) ctor, but see below.

> Is there a good reason for this (e.g. could it unintentionally set the
> context for internal library functions)? It effectively means that
> ItemDeleteJob can't be used in applications if only the item's remote ID is
> specified.

Server permits operations with RID sets only to Resources. Client applications 
are not allowed to use RIDs. in Frameworks I want to change the behavior so 
that RID is only exposed to resources and is  not exposed to client 
applications at all. This answers your question why CollectionSelectJob is 
private - it has no use outside ItemFetchJob and ItemDeleteJob, which use it 
when appropriate (i.e.e Collection-wide or RID-based operations).

ResourceSelectJob is private because when you use it, the session is switched 
into sort of a "privileged' mode on the server, which changes behavior of 
certain operations a little, like permitting RID operations, etc. that are 
specific to resources. You don't want to switch your application's session 
into this mode.

So the documentation should be updated not to mention the Select jobs  and 
instead explain that RID-based fetch and removal can only be used from 
Resources. 

Dan


-- 
Daniel Vrátil | dvratil at redhat.com | dvratil on #kde-devel, #kontact, #akonadi
KDE Desktop Team
Associate Software Engineer, Red Hat, Inc.

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140319/f550e489/attachment.sig>
-------------- next part --------------
_______________________________________________
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