[Kde-pim] Review Request: Add collection access methods to Akonadi::Item*Job classes

David Jarvie djarvie at kde.org
Sun Oct 4 01:49:01 BST 2009



> On 2009-09-28 13:19:33, Volker Krause wrote:
> > The ones for copy and move are fine, I'm ok with the one for create too, although item().parentCollection() already provides the information there. I don't really like the ones for fetch and delete though, as they only work sometimes. For fetch, Item::parentCollection() provides this information in a way that works for all fetch modes already. There is no easy solution for delete though, what do you need the method for there exactly?
> 
> David Jarvie wrote:
>     The class I actually wanted the information for was ItemFetchJob - I added the methods to the other classes for completeness. There seemed no reason not to supply a getter when there was already effectively as setter (either in the constructor or in an explicit setter).
>     
>     I don't understand why it wouldn't always work for fetch and delete. _If_ a collection was specified in these cases, why can't it be returned?
> 
> Volker Krause wrote:
>     What I meant is that they only return a valid collection _if_ it has been set. From just looking at the API and not reading the docs carefully that's not what people will expect though I think. For example ItemFetchJob::collection() also looks like it would return the parent collection of a single fetched item. So, if we add these getters, we should at least name them better, "fetchedCollection()" maybe? But that's still rather ambiguous...

Perhaps they could be called "specifiedCollection()" in ItemFetchJob and ItemDeleteJob. I do think that in general, if a value has been specified in a class method parameter and the class retains that value, there should be a getter to retrieve it unless there's a good reason against this.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1708/#review2482
-----------------------------------------------------------


On 2009-09-24 13:38:04, David Jarvie wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1708/
> -----------------------------------------------------------
> 
> (Updated 2009-09-24 13:38:04)
> 
> 
> Review request for KDE PIM.
> 
> 
> Summary
> -------
> 
> This patch provides access to the collection specified (in the constructor or elsewhere) in Akonadi::Item*Job classes. It enables the collection to be identified when a progress or completion slot is called by the job. This can be necessary to distinguish between jobs if multiple jobs for different collections are in progress at the same time.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdepimlibs/akonadi/itemcopyjob.h 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemcopyjob.cpp 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemcreatejob.h 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemcreatejob.cpp 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemdeletejob.h 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemdeletejob.cpp 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemfetchjob.h 1027313 
>   /trunk/KDE/kdepimlibs/akonadi/itemfetchjob.cpp 1027313 
>   /trunk/KDE/kdepimlibs/akonadi/itemmovejob.h 1021587 
>   /trunk/KDE/kdepimlibs/akonadi/itemmovejob.cpp 1021587 
> 
> Diff: http://reviewboard.kde.org/r/1708/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David
> 
>

_______________________________________________
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