Browse Source

Merge pull request #5249 from evsh/auto-remove-torrents

Fix a typo in TorrentFileGuard and a crash when adding torrent via magnet link
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
4f78a50add
  1. 2
      src/base/torrentfileguard.cpp
  2. 2
      src/base/torrentfileguard.h
  3. 1
      src/gui/addnewtorrentdialog.cpp
  4. 2
      src/gui/options_imp.cpp

2
src/base/torrentfileguard.cpp

@ -84,7 +84,7 @@ TorrentFileGuard::AutoDeleteMode TorrentFileGuard::autoDeleteMode() @@ -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));

2
src/base/torrentfileguard.h

@ -68,7 +68,7 @@ public: @@ -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();

1
src/gui/addnewtorrentdialog.cpp

@ -259,6 +259,7 @@ bool AddNewTorrentDialog::loadMagnet(const BitTorrent::MagnetUri &magnetUri) @@ -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)) {

2
src/gui/options_imp.cpp

@ -519,7 +519,7 @@ void options_imp::saveOptions() @@ -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

Loading…
Cancel
Save