[Sugar-devel] [read PATCH] sdxo#4448: Revert back to the earlier behaviour, of re-computing filehash every time when needed.

Ajay Garg ajay at activitycentral.com
Thu Feb 28 10:23:28 EST 2013


This reverts commit 21af7cc988320c8a53c946253d52fe1bb6ff9a7e.

Thankfully, we do not lose anything, as the commit 21af7cc988320c8a53c946253d52fe1bb6ff9a7e was just an "optimisation"-commit;
we don't lose anything on the frontend/backend/anywhere :)

 readactivity.py        | 10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/readactivity.py b/readactivity.py
index beed2b4..e0f0cf8 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -710,7 +710,6 @@ class ReadActivity(activity.Activity):
         self.metadata['Read_search'] = \
                 self._edit_toolbar._search_entry.props.text
         self.metadata['activity'] = self.get_bundle_id()
-        self.metadata['filehash'] = self.filehash
 
         os.link(self._tempfile, file_path)
 
@@ -856,13 +855,8 @@ class ReadActivity(activity.Activity):
         self._view_toolbar.set_view(self._view)
         self._edit_toolbar.set_view(self._view)
 
-
-        self.filehash = self.metadata.get('filehash', None)
-        if self.filehash is None:
-            self.filehash = get_md5(filepath)
-            logging.error('Calculate hash %s', self.filehash)
-
-        self._bookmarkmanager = BookmarkManager(self.filehash)
+        filehash = get_md5(filepath)
+        self._bookmarkmanager = BookmarkManager(filehash)
         self._bookmarkmanager.connect('added_bookmark',
                 self._added_bookmark_cb)
         self._bookmarkmanager.connect('removed_bookmark',
-- 
1.7.11.7



More information about the Sugar-devel mailing list