mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 23:14:31 +00:00
Fix drag'n drop on Windows (Thanks GeekyGirl)
This commit is contained in:
parent
f3066b07b5
commit
159be479cc
@ -687,7 +687,11 @@ void GUI::dropEvent(QDropEvent *event) {
|
|||||||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool();
|
||||||
foreach(QString file, files) {
|
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);
|
file = file.trimmed().replace(QString::fromUtf8("file://"), QString::fromUtf8(""), Qt::CaseInsensitive);
|
||||||
|
#endif
|
||||||
qDebug("Dropped file %s on download list", file.toLocal8Bit().data());
|
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)) {
|
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);
|
BTSession->downloadFromUrl(file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user