From fe98c36abf8fad4ddfe437917bac2a29a7e4f620 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 842c8e52a..b2cc23819 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);