Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OficinaActivity.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py
index c72576a..21ccc04 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -140,8 +140,7 @@ class OficinaActivity(activity.Activity):
def read_file(self, file_path):
'''Read file from Sugar Journal.'''
-
- logging.debug('reading file %s', file_path)
+ logging.debug('reading file %s, mimetype: %s, title: %s', file_path, self.metadata['mime_type'],self.metadata['title'])
pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)
@@ -155,6 +154,14 @@ class OficinaActivity(activity.Activity):
self._setup_handle = self.fixed.connect('size_allocate',
size_allocate_cb)
+ # disassociate with journal entry to avoid overwrite (SL #1771)
+ if self.metadata['mime_type'] != "image/png":
+ self._jobject.object_id = None
+ last_point_posi = self.metadata['title'].rfind('.')
+ if last_point_posi > -1:
+ self.metadata['title'] = self.metadata['title'][0:last_point_posi] + '.png'
+ logging.error('title: %s', self.metadata['title'])
+
def write_file(self, file_path):
'''Save file on Sugar Journal. '''