diff --git a/NEWS b/NEWS index 4c076b86..3b6b15ba 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* Save activity previews to the datastore as binary png images. (tomeu) + Snapshot acca55e861 * #3905 Wait 3 seconds, rather than 3000, if NetworkManager doesn't respond diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index b3bbcba6..ca711109 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -449,9 +449,7 @@ class Activity(Window, gtk.Container): f.close() os.remove(file_path) - # TODO: Take this out when the datastore accepts binary data. - import base64 - return base64.b64encode(preview_data) + return preview_data def _get_buddies(self): if self._shared_activity is not None: @@ -481,7 +479,7 @@ class Activity(Window, gtk.Container): if self._preview is None: self.metadata['preview'] = '' else: - self.metadata['preview'] = self._preview + self.metadata['preview'] = dbus.ByteArray(self._preview) try: if self._jobject.file_path: diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py index a10feec8..752b0cc6 100644 --- a/sugar/datastore/dbus_helpers.py +++ b/sugar/datastore/dbus_helpers.py @@ -67,7 +67,7 @@ def delete(uid): def get_properties(uid): logging.debug('dbus_helpers.get_properties: %s' % uid) - return _get_data_store().get_properties(uid) + return _get_data_store().get_properties(uid, byte_arrays=True) def get_filename(uid): filename = _get_data_store().get_filename(uid)