Display message about libtorrent plugins for the correct case.

This commit is contained in:
sledgehammer999 2016-10-31 02:06:29 +02:00
parent f391b24b1d
commit 59b570cf62
2 changed files with 12 additions and 6 deletions

View File

@ -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,11 +517,10 @@ 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,11 +529,10 @@ 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
{

View File

@ -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;