From eddf8dffd2c9bd2ca0fe5772a795abd26c991c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Fri, 13 Oct 2006 16:46:13 +0200 Subject: [PATCH] Drag&drop fix on Linux. --- picard/ui/itemviews.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/picard/ui/itemviews.py b/picard/ui/itemviews.py index 87ff6b029..ad7ff7d33 100644 --- a/picard/ui/itemviews.py +++ b/picard/ui/itemviews.py @@ -19,6 +19,7 @@ from PyQt4 import QtCore, QtGui import os +import urllib from picard.album import Album from picard.cluster import Cluster from picard.file import File @@ -186,12 +187,12 @@ class BaseTreeView(QtGui.QTreeWidget): def dropUrls(self, urls, target): # URL -> Unmatched Files # TODO: use the drop target to move files to specific albums/tracks/clusters - from urllib import unquote - files = [] for url in urls: if url.startswith("file:///"): - filename = unquote(url[8:]).decode("UTF-8") + filename = urllib.url2pathname(url).decode("UTF-8") + if filename.startswith("file://"): + filename = filename[7:] if os.path.isdir(encode_filename(filename)): self.tagger.add_directory(filename) else: