Revise SettingsStorage store/load value interface

This commit is contained in:
Chocobo1 2021-01-01 22:57:21 +08:00
parent b1020c599f
commit be5af2796d
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
12 changed files with 87 additions and 70 deletions

View file

@ -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
{
// 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)
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)
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)
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)