From 553abb6442a03a8d253cd299b0f8e7679a71a1c2 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Mon, 11 Feb 2013 23:38:33 +0200 Subject: [PATCH] Fix 'dont show' dialog when downloading torrent. Closes issue #405. --- src/mainwindow.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0819be96f..fb3feb2d9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -994,19 +994,16 @@ void MainWindow::addTorrent(QString path) { } void MainWindow::processDownloadedFiles(QString path, QString url) { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); - if (useTorrentAdditionDialog) + Preferences pref; + if (pref.useAdditionDialog()) AddNewTorrentDialog::showTorrent(path, url); else QBtSession::instance()->addTorrent(path, false, url); } -void MainWindow::processNewMagnetLink(const QString& link) -{ - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); - if (useTorrentAdditionDialog) +void MainWindow::processNewMagnetLink(const QString& link) { + Preferences pref; + if (pref.useAdditionDialog()) AddNewTorrentDialog::showMagnet(link); else QBtSession::instance()->addMagnetUri(link);