summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp3
-rw-r--r--tests/testpreferences.cpp10
2 files changed, 13 insertions, 0 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 55670eb22..a329e0452 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -1111,6 +1111,9 @@ void CloudStorageSettings::setGitLocalOnly(bool value)
{
if (value == prefs.git_local_only)
return;
+ QSettings s;
+ s.beginGroup("CloudStorage");
+ s.setValue("git_local_only", value);
prefs.git_local_only = value;
emit gitLocalOnlyChanged(value);
}
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index 652cf6f1d..3148bffea 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -30,6 +30,16 @@ void TestPreferences::testPreferences()
TEST(pref->cloud_storage->baseUrl(), QStringLiteral("test_one"));
pref->cloud_storage->setBaseUrl("test_two");
TEST(pref->cloud_storage->baseUrl(), QStringLiteral("test_two"));
+
+ pref->cloud_storage->setEmail("tomaz@subsurface.com");
+ TEST(pref->cloud_storage->email(), QStringLiteral("tomaz@subsurface.com"));
+ pref->cloud_storage->setEmail("tomaz@gmail.com");
+ TEST(pref->cloud_storage->email(), QStringLiteral("tomaz@gmail.com"));
+
+ pref->cloud_storage->setGitLocalOnly(true);
+ TEST(pref->cloud_storage->gitLocalOnly(), true);
+ pref->cloud_storage->setGitLocalOnly(false);
+ TEST(pref->cloud_storage->gitLocalOnly(), false);
}
QTEST_MAIN(TestPreferences)