summaryrefslogtreecommitdiff
path: root/tests/unit/Settings/TestSettings.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /tests/unit/Settings/TestSettings.cpp
Initial mirror commitHEADmaster
Diffstat (limited to 'tests/unit/Settings/TestSettings.cpp')
-rw-r--r--tests/unit/Settings/TestSettings.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/Settings/TestSettings.cpp b/tests/unit/Settings/TestSettings.cpp
new file mode 100644
index 0000000..1f3fbb4
--- /dev/null
+++ b/tests/unit/Settings/TestSettings.cpp
@@ -0,0 +1,16 @@
+#include <QtCore>
+#include <gtest/gtest.h>
+
+#include "TestSettings.h"
+
+void TestSettings::init()
+{
+ QSettings::setDefaultFormat(QSettings::IniFormat);
+ QCoreApplication::setOrganizationName("freshmemory");
+ QCoreApplication::setApplicationName("freshmemory");
+ QString appDir = qApp->applicationDirPath();
+ QString userSettingsDir = appDir + "/../common";
+ QString systemSettingsDir = appDir + "/../../config";
+ QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, userSettingsDir);
+ QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, systemSettingsDir);
+}