7258 7618: let the win() stuff to windows, fix url handling under linux and mac (not tested under mac)

This commit is contained in:
Jérôme Rapinat 2014-07-17 14:59:54 +02:00
parent 3dcdddf039
commit 0fb4f949a7
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -186,9 +186,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 = conv_to_unicode(file)
protocol, site, mfile, j, k, l = urlparse(clean_string)
if protocol == "file":
name = url2pathname(mfile)