From 94aeac992cb9c9ff16d84cec7643658c6726a056 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 21 Nov 2017 14:13:36 +0800 Subject: [PATCH] Allow drag-n-drop magnet links to mainwindow. Closes #7742. --- src/gui/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 793df0026..eeb85be78 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1242,7 +1242,8 @@ void MainWindow::dropEvent(QDropEvent *event) // differentiate ".torrent" files and others QStringList torrentFiles, otherFiles; foreach (const QString &file, files) { - if (file.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive)) + if (file.startsWith("magnet:", Qt::CaseInsensitive) + || file.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive)) torrentFiles << file; else otherFiles << file; @@ -1251,7 +1252,6 @@ void MainWindow::dropEvent(QDropEvent *event) // Download torrents const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled(); foreach (const QString &file, torrentFiles) { - qDebug("Dropped file %s on download list", qUtf8Printable(file)); if (useTorrentAdditionDialog) AddNewTorrentDialog::show(file, this); else