|
|
@ -890,13 +890,13 @@ void MainWindow::dropEvent(QDropEvent *event) { |
|
|
|
} |
|
|
|
} |
|
|
|
if (file.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (file.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
AddNewTorrentDialog::showMagnet(file); |
|
|
|
AddNewTorrentDialog::showMagnet(file, this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addMagnetUri(file); |
|
|
|
QBtSession::instance()->addMagnetUri(file); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Local file
|
|
|
|
// Local file
|
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
AddNewTorrentDialog::showTorrent(file); |
|
|
|
AddNewTorrentDialog::showTorrent(file, QString(), this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addTorrent(file); |
|
|
|
QBtSession::instance()->addTorrent(file); |
|
|
|
} |
|
|
|
} |
|
|
@ -932,7 +932,7 @@ void MainWindow::on_actionOpen_triggered() { |
|
|
|
const uint listSize = pathsList.size(); |
|
|
|
const uint listSize = pathsList.size(); |
|
|
|
for (uint i=0; i<listSize; ++i) { |
|
|
|
for (uint i=0; i<listSize; ++i) { |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
AddNewTorrentDialog::showTorrent(pathsList.at(i)); |
|
|
|
AddNewTorrentDialog::showTorrent(pathsList.at(i), QString(), this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addTorrent(pathsList.at(i)); |
|
|
|
QBtSession::instance()->addTorrent(pathsList.at(i)); |
|
|
|
} |
|
|
|
} |
|
|
@ -975,12 +975,12 @@ void MainWindow::processParams(const QStringList& params) { |
|
|
|
} |
|
|
|
} |
|
|
|
if (param.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (param.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
AddNewTorrentDialog::showMagnet(param); |
|
|
|
AddNewTorrentDialog::showMagnet(param, this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addMagnetUri(param); |
|
|
|
QBtSession::instance()->addMagnetUri(param); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
AddNewTorrentDialog::showTorrent(param); |
|
|
|
AddNewTorrentDialog::showTorrent(param, QString(), this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addTorrent(param); |
|
|
|
QBtSession::instance()->addTorrent(param); |
|
|
|
} |
|
|
|
} |
|
|
@ -995,7 +995,7 @@ void MainWindow::addTorrent(QString path) { |
|
|
|
void MainWindow::processDownloadedFiles(QString path, QString url) { |
|
|
|
void MainWindow::processDownloadedFiles(QString path, QString url) { |
|
|
|
Preferences* const pref = Preferences::instance(); |
|
|
|
Preferences* const pref = Preferences::instance(); |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
AddNewTorrentDialog::showTorrent(path, url); |
|
|
|
AddNewTorrentDialog::showTorrent(path, url, this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addTorrent(path, false, url); |
|
|
|
QBtSession::instance()->addTorrent(path, false, url); |
|
|
|
} |
|
|
|
} |
|
|
@ -1003,7 +1003,7 @@ void MainWindow::processDownloadedFiles(QString path, QString url) { |
|
|
|
void MainWindow::processNewMagnetLink(const QString& link) { |
|
|
|
void MainWindow::processNewMagnetLink(const QString& link) { |
|
|
|
Preferences* const pref = Preferences::instance(); |
|
|
|
Preferences* const pref = Preferences::instance(); |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
if (pref->useAdditionDialog()) |
|
|
|
AddNewTorrentDialog::showMagnet(link); |
|
|
|
AddNewTorrentDialog::showMagnet(link, this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addMagnetUri(link); |
|
|
|
QBtSession::instance()->addMagnetUri(link); |
|
|
|
} |
|
|
|
} |
|
|
@ -1198,7 +1198,7 @@ void MainWindow::downloadFromURLList(const QStringList& url_list) { |
|
|
|
} |
|
|
|
} |
|
|
|
if (url.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (url.startsWith("magnet:", Qt::CaseInsensitive)) { |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
if (useTorrentAdditionDialog) |
|
|
|
AddNewTorrentDialog::showMagnet(url); |
|
|
|
AddNewTorrentDialog::showMagnet(url, this); |
|
|
|
else |
|
|
|
else |
|
|
|
QBtSession::instance()->addMagnetUri(url); |
|
|
|
QBtSession::instance()->addMagnetUri(url); |
|
|
|
} |
|
|
|
} |
|
|
|