diff options
author | Ajay Garg <ajay@activitycentral.com> | 2013-04-13 04:17:01 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2013-04-13 04:17:01 (GMT) |
commit | b8bbeed693db532d91a62fc42c567e480674b4dd (patch) | |
tree | 8d37712d35f78570314453ba68ee768cb3d2c309 | |
parent | ae7acee0221351fcf97045f862831acd50203f56 (diff) |
Merging https://git.sugarlabs.org/sugar/mainline/commit/739bc84a953c80fbf32ce357405857868f5a611c
-rw-r--r-- | src/jarabe/journal/listmodel.py | 11 | ||||
-rw-r--r-- | src/jarabe/journal/volumestoolbar.py | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py index a5bb7b0..a135de5 100644 --- a/src/jarabe/journal/listmodel.py +++ b/src/jarabe/journal/listmodel.py @@ -241,14 +241,17 @@ class ListModel(GObject.GObject, Gtk.TreeModel, Gtk.TreeDragSource): def do_drag_data_get(self, path, selection): uid = self[path][ListModel.COLUMN_UID] - if selection.target == 'text/uri-list': + target_atom = selection.get_target() + target_name = target_atom.name() + if target_name == 'text/uri-list': # Get hold of a reference so the temp file doesn't get deleted self._temp_drag_file_path = model.get_file(uid) logging.debug('putting %r in selection', self._temp_drag_file_path) - selection.set(selection.target, 8, self._temp_drag_file_path) + selection.set(target_atom, 8, self._temp_drag_file_path) return True - elif selection.target == 'journal-object-id': - selection.set(selection.target, 8, uid) + elif target_name == 'journal-object-id': + # uid is unicode but Gtk.SelectionData.set() needs str + selection.set(target_atom, 8, str(uid)) return True return False diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py index 4b382b8..189bd05 100644 --- a/src/jarabe/journal/volumestoolbar.py +++ b/src/jarabe/journal/volumestoolbar.py @@ -397,7 +397,7 @@ class BaseButton(RadioToolButton): journal._show_alert(_('Entries cannot be copied to Peer-Shares.'), _('Error')) return - object_id = selection_data.data + object_id = selection_data.get_data() metadata = model.get(object_id) from jarabe.journal.palettes import CopyMenu, get_copy_menu_helper |