Browse Source

Revise SettingsStorage store/load value interface

adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
be5af2796d
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 16
      src/app/application.cpp
  2. 10
      src/app/upgrade.cpp
  3. 2
      src/base/bittorrent/portforwarderimpl.cpp
  4. 12
      src/base/net/proxyconfigurationmanager.cpp
  5. 6
      src/base/rss/rss_autodownloader.cpp
  6. 10
      src/base/rss/rss_session.cpp
  7. 7
      src/base/settingsstorage.cpp
  8. 40
      src/base/settingsstorage.h
  9. 20
      src/base/settingvalue.h
  10. 20
      src/gui/addnewtorrentdialog.cpp
  11. 4
      src/gui/cookiesdialog.cpp
  12. 10
      src/gui/mainwindow.cpp

16
src/app/application.cpp

@ -214,7 +214,7 @@ const QBtCommandLineParameters &Application::commandLineArgs() const @@ -214,7 +214,7 @@ const QBtCommandLineParameters &Application::commandLineArgs() const
bool Application::isFileLoggerEnabled() const
{
return settings()->loadValue(KEY_FILELOGGER_ENABLED, true).toBool();
return settings()->loadValue(KEY_FILELOGGER_ENABLED, true);
}
void Application::setFileLoggerEnabled(const bool value)
@ -228,8 +228,8 @@ void Application::setFileLoggerEnabled(const bool value) @@ -228,8 +228,8 @@ void Application::setFileLoggerEnabled(const bool value)
QString Application::fileLoggerPath() const
{
return settings()->loadValue(KEY_FILELOGGER_PATH,
{specialFolderLocation(SpecialFolder::Data) + LOG_FOLDER}).toString();
return settings()->loadValue(KEY_FILELOGGER_PATH
, QString {specialFolderLocation(SpecialFolder::Data) + LOG_FOLDER});
}
void Application::setFileLoggerPath(const QString &path)
@ -241,7 +241,7 @@ void Application::setFileLoggerPath(const QString &path) @@ -241,7 +241,7 @@ void Application::setFileLoggerPath(const QString &path)
bool Application::isFileLoggerBackup() const
{
return settings()->loadValue(KEY_FILELOGGER_BACKUP, true).toBool();
return settings()->loadValue(KEY_FILELOGGER_BACKUP, true);
}
void Application::setFileLoggerBackup(const bool value)
@ -253,7 +253,7 @@ void Application::setFileLoggerBackup(const bool value) @@ -253,7 +253,7 @@ void Application::setFileLoggerBackup(const bool value)
bool Application::isFileLoggerDeleteOld() const
{
return settings()->loadValue(KEY_FILELOGGER_DELETEOLD, true).toBool();
return settings()->loadValue(KEY_FILELOGGER_DELETEOLD, true);
}
void Application::setFileLoggerDeleteOld(const bool value)
@ -265,7 +265,7 @@ void Application::setFileLoggerDeleteOld(const bool value) @@ -265,7 +265,7 @@ void Application::setFileLoggerDeleteOld(const bool value)
int Application::fileLoggerMaxSize() const
{
const int val = settings()->loadValue(KEY_FILELOGGER_MAXSIZEBYTES, DEFAULT_FILELOG_SIZE).toInt();
const int val = settings()->loadValue(KEY_FILELOGGER_MAXSIZEBYTES, DEFAULT_FILELOG_SIZE);
return std::min(std::max(val, MIN_FILELOG_SIZE), MAX_FILELOG_SIZE);
}
@ -279,7 +279,7 @@ void Application::setFileLoggerMaxSize(const int bytes) @@ -279,7 +279,7 @@ void Application::setFileLoggerMaxSize(const int bytes)
int Application::fileLoggerAge() const
{
const int val = settings()->loadValue(KEY_FILELOGGER_AGE, 1).toInt();
const int val = settings()->loadValue(KEY_FILELOGGER_AGE, 1);
return std::min(std::max(val, 1), 365);
}
@ -290,7 +290,7 @@ void Application::setFileLoggerAge(const int value) @@ -290,7 +290,7 @@ void Application::setFileLoggerAge(const int value)
int Application::fileLoggerAgeType() const
{
const int val = settings()->loadValue(KEY_FILELOGGER_AGETYPE, 1).toInt();
const int val = settings()->loadValue(KEY_FILELOGGER_AGETYPE, 1);
return ((val < 0) || (val > 2)) ? 1 : val;
}

10
src/app/upgrade.cpp

@ -46,8 +46,8 @@ namespace @@ -46,8 +46,8 @@ namespace
const auto migrate = [](const QString &oldKey, const QString &newKey, const QString &savePath)
{
SettingsStorage *settingsStorage {SettingsStorage::instance()};
const QByteArray oldData {settingsStorage->loadValue(oldKey).toByteArray()};
const QString newData {settingsStorage->loadValue(newKey).toString()};
const auto oldData {settingsStorage->loadValue<QByteArray>(oldKey)};
const auto newData {settingsStorage->loadValue<QString>(newKey)};
const QString errorMsgFormat {QObject::tr("Migrate preferences failed: WebUI https, file: \"%1\", error: \"%2\"")};
if (!newData.isEmpty() || oldData.isEmpty())
@ -89,8 +89,8 @@ namespace @@ -89,8 +89,8 @@ namespace
const QString newKey {QLatin1String {"BitTorrent/Session/TorrentContentLayout"}};
SettingsStorage *settingsStorage {SettingsStorage::instance()};
const QVariant oldData {settingsStorage->loadValue(oldKey)};
const QString newData {settingsStorage->loadValue(newKey).toString()};
const auto oldData {settingsStorage->loadValue<QVariant>(oldKey)};
const auto newData {settingsStorage->loadValue<QString>(newKey)};
if (!newData.isEmpty() || !oldData.isValid())
return;
@ -128,7 +128,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode) @@ -128,7 +128,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode)
SettingsStorage *settingsStorage {SettingsStorage::instance()};
for (auto it = changedDefaults.cbegin(); it != changedDefaults.cend(); ++it)
{
if (settingsStorage->loadValue(it->name).isNull())
if (settingsStorage->loadValue<QVariant>(it->name).isNull())
settingsStorage->storeValue(it->name, (mode == DefaultPreferencesMode::Legacy ? it->legacy : it->current));
}
}

2
src/base/bittorrent/portforwarderimpl.cpp

@ -39,7 +39,7 @@ const QString KEY_ENABLED = QStringLiteral("Network/PortForwardingEnabled"); @@ -39,7 +39,7 @@ const QString KEY_ENABLED = QStringLiteral("Network/PortForwardingEnabled");
PortForwarderImpl::PortForwarderImpl(lt::session *provider, QObject *parent)
: Net::PortForwarder {parent}
, m_active {SettingsStorage::instance()->loadValue(KEY_ENABLED, true).toBool()}
, m_active {SettingsStorage::instance()->loadValue(KEY_ENABLED, true)}
, m_provider {provider}
{
if (m_active)

12
src/base/net/proxyconfigurationmanager.cpp

@ -64,15 +64,15 @@ ProxyConfigurationManager *ProxyConfigurationManager::m_instance = nullptr; @@ -64,15 +64,15 @@ ProxyConfigurationManager *ProxyConfigurationManager::m_instance = nullptr;
ProxyConfigurationManager::ProxyConfigurationManager(QObject *parent)
: QObject(parent)
{
m_isProxyOnlyForTorrents = settings()->loadValue(KEY_ONLY_FOR_TORRENTS, false).toBool();
m_isProxyOnlyForTorrents = settings()->loadValue(KEY_ONLY_FOR_TORRENTS, false);
m_config.type = static_cast<ProxyType>(
settings()->loadValue(KEY_TYPE, static_cast<int>(ProxyType::None)).toInt());
settings()->loadValue(KEY_TYPE, static_cast<int>(ProxyType::None)));
if ((m_config.type < ProxyType::None) || (m_config.type > ProxyType::SOCKS4))
m_config.type = ProxyType::None;
m_config.ip = settings()->loadValue(KEY_IP, "0.0.0.0").toString();
m_config.port = static_cast<ushort>(settings()->loadValue(KEY_PORT, 8080).toUInt());
m_config.username = settings()->loadValue(KEY_USERNAME).toString();
m_config.password = settings()->loadValue(KEY_PASSWORD).toString();
m_config.ip = settings()->loadValue<QString>(KEY_IP, "0.0.0.0");
m_config.port = settings()->loadValue<ushort>(KEY_PORT, 8080);
m_config.username = settings()->loadValue<QString>(KEY_USERNAME);
m_config.password = settings()->loadValue<QString>(KEY_PASSWORD);
configureProxy();
}

6
src/base/rss/rss_autodownloader.cpp

@ -105,7 +105,7 @@ QString computeSmartFilterRegex(const QStringList &filters) @@ -105,7 +105,7 @@ QString computeSmartFilterRegex(const QStringList &filters)
}
AutoDownloader::AutoDownloader()
: m_processingEnabled(SettingsStorage::instance()->loadValue(SettingsKey_ProcessingEnabled, false).toBool())
: m_processingEnabled(SettingsStorage::instance()->loadValue(SettingsKey_ProcessingEnabled, false))
, m_processingTimer(new QTimer(this))
, m_ioThread(new QThread(this))
{
@ -290,7 +290,7 @@ void AutoDownloader::importRulesFromLegacyFormat(const QByteArray &data) @@ -290,7 +290,7 @@ void AutoDownloader::importRulesFromLegacyFormat(const QByteArray &data)
QStringList AutoDownloader::smartEpisodeFilters() const
{
const QVariant filtersSetting = SettingsStorage::instance()->loadValue(SettingsKey_SmartEpisodeFilter);
const auto filtersSetting = SettingsStorage::instance()->loadValue<QVariant>(SettingsKey_SmartEpisodeFilter);
if (filtersSetting.isNull())
{
@ -323,7 +323,7 @@ void AutoDownloader::setSmartEpisodeFilters(const QStringList &filters) @@ -323,7 +323,7 @@ void AutoDownloader::setSmartEpisodeFilters(const QStringList &filters)
bool AutoDownloader::downloadRepacks() const
{
return SettingsStorage::instance()->loadValue(SettingsKey_DownloadRepacks, true).toBool();
return SettingsStorage::instance()->loadValue(SettingsKey_DownloadRepacks, true);
}
void AutoDownloader::setDownloadRepacks(const bool downloadRepacks)

10
src/base/rss/rss_session.cpp

@ -63,10 +63,10 @@ using namespace RSS; @@ -63,10 +63,10 @@ using namespace RSS;
QPointer<Session> Session::m_instance = nullptr;
Session::Session()
: m_processingEnabled(SettingsStorage::instance()->loadValue(SettingsKey_ProcessingEnabled, false).toBool())
: m_processingEnabled(SettingsStorage::instance()->loadValue(SettingsKey_ProcessingEnabled, false))
, m_workingThread(new QThread(this))
, m_refreshInterval(SettingsStorage::instance()->loadValue(SettingsKey_RefreshInterval, 30).toInt())
, m_maxArticlesPerFeed(SettingsStorage::instance()->loadValue(SettingsKey_MaxArticlesPerFeed, 50).toInt())
, m_refreshInterval(SettingsStorage::instance()->loadValue(SettingsKey_RefreshInterval, 30))
, m_maxArticlesPerFeed(SettingsStorage::instance()->loadValue(SettingsKey_MaxArticlesPerFeed, 50))
{
Q_ASSERT(!m_instance); // only one instance is allowed
m_instance = this;
@ -362,8 +362,8 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder) @@ -362,8 +362,8 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
void Session::loadLegacy()
{
const QStringList legacyFeedPaths = SettingsStorage::instance()->loadValue("Rss/streamList").toStringList();
const QStringList feedAliases = SettingsStorage::instance()->loadValue("Rss/streamAlias").toStringList();
const auto legacyFeedPaths = SettingsStorage::instance()->loadValue<QStringList>("Rss/streamList");
const auto feedAliases = SettingsStorage::instance()->loadValue<QStringList>("Rss/streamAlias");
if (legacyFeedPaths.size() != feedAliases.size())
{
Logger::instance()->addMessage("Corrupted RSS list, not loading it.", Log::WARNING);

7
src/base/settingsstorage.cpp

@ -153,8 +153,7 @@ namespace @@ -153,8 +153,7 @@ namespace
SettingsStorage *SettingsStorage::m_instance = nullptr;
SettingsStorage::SettingsStorage()
: m_data{TransactionalSettings(QLatin1String("qBittorrent")).read()}
, m_dirty(false)
: m_data {TransactionalSettings(QLatin1String("qBittorrent")).read()}
{
m_timer.setSingleShot(true);
m_timer.setInterval(5 * 1000);
@ -200,14 +199,14 @@ bool SettingsStorage::save() @@ -200,14 +199,14 @@ bool SettingsStorage::save()
return true;
}
QVariant SettingsStorage::loadValue(const QString &key, const QVariant &defaultValue) const
QVariant SettingsStorage::loadValueImpl(const QString &key, const QVariant &defaultValue) const
{
const QString realKey = mapKey(key);
const QReadLocker locker(&m_lock);
return m_data.value(realKey, defaultValue);
}
void SettingsStorage::storeValue(const QString &key, const QVariant &value)
void SettingsStorage::storeValueImpl(const QString &key, const QVariant &value)
{
const QString realKey = mapKey(key);
const QWriteLocker locker(&m_lock);

40
src/base/settingsstorage.h

@ -29,11 +29,15 @@ @@ -29,11 +29,15 @@
#pragma once
#include <type_traits>
#include <QObject>
#include <QReadWriteLock>
#include <QTimer>
#include <QVariantHash>
#include "utils/string.h"
class SettingsStorage : public QObject
{
Q_OBJECT
@ -45,18 +49,48 @@ public: @@ -45,18 +49,48 @@ public:
static void freeInstance();
static SettingsStorage *instance();
QVariant loadValue(const QString &key, const QVariant &defaultValue = {}) const;
void storeValue(const QString &key, const QVariant &value);
template <typename T>
T loadValue(const QString &key, const T &defaultValue = {}) const
{
if constexpr (std::is_enum_v<T>)
{
const auto value = loadValueImpl(key).toString();
return Utils::String::toEnum(value, defaultValue);
}
else if constexpr (std::is_same_v<T, QVariant>)
{
return loadValueImpl(key, defaultValue);
}
else
{
const QVariant value = loadValueImpl(key);
// check if retrieved value is convertible to T
return value.template canConvert<T>() ? value.template value<T>() : defaultValue;
}
}
template <typename T>
void storeValue(const QString &key, const T &value)
{
if constexpr (std::is_enum_v<T>)
storeValueImpl(key, Utils::String::fromEnum(value));
else
storeValueImpl(key, value);
}
void removeValue(const QString &key);
public slots:
bool save();
private:
QVariant loadValueImpl(const QString &key, const QVariant &defaultValue = {}) const;
void storeValueImpl(const QString &key, const QVariant &value);
static SettingsStorage *m_instance;
bool m_dirty = false;
QVariantHash m_data;
bool m_dirty;
QTimer m_timer;
mutable QReadWriteLock m_lock;
};

20
src/base/settingvalue.h

@ -28,12 +28,9 @@ @@ -28,12 +28,9 @@
#pragma once
#include <type_traits>
#include <QString>
#include "settingsstorage.h"
#include "utils/string.h"
// This is a thin/handy wrapper over `SettingsStorage`. Use it when store/load value
// rarely occurs, otherwise use `CachedSettingValue`.
@ -48,17 +45,7 @@ public: @@ -48,17 +45,7 @@ public:
T get(const T &defaultValue = {}) const
{
if constexpr (std::is_enum_v<T>)
{
const auto value = SettingsStorage::instance()->loadValue(m_keyName, {}).toString();
return Utils::String::toEnum(value, defaultValue);
}
else
{
const QVariant value = SettingsStorage::instance()->loadValue(m_keyName);
// check if retrieved value is convertible to T
return value.template canConvert<T>() ? value.template value<T>() : defaultValue;
}
return SettingsStorage::instance()->loadValue(m_keyName, defaultValue);
}
operator T() const
@ -68,10 +55,7 @@ public: @@ -68,10 +55,7 @@ public:
SettingValue<T> &operator=(const T &value)
{
if constexpr (std::is_enum_v<T>)
SettingsStorage::instance()->storeValue(m_keyName, Utils::String::fromEnum(value));
else
SettingsStorage::instance()->storeValue(m_keyName, value);
SettingsStorage::instance()->storeValue(m_keyName, value);
return *this;
}

20
src/gui/addnewtorrentdialog.cpp

@ -120,7 +120,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP @@ -120,7 +120,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
populateSavePathComboBox();
connect(m_ui->savePath, &FileSystemPathEdit::selectedPathChanged, this, &AddNewTorrentDialog::onSavePathChanged);
const bool rememberLastSavePath = settings()->loadValue(KEY_REMEMBERLASTSAVEPATH, false).toBool();
const bool rememberLastSavePath = settings()->loadValue(KEY_REMEMBERLASTSAVEPATH, false);
m_ui->checkBoxRememberLastSavePath->setChecked(rememberLastSavePath);
m_ui->contentLayoutComboBox->setCurrentIndex(
@ -135,7 +135,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP @@ -135,7 +135,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
// Load categories
QStringList categories = session->categories().keys();
std::sort(categories.begin(), categories.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
QString defaultCategory = settings()->loadValue(KEY_DEFAULTCATEGORY).toString();
auto defaultCategory = settings()->loadValue<QString>(KEY_DEFAULTCATEGORY);
if (!m_torrentParams.category.isEmpty())
m_ui->categoryComboBox->addItem(m_torrentParams.category);
@ -170,7 +170,7 @@ AddNewTorrentDialog::~AddNewTorrentDialog() @@ -170,7 +170,7 @@ AddNewTorrentDialog::~AddNewTorrentDialog()
bool AddNewTorrentDialog::isEnabled()
{
return SettingsStorage::instance()->loadValue(KEY_ENABLED, true).toBool();
return SettingsStorage::instance()->loadValue(KEY_ENABLED, true);
}
void AddNewTorrentDialog::setEnabled(bool value)
@ -180,7 +180,7 @@ void AddNewTorrentDialog::setEnabled(bool value) @@ -180,7 +180,7 @@ void AddNewTorrentDialog::setEnabled(bool value)
bool AddNewTorrentDialog::isTopLevel()
{
return SettingsStorage::instance()->loadValue(KEY_TOPLEVEL, true).toBool();
return SettingsStorage::instance()->loadValue(KEY_TOPLEVEL, true);
}
void AddNewTorrentDialog::setTopLevel(bool value)
@ -191,7 +191,7 @@ void AddNewTorrentDialog::setTopLevel(bool value) @@ -191,7 +191,7 @@ void AddNewTorrentDialog::setTopLevel(bool value)
int AddNewTorrentDialog::savePathHistoryLength()
{
const int defaultHistoryLength = 8;
const int value = settings()->loadValue(KEY_SAVEPATHHISTORYLENGTH, defaultHistoryLength).toInt();
const int value = settings()->loadValue(KEY_SAVEPATHHISTORYLENGTH, defaultHistoryLength);
return qBound(minPathHistoryLength, value, maxPathHistoryLength);
}
@ -204,14 +204,14 @@ void AddNewTorrentDialog::setSavePathHistoryLength(int value) @@ -204,14 +204,14 @@ void AddNewTorrentDialog::setSavePathHistoryLength(int value)
settings()->storeValue(KEY_SAVEPATHHISTORYLENGTH, clampedValue);
settings()->storeValue(KEY_SAVEPATHHISTORY
, QStringList(settings()->loadValue(KEY_SAVEPATHHISTORY).toStringList().mid(0, clampedValue)));
, QStringList(settings()->loadValue<QStringList>(KEY_SAVEPATHHISTORY).mid(0, clampedValue)));
}
void AddNewTorrentDialog::loadState()
{
Utils::Gui::resize(this, m_storeDialogSize);
m_ui->splitter->restoreState(m_storeSplitterState);
m_headerState = settings()->loadValue(KEY_TREEHEADERSTATE).toByteArray();
m_headerState = settings()->loadValue<QByteArray>(KEY_TREEHEADERSTATE);
}
void AddNewTorrentDialog::saveState()
@ -371,7 +371,7 @@ void AddNewTorrentDialog::showEvent(QShowEvent *event) @@ -371,7 +371,7 @@ void AddNewTorrentDialog::showEvent(QShowEvent *event)
void AddNewTorrentDialog::saveSavePathHistory() const
{
// Get current history
QStringList history = settings()->loadValue(KEY_SAVEPATHHISTORY).toStringList();
auto history = settings()->loadValue<QStringList>(KEY_SAVEPATHHISTORY);
QVector<QDir> historyDirs;
for (const QString &path : asConst(history))
historyDirs << QDir {path};
@ -489,11 +489,11 @@ void AddNewTorrentDialog::populateSavePathComboBox() @@ -489,11 +489,11 @@ void AddNewTorrentDialog::populateSavePathComboBox()
m_ui->savePath->clear();
// Load save path history
const QStringList savePathHistory {settings()->loadValue(KEY_SAVEPATHHISTORY).toStringList()};
const auto savePathHistory {settings()->loadValue<QStringList>(KEY_SAVEPATHHISTORY)};
for (const QString &savePath : savePathHistory)
m_ui->savePath->addItem(savePath);
const bool rememberLastSavePath {settings()->loadValue(KEY_REMEMBERLASTSAVEPATH, false).toBool()};
const bool rememberLastSavePath {settings()->loadValue(KEY_REMEMBERLASTSAVEPATH, false)};
const QString defSavePath {BitTorrent::Session::instance()->defaultSavePath()};
if (!m_torrentParams.savePath.isEmpty())

4
src/gui/cookiesdialog.cpp

@ -61,9 +61,9 @@ CookiesDialog::CookiesDialog(QWidget *parent) @@ -61,9 +61,9 @@ CookiesDialog::CookiesDialog(QWidget *parent)
m_cookiesModel->index(0, 0),
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
Utils::Gui::resize(this, SettingsStorage::instance()->loadValue(KEY_SIZE).toSize());
Utils::Gui::resize(this, SettingsStorage::instance()->loadValue<QSize>(KEY_SIZE));
m_ui->treeView->header()->restoreState(
SettingsStorage::instance()->loadValue(KEY_COOKIESVIEWSTATE).toByteArray());
SettingsStorage::instance()->loadValue<QByteArray>(KEY_COOKIESVIEWSTATE));
}
CookiesDialog::~CookiesDialog()

10
src/gui/mainwindow.cpp

@ -491,7 +491,7 @@ MainWindow::~MainWindow() @@ -491,7 +491,7 @@ MainWindow::~MainWindow()
bool MainWindow::isExecutionLogEnabled() const
{
return settings()->loadValue(KEY_EXECUTIONLOG_ENABLED, false).toBool();
return settings()->loadValue(KEY_EXECUTIONLOG_ENABLED, false);
}
void MainWindow::setExecutionLogEnabled(bool value)
@ -503,7 +503,7 @@ int MainWindow::executionLogMsgTypes() const @@ -503,7 +503,7 @@ int MainWindow::executionLogMsgTypes() const
{
// as default value we need all the bits set
// -1 is considered the portable way to achieve that
return settings()->loadValue(KEY_EXECUTIONLOG_TYPES, -1).toInt();
return settings()->loadValue(KEY_EXECUTIONLOG_TYPES, -1);
}
void MainWindow::setExecutionLogMsgTypes(const int value)
@ -514,7 +514,7 @@ void MainWindow::setExecutionLogMsgTypes(const int value) @@ -514,7 +514,7 @@ void MainWindow::setExecutionLogMsgTypes(const int value)
bool MainWindow::isNotificationsEnabled() const
{
return settings()->loadValue(KEY_NOTIFICATIONS_ENABLED, true).toBool();
return settings()->loadValue(KEY_NOTIFICATIONS_ENABLED, true);
}
void MainWindow::setNotificationsEnabled(bool value)
@ -524,7 +524,7 @@ void MainWindow::setNotificationsEnabled(bool value) @@ -524,7 +524,7 @@ void MainWindow::setNotificationsEnabled(bool value)
bool MainWindow::isTorrentAddedNotificationsEnabled() const
{
return settings()->loadValue(KEY_NOTIFICATIONS_TORRENTADDED, false).toBool();
return settings()->loadValue(KEY_NOTIFICATIONS_TORRENTADDED, false);
}
void MainWindow::setTorrentAddedNotificationsEnabled(bool value)
@ -534,7 +534,7 @@ void MainWindow::setTorrentAddedNotificationsEnabled(bool value) @@ -534,7 +534,7 @@ void MainWindow::setTorrentAddedNotificationsEnabled(bool value)
bool MainWindow::isDownloadTrackerFavicon() const
{
return settings()->loadValue(KEY_DOWNLOAD_TRACKER_FAVICON, false).toBool();
return settings()->loadValue(KEY_DOWNLOAD_TRACKER_FAVICON, false);
}
void MainWindow::setDownloadTrackerFavicon(bool value)

Loading…
Cancel
Save