From 155316c30e40ea4dae6a7708fcbeefbd18cc2e81 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 31 Dec 2010 08:47:13 +0000 Subject: [PATCH] Fix drag'n drop --- src/mainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f4345455e..7c8687f3d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -798,17 +798,25 @@ void MainWindow::dropEvent(QDropEvent *event) { QBtSession::instance()->downloadFromUrl(file); continue; } + // Bitcomet or Magnet link if(file.startsWith("bc://bt/", Qt::CaseInsensitive)) { qDebug("Converting bc link to magnet link"); file = misc::bcLinkToMagnet(file); } if(file.startsWith("magnet:", Qt::CaseInsensitive)) { - // FIXME: Possibly skipped torrent addition dialog - QBtSession::instance()->addMagnetUri(file); + if(useTorrentAdditionDialog) { + torrentAdditionDialog *dialog = new torrentAdditionDialog(this); + dialog->showLoadMagnetURI(file); + } else { + QBtSession::instance()->addMagnetUri(file); + } continue; } + // Local file if(useTorrentAdditionDialog) { torrentAdditionDialog *dialog = new torrentAdditionDialog(this); + if(file.startsWith("file:", Qt::CaseInsensitive)) + file = QUrl(file).toLocalFile(); dialog->showLoad(file); }else{ QBtSession::instance()->addTorrent(file);