[Kde-pim] Review Request: Use hashes in the SingleFileResource take two.

Bertjan Broeksema b.broeksema at home.nl
Thu Jul 23 13:36:12 BST 2009


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

(Updated 2009-07-23 12:36:12.373591)


Review request for KDE PIM, Kevin Krammer and Volker Krause.


Changes
-------

* Renamed hashChanged() to handleHashChange()
* Factored out some hash related code in readLocalFile.
* Factored out retrieving the KSharedConfig object so that it can be reused by implementing resources.
* Added setLocalFileName(). This method is called when the hash didn't change. The default implementation will call readFromFile( fileName ) but resources can reimplement this method to postpone the actual parsing of the file until it is actually needed for the resource.


Summary
-------

Second stab at using hashes. This patch makes sure that the has of a file gets saved after a write in a config file. This makes it possible to check if the file has changed between to cold starts of a resource.

If the hash has changed, synchronize is called but first clearCache() as we have to assume that the information that might be/is cached is invalid by now.


Diffs (updated)
-----

  trunk/KDE/kdepim/akonadi/resources/shared/singlefileresource.h 1001469 
  trunk/KDE/kdepim/akonadi/resources/shared/singlefileresourcebase.h 1001469 
  trunk/KDE/kdepim/akonadi/resources/shared/singlefileresourcebase.cpp 1001469 

Diff: http://reviewboard.kde.org/r/965/diff


Testing
-------

Did some testing with the mbox resource:
- Changing file between two cold starts -> changed hash correctly detected, DeleteItemOffsets attribute got deleted by clearCache()
- Changing file while mbox is running -> same results.
- Not changing the file between two cold starts -> no synchronize() called.


Thanks,

Bertjan

_______________________________________________
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