[Kde-pim] Review Request 111149: Add file monitoring to ICalDir and VCardDir resources and move common code to shared base class

Aurélien Gâteau agateau at kde.org
Thu Jun 20 13:29:10 BST 2013


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


I haven't tried the code, but here are some suggestions from reading the diff.


resources/shared/dirresource.h
<http://git.reviewboard.kde.org/r/111149/#comment25477>

    Shouldn't this be a kWarning()?



resources/shared/dirresource.h
<http://git.reviewboard.kde.org/r/111149/#comment25474>

    QHash::remove() checks if the item is there before removing, you can remove the if.



resources/shared/dirresource.h
<http://git.reviewboard.kde.org/r/111149/#comment25475>

    same here



resources/shared/dirresource.h
<http://git.reviewboard.kde.org/r/111149/#comment25478>

    Shouldn't this be a kWarning() as well?



resources/shared/dirresourcebase.cpp
<http://git.reviewboard.kde.org/r/111149/#comment25472>

    Indentation is wrong here


- Aurélien Gâteau


On June 20, 2013, 11:24 a.m., Dan Vrátil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111149/
> -----------------------------------------------------------
> 
> (Updated June 20, 2013, 11:24 a.m.)
> 
> 
> Review request for KDEPIM.
> 
> 
> Description
> -------
> 
> Similarily to iCal and vCard resources, the iCalDir and vCardDir resources are essentially identical. This patch moves all the code to a template-based DirResource class, making VCardDirResource and ICalDirResource specializations of the DirResource class, implementing only loading and saving of payload from/to file. QObject-related stuff is implemented in DirResourceBase class.
> 
> The shared code now also supports watching the directory (via KDirWatch) for changes and will automatically add, update or remove entries from Akonadi when a file is added, changed or removed in the resource's data directory.
> 
> 
> This addresses bug 321343.
>     http://bugs.kde.org/show_bug.cgi?id=321343
> 
> 
> Diffs
> -----
> 
>   resources/icaldir/CMakeLists.txt 3ca6c5e 
>   resources/icaldir/icaldirresource.h 8fe7733 
>   resources/icaldir/icaldirresource.cpp b294be0 
>   resources/shared/dirresource.h PRE-CREATION 
>   resources/shared/dirresourcebase.h PRE-CREATION 
>   resources/shared/dirresourcebase.cpp PRE-CREATION 
>   resources/vcarddir/CMakeLists.txt 7a58e6f 
>   resources/vcarddir/vcarddirresource.h 1423bdf 
>   resources/vcarddir/vcarddirresource.cpp 5d17d26 
> 
> Diff: http://git.reviewboard.kde.org/r/111149/diff/
> 
> 
> Testing
> -------
> 
> Set up vCardDir resource to watch for /tmp/vcarddir. Moved a new .vcard file into the folder and it was immediately added to Akonadi. Changing the file updated payload stored in Akonadi and removing the file removed respective item from Akonadi. Same for the iCalDir.
> 
> 
> Thanks,
> 
> Dan Vrátil
> 
>

_______________________________________________
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