From a615ba35a48ee172ec574d97c29849b927e6dd2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Thu, 17 Jul 2014 15:24:05 +0200 Subject: [PATCH] 7258 7618 7837: let the win() stuff to windows, fix url/uri handling with non-ascii characters under linux and mac (not tested under mac) --- gramps/gui/editors/displaytabs/gallerytab.py | 5 ++++- gramps/plugins/view/mediaview.py | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py index bd8a14c25..3a8bdcc24 100644 --- a/gramps/gui/editors/displaytabs/gallerytab.py +++ b/gramps/gui/editors/displaytabs/gallerytab.py @@ -520,7 +520,10 @@ class GalleryTab(ButtonTab, DbGUIElement): else: files = sel_data.get_uris() for file in files: - d = conv_to_unicode((file.replace('\0',' ').strip()), None) + if win(): + d = conv_to_unicode((file.replace('\0',' ').strip()), None) + else: + d = file protocol, site, mfile, j, k, l = urlparse(d) if protocol == "file": name = url2pathname(mfile) diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 29ddf4458..67e9c48ff 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -184,9 +184,12 @@ class MediaView(ListView): #modern file managers provide URI_LIST. For Windows split sel_data.data files = sel_data.get_uris() for file in files: - clean_string = conv_to_unicode( - file.replace('\0',' ').replace("\r", " ").strip(), - None) + 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) if protocol == "file": name = url2pathname(mfile)