Browse Source

Display message about libtorrent plugins for the correct case.

adaptive-webui-19844
sledgehammer999 8 years ago
parent
commit
59b570cf62
  1. 8
      src/base/bittorrent/session.cpp
  2. 6
      src/base/bittorrent/session.h

8
src/base/bittorrent/session.cpp

@ -308,6 +308,8 @@ Session::Session(QObject *parent) @@ -308,6 +308,8 @@ Session::Session(QObject *parent)
, m_isDisableAutoTMMWhenCategorySavePathChanged(BITTORRENT_SESSION_KEY("DisableAutoTMMTriggers/CategorySavePathChanged"), true)
, m_isTrackerEnabled(BITTORRENT_KEY("TrackerEnabled"), false)
, m_bannedIPs("State/BannedIPs")
, m_wasPexEnabled(m_isPeXEnabled)
, m_wasTrackerExchangeEnabled(m_wasTrackerExchangeEnabled)
, m_numResumeData(0)
, m_extraLimit(0)
, m_useProxy(false)
@ -515,10 +517,9 @@ bool Session::isPeXEnabled() const @@ -515,10 +517,9 @@ bool Session::isPeXEnabled() const
void Session::setPeXEnabled(bool enabled)
{
if (enabled != isPeXEnabled()) {
m_isPeXEnabled = enabled;
if (m_wasPexEnabled != enabled)
Logger::instance()->addMessage(tr("Restart is required to toggle PeX support"), Log::WARNING);
}
}
bool Session::isTrackerExchangeEnabled() const
@ -528,10 +529,9 @@ bool Session::isTrackerExchangeEnabled() const @@ -528,10 +529,9 @@ bool Session::isTrackerExchangeEnabled() const
void Session::setTrackerExchangeEnabled(bool enabled)
{
if (enabled != isTrackerExchangeEnabled()) {
m_isTrackerExchangeEnabled = enabled;
if (m_wasTrackerExchangeEnabled != enabled)
Logger::instance()->addMessage(tr("Restart is required to toggle Tracker Exchange support"), Log::WARNING);
}
}
bool Session::isTempPathEnabled() const

6
src/base/bittorrent/session.h

@ -572,6 +572,12 @@ namespace BitTorrent @@ -572,6 +572,12 @@ namespace BitTorrent
CachedSettingValue<bool> m_isTrackerEnabled;
CachedSettingValue<QStringList> m_bannedIPs;
// Order is important. These need to be declared after their CachedSettingsValue
// counterparts, because they use them for initialization in the constructor
// initialization list.
const bool m_wasPexEnabled;
const bool m_wasTrackerExchangeEnabled;
int m_numResumeData;
int m_extraLimit;
QList<BitTorrent::TrackerEntry> m_additionalTrackerList;

Loading…
Cancel
Save