[Kde-pim] [PATCH] Akonadi::ItemSync customization

Kevin Krammer kevin.krammer at gmx.at
Fri Jun 27 20:44:07 BST 2008


Hi Dmitry,

On Friday 27 June 2008, Dmitry Ivanov wrote:
> Hello,
>
> The attached patch allows to customize the behaviour of  Akonadi::ItemSync:
>
> 1. Allows subsclasses to "plug in" their own sync algorithms by
> reimplementing virtual bool updateItem( const Item &local, Item &remote )
> const

I know that "local" and "remote" make sense in the resource context, but I 
would appreciate names that reflect more precisely that one item is the 
version already known to Akonadi and the other is the potentially changed 
one.

I specifically renamed similar parameters to other methods because it always 
confused the hell out of me since if your mental context is the Akonadi 
connection, "local" indicated "from this process" and "remote" 
indicated "from the Akonadi server process".

Probably more like "stored" or "old" or "current" instead of "local", no idea 
for "remote" alternatives.

> 2. Allows to specify how much data ItemSync should fetch from the cache
> when building a list of all items for the collection being synchronized, by
> calling
>    fetchScope() or setFetchScope().

One suggestion:

 void ItemSync::doStart()
 {
+  ItemFetchJob* job = new ItemFetchJob( d->mSyncCollection, this );
+  job->fetchScope() = d->mFetchScope;

IMHO job->setFetchScopr( d->mFetchScope ) would be cleaner.

Anyway, since this is the last time we can do a BIC change at all, I am asking 
if this particular step of the synching is the only one that will ever need 
customization, e.g. I can imagine that a client already has an up-to-date 
item list around and might not need/want a separate item fetch.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080627/5f711848/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