8445: Drag & Drop to add media: wrong handling of non-ascii characters
This commit is contained in:
parent
b401741143
commit
f4f83e456e
@ -506,17 +506,9 @@ 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)
|
||||
|
@ -174,16 +174,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)
|
||||
|
Loading…
Reference in New Issue
Block a user