]> granicus.if.org Git - transmission/commitdiff
Fix dropping .torrent files into main window on Windows
authorMike Gelfand <mikedld@mikedld.com>
Tue, 15 Mar 2016 06:04:49 +0000 (06:04 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 15 Mar 2016 06:04:49 +0000 (06:04 +0000)
Previously used `QUrl::fromPercentEncoding()` leads to paths like
"/C:/test/a.torrent" which obviously aren't valid filesystem paths.

qt/MainWindow.cc

index aa65e2d4ef1e74e7d4555a029eeacb028433b574..72dfe11c5d6ae348db6860db4e16b0b6576b8aec 100644 (file)
@@ -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);
         }