[Kde-pim] Review Request 117697: CollectionSync: allow to keep the local changes.

Christian Mollekopf chrigi_1 at fastmail.fm
Wed Apr 23 09:19:56 BST 2014



> On April 23, 2014, 7:26 a.m., Dan Vrátil wrote:
> > akonadi/collectionsync.cpp, line 390
> > <https://git.reviewboard.kde.org/r/117697/diff/2/?file=267788#file267788line390>
> >
> >     Just a curious question: wouldn't qSort()ing both lists and comparing them better? :-) But I guess it does not really matter given that collections have only very few mimetypes.

qSort is O(n log n) and would make the comparison O(n) if executed on both lists, while just the comparison is O(n²). (right?)
So for very large sets you might be right I think, but I doubt this works with ~5 elements ;-)
Also quicksorts worstcase is O(n²) too, so if you're unlucky things get actually worse.


> On April 23, 2014, 7:26 a.m., Dan Vrátil wrote:
> > akonadi/resourcebase.h, line 469
> > <https://git.reviewboard.kde.org/r/117697/diff/2/?file=267790#file267790line469>
> >
> >     The code in resourcebase.cpp seems to actually remember the parts list and set it during every sync automatically, so either this documentation is wrong, or you are missing a mKeepLocalCollectionChanges.clear() call.
> >     
> >     I would personally prefer keeping the current behaviour and removing this line. This allows users to set the parts once in Resource ctor and then not having to care about it again.

Jup, I changed that behaviour and forgot to adjust the comment.


- Christian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117697/#review56246
-----------------------------------------------------------


On April 22, 2014, 10:52 p.m., Christian Mollekopf wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117697/
> -----------------------------------------------------------
> 
> (Updated April 22, 2014, 10:52 p.m.)
> 
> 
> Review request for KDEPIM-Libraries.
> 
> 
> Repository: kdepimlibs
> 
> 
> Description
> -------
> 
> CollectionSync: allow to keep the local changes.
> 
> This new property allows resources to indicate whether the CollectionSync
> should overwrite the locally stored changes.
> This ensures that the CollectionSync doesn't overwrite existing attributes
> with the default values provided by the resource on every sync.
> 
> 
> Diffs
> -----
> 
>   akonadi/collectionsync.cpp 73e1ccf4355a509dbff58a8af3727e5856778f33 
>   akonadi/collectionsync_p.h 1fa0ff97bc4b5b6f11cea163f97db71d14b7bdd0 
>   akonadi/resourcebase.h acdf0b86417bd0be727e52ade8a84c4d618ec324 
>   akonadi/resourcebase.cpp 435dbd897dd1f7674aaead3c16ddb3f1ce32ef30 
>   akonadi/tests/collectionsynctest.cpp c36d9396c5b7cd3f54b3c8e2c27a3cdd32c95789 
> 
> Diff: https://git.reviewboard.kde.org/r/117697/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Christian Mollekopf
> 
>

_______________________________________________
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