From c26fcf6d56c0bb02a1375d5caec09608c0e714bd Mon Sep 17 00:00:00 2001 From: Josip Date: Thu, 7 May 2015 21:01:15 +0200 Subject: [PATCH] 8445: Drag & Drop to add media: wrong handling of non-ascii characters --- gramps/gui/editors/displaytabs/gallerytab.py | 13 +++---------- gramps/plugins/view/mediaview.py | 9 +-------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py index c1f51c47f..5ea1ddc07 100644 --- a/gramps/gui/editors/displaytabs/gallerytab.py +++ b/gramps/gui/editors/displaytabs/gallerytab.py @@ -514,17 +514,10 @@ class GalleryTab(ButtonTab, DbGUIElement): elif self._DND_EXTRA and mytype == self._DND_EXTRA.drag_type: self.handle_extra_type(mytype, obj) except pickle.UnpicklingError: - #modern file managers provide URI_LIST. For Windows split sel_data.data - if win(): - files = sel_data.get_data().split('\n') - else: - files = sel_data.get_uris() + + files = sel_data.get_uris() for file in files: - if win(): - d = conv_to_unicode((file.replace('\0',' ').strip()), None) - else: - d = file - protocol, site, mfile, j, k, l = urlparse(d) + protocol, site, mfile, j, k, l = urlparse(file) if protocol == "file": name = url2pathname(mfile) mime = get_type(name) diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index bf703c82f..5cefdb1f9 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -181,16 +181,9 @@ class MediaView(ListView): """ if not sel_data: return - #modern file managers provide URI_LIST. For Windows split sel_data.data files = sel_data.get_uris() for file in files: - if win(): - clean_string = conv_to_unicode( - file.replace('\0',' ').replace("\r", " ").strip(), - None) - else: - clean_string = file - protocol, site, mfile, j, k, l = urlparse(clean_string) + protocol, site, mfile, j, k, l = urlparse(file) if protocol == "file": name = url2pathname(mfile) mime = get_type(name)