From 159be479cc4d844546e263472430a5e4757f6c0a Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 25 Jul 2010 15:20:37 +0000 Subject: [PATCH] Fix drag'n drop on Windows (Thanks GeekyGirl) --- src/GUI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GUI.cpp b/src/GUI.cpp index f375769b8..d4f631a67 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -687,7 +687,11 @@ void GUI::dropEvent(QDropEvent *event) { QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); foreach(QString file, files) { +#ifdef Q_WS_WIN + file = file.trimmed().replace(QString::fromUtf8("file:///"), QString::fromUtf8(""), Qt::CaseInsensitive); +#else file = file.trimmed().replace(QString::fromUtf8("file://"), QString::fromUtf8(""), Qt::CaseInsensitive); +#endif qDebug("Dropped file %s on download list", file.toLocal8Bit().data()); if(file.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || file.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || file.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) { BTSession->downloadFromUrl(file);