summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 12:26:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 12:29:08 -0700
commit1bf76dd3db9106fe99ee2f4bae7d7ecc4766faef (patch)
tree115566dd53815077a5201695073c8886428eba93 /core/subsurface-qt
parentf745a25cb7ee9dd2ee4e5e4299c04dc7a14ad35e (diff)
downloadsubsurface-1bf76dd3db9106fe99ee2f4bae7d7ecc4766faef.tar.gz
Settings update: Fix broken UpdateManger logic
In commit b76c1846bbfd ("Settings update: Simplify Update Manager") the logic for when to show the UpdateManger question to the user got broken. Unintuitively, a boolean setting actually has three possible values. True, False, and Unset. This patch fixes things to work as designed again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp7
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 16e7ab7f9..e71e1b1e8 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -78,6 +78,11 @@ bool UpdateManagerSettings::dontCheckForUpdates() const
return prefs.update_manager.dont_check_for_updates;
}
+bool UpdateManagerSettings::dontCheckExists() const
+{
+ return prefs.update_manager.dont_check_exists;
+}
+
QString UpdateManagerSettings::lastVersionUsed() const
{
return prefs.update_manager.last_version_used;
@@ -94,6 +99,7 @@ void UpdateManagerSettings::setDontCheckForUpdates(bool value)
s.beginGroup(group);
s.setValue("DontCheckForUpdates", value);
prefs.update_manager.dont_check_for_updates = value;
+ prefs.update_manager.dont_check_exists = true;
emit dontCheckForUpdatesChanged(value);
}
@@ -1934,6 +1940,7 @@ void SettingsObjectWrapper::load()
s.endGroup();
s.beginGroup("UpdateManager");
+ prefs.update_manager.dont_check_exists = s.contains("DontCheckForUpdates");
prefs.update_manager.dont_check_for_updates = s.value("DontCheckForUpdates").toBool();
prefs.update_manager.last_version_used = copy_string(qPrintable(s.value("LastVersionUsed").toString()));
prefs.update_manager.next_check = copy_string(qPrintable(s.value("NextCheck").toString()));
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 2f9bffd67..129fd2325 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -47,6 +47,7 @@ class UpdateManagerSettings : public QObject {
public:
UpdateManagerSettings(QObject *parent);
bool dontCheckForUpdates() const;
+ bool dontCheckExists() const;
QString lastVersionUsed() const;
QDate nextCheck() const;