From 4ad702805c53e2b474b98ff3ba18d640aab68d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 19 Sep 2018 09:11:12 +0200 Subject: [PATCH] Remove usage of Clipboard set_with_data The method is not exposed by the introspection. issue7589 review66381002 --- tryton/gui/window/view_form/view/list.py | 32 +++--------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index d49da65ebf..6afc36bc9f 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -671,25 +671,10 @@ class ViewTree(View): for clipboard_type in (gtk.gdk.SELECTION_CLIPBOARD, gtk.gdk.SELECTION_PRIMARY): clipboard = self.treeview.get_clipboard(clipboard_type) - targets = [ - ('STRING', 0, 0), - ('TEXT', 0, 1), - ('COMPOUND_TEXT', 0, 2), - ('UTF8_STRING', 0, 3) - ] selection = self.treeview.get_selection() - # Set to clipboard directly if not too much selected rows - # to speed up paste - # Don't use set_with_data on mac see: - # http://bugzilla.gnome.org/show_bug.cgi?id=508601 - if selection.count_selected_rows() < 100 \ - or sys.platform == 'darwin': - data = [] - selection.selected_foreach(self.copy_foreach, data) - clipboard.set_text('\n'.join(data), -1) - else: - clipboard.set_with_data(targets, self.copy_get_func, - self.copy_clear_func, selection) + data = [] + selection.selected_foreach(self.copy_foreach, data) + clipboard.set_text('\n'.join(data), -1) def copy_foreach(self, treemodel, path, iter, data): record = treemodel.get_value(iter, 0) @@ -704,17 +689,6 @@ class ViewTree(View): data.append('\t'.join(values)) return - def copy_get_func(self, clipboard, selectiondata, info, selection): - data = [] - selection.selected_foreach(self.copy_foreach, data) - clipboard.set_text('\n'.join(data), -1) - del data - return - - def copy_clear_func(self, clipboard, selection): - del selection - return - def on_paste(self): if not self.editable: return