From b8bbeed693db532d91a62fc42c567e480674b4dd Mon Sep 17 00:00:00 2001 From: Ajay Garg Date: Sat, 13 Apr 2013 04:17:01 +0000 Subject: Merging https://git.sugarlabs.org/sugar/mainline/commit/739bc84a953c80fbf32ce357405857868f5a611c --- 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 -- cgit v0.9.1