From 2c9437bef4c51fbee726920c583efcccd52cc349 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Tue, 24 Aug 2021 03:13:03 -0500 Subject: [PATCH] Fix #897 --- qt/directories_model.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qt/directories_model.py b/qt/directories_model.py index b9dd2880..5e31cfdb 100644 --- a/qt/directories_model.py +++ b/qt/directories_model.py @@ -6,8 +6,6 @@ # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html -import urllib.parse - from PyQt5.QtCore import pyqtSignal, Qt, QRect, QUrl, QModelIndex, QItemSelection from PyQt5.QtWidgets import ( QComboBox, @@ -105,13 +103,11 @@ class DirectoriesModel(TreeModel): return None def dropMimeData(self, mime_data, action, row, column, parent_index): - # the data in mimeData is urlencoded **in utf-8**!!! What we do is to decode, the mime data - # with 'ascii', which works since it's urlencoded. Then, we pass that to urllib. + # the data in mimeData is urlencoded **in utf-8** if not mime_data.hasFormat("text/uri-list"): return False data = bytes(mime_data.data("text/uri-list")).decode("ascii") - unquoted = urllib.parse.unquote(data) - urls = unquoted.split("\r\n") + urls = data.split("\r\n") paths = [QUrl(url).toLocalFile() for url in urls if url] for path in paths: self.model.add_directory(path)