From cc1f6f3a5c5004b19ce6188dda460676cf21616d Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 15 Mar 2016 06:04:49 +0000 Subject: [PATCH] Fix dropping .torrent files into main window on Windows Previously used `QUrl::fromPercentEncoding()` leads to paths like "/C:/test/a.torrent" which obviously aren't valid filesystem paths. --- qt/MainWindow.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/MainWindow.cc b/qt/MainWindow.cc index aa65e2d4e..72dfe11c5 100644 --- a/qt/MainWindow.cc +++ b/qt/MainWindow.cc @@ -1444,8 +1444,8 @@ MainWindow::dropEvent (QDropEvent * event) { const QUrl url (key); - if (url.scheme () == QLatin1String ("file")) - key = QUrl::fromPercentEncoding (url.path().toUtf8()); + if (url.isLocalFile ()) + key = url.toLocalFile (); qApp->addTorrent (key); } -- 2.40.0