diff --git a/src/base/torrentfileguard.cpp b/src/base/torrentfileguard.cpp index 6ccc896f6..db2273358 100644 --- a/src/base/torrentfileguard.cpp +++ b/src/base/torrentfileguard.cpp @@ -84,7 +84,7 @@ TorrentFileGuard::AutoDeleteMode TorrentFileGuard::autoDeleteMode() KEY_AUTO_DELETE_ENABLED, meta.valueToKey(Never)).toByteArray())); } -void TorrentFileGuard::setautoDeleteMode(TorrentFileGuard::AutoDeleteMode mode) +void TorrentFileGuard::setAutoDeleteMode(TorrentFileGuard::AutoDeleteMode mode) { QMetaEnum meta {modeMetaEnum()}; SettingsStorage::instance()->storeValue(KEY_AUTO_DELETE_ENABLED, meta.valueToKey(mode)); diff --git a/src/base/torrentfileguard.h b/src/base/torrentfileguard.h index cd5bb68f0..f1930a2f3 100644 --- a/src/base/torrentfileguard.h +++ b/src/base/torrentfileguard.h @@ -68,7 +68,7 @@ public: // static interface to get/set preferences static AutoDeleteMode autoDeleteMode(); - static void setautoDeleteMode(AutoDeleteMode mode); + static void setAutoDeleteMode(AutoDeleteMode mode); private: static QMetaEnum modeMetaEnum(); diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index df8812ea1..345ac7581 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -259,6 +259,7 @@ bool AddNewTorrentDialog::loadMagnet(const BitTorrent::MagnetUri &magnetUri) return false; } + m_torrentGuard.reset(new TorrentFileGuard(QString())); m_hash = magnetUri.hash(); // Prevent showing the dialog if download is already present if (BitTorrent::Session::instance()->isKnownTorrent(m_hash)) { diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index b4cf8905d..e7b5741d7 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -519,7 +519,7 @@ void options_imp::saveOptions() pref->setAutoRunProgram(autoRun_txt->text().trimmed()); pref->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl()); pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn()); - TorrentFileGuard::setautoDeleteMode(!deleteTorrentBox->isChecked() ? TorrentFileGuard::Never + TorrentFileGuard::setAutoDeleteMode(!deleteTorrentBox->isChecked() ? TorrentFileGuard::Never : !deleteCancelledTorrentBox->isChecked() ? TorrentFileGuard::IfAdded : TorrentFileGuard::Always); // End Downloads preferences