Browse Source

Fix drag'n drop

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
155316c30e
  1. 10
      src/mainwindow.cpp

10
src/mainwindow.cpp

@ -798,17 +798,25 @@ void MainWindow::dropEvent(QDropEvent *event) { @@ -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
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);

Loading…
Cancel
Save