mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Settings update: Fix git_local_only loading
Thanks to the unittesting. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3dce5de12d
commit
1b07483830
2 changed files with 13 additions and 0 deletions
|
@ -1111,6 +1111,9 @@ void CloudStorageSettings::setGitLocalOnly(bool value)
|
||||||
{
|
{
|
||||||
if (value == prefs.git_local_only)
|
if (value == prefs.git_local_only)
|
||||||
return;
|
return;
|
||||||
|
QSettings s;
|
||||||
|
s.beginGroup("CloudStorage");
|
||||||
|
s.setValue("git_local_only", value);
|
||||||
prefs.git_local_only = value;
|
prefs.git_local_only = value;
|
||||||
emit gitLocalOnlyChanged(value);
|
emit gitLocalOnlyChanged(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,16 @@ void TestPreferences::testPreferences()
|
||||||
TEST(pref->cloud_storage->baseUrl(), QStringLiteral("test_one"));
|
TEST(pref->cloud_storage->baseUrl(), QStringLiteral("test_one"));
|
||||||
pref->cloud_storage->setBaseUrl("test_two");
|
pref->cloud_storage->setBaseUrl("test_two");
|
||||||
TEST(pref->cloud_storage->baseUrl(), QStringLiteral("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)
|
QTEST_MAIN(TestPreferences)
|
||||||
|
|
Loading…
Add table
Reference in a new issue