Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/patches/0001-sdxo-3215-Revert-back-to-the-earlier-behaviour-of-re.patch
blob: 89f2445008ff9086dd52a7c38460b7bdaca23853 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From e2dd7282e818c86e0f40d9fc898da769573daa9d Mon Sep 17 00:00:00 2001
From: Ajay Garg <ajay@activitycentral.com>
Date: Thu, 28 Feb 2013 13:07:36 +0530
Subject: [PATCH] sdxo#3215: Revert back to the earlier behaviour, of re-computing filehash every time when needed.
Organization: Sugar Labs Foundation
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
---

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 :)

 activity/activity.info |  2 +-
 readactivity.py        | 10 ++--------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/activity/activity.info b/activity/activity.info
index 1f2fe88..0c48264 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -4,7 +4,7 @@ bundle_id = org.laptop.sugar.ReadActivity
 icon = activity-read
 exec = sugar-activity readactivity.ReadActivity
 show_launcher = no
-activity_version = 105
+activity_version = 106.1
 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/epub+zip;text/plain;application/zip
 license = GPLv2+
 summary = Use this activity when you are ready to read! Remember to flip your computer around to feel like you are really holding a book!
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