summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/server/main.cpp12
-rw-r--r--src/server/util/util.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/src/server/main.cpp b/src/server/main.cpp
index 191c234..1d46d66 100644
--- a/src/server/main.cpp
+++ b/src/server/main.cpp
@@ -19,18 +19,22 @@ int main(int argc, char** argv)
qsrand((uint)QDateTime::currentMSecsSinceEpoch());
- // Make sure settings directory exists
- do {
+
+ // Set the global path of the settings
+ QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, "/opt/");
+
+ // Make sure settings directory exists
USER_SETTINGS(settings);
QFileInfo fi(settings.fileName());
QDir path(fi.path());
- qDebug() << "Settings directory is " << fi.path();
+ qDebug() << "User settings are in:" << settings.fileName();
if (!path.exists())
path.mkpath(path.absolutePath());
// Now check if settings file exists. If not, copy system default (if available)
if (!fi.exists())
{
SYSTEM_SETTINGS(sys);
+ qDebug() << "System settings are in:" << sys.fileName();
QFileInfo sysfi(sys.fileName());
if (sysfi.exists())
{
@@ -38,7 +42,7 @@ int main(int argc, char** argv)
qDebug() << "Copying default settings from " << sys.fileName() << " to " << settings.fileName() << " failed.";
}
}
- } while (0);
+
// use system locale as language to translate gui
QTranslator translator;
diff --git a/src/server/util/util.h b/src/server/util/util.h
index e2d6a62..d142bdd 100644
--- a/src/server/util/util.h
+++ b/src/server/util/util.h
@@ -6,8 +6,8 @@
// Use like this:
// USER_SETTINGS(settings)
// settings.value("somekey")
-#define USER_SETTINGS(name) QSettings name (QSettings::IniFormat, QSettings::UserScope, "openslx", "pvs2mgr")
-#define SYSTEM_SETTINGS(name) QSettings name (QSettings::IniFormat, QSettings::SystemScope, "openslx", "pvs2mgr")
+#define USER_SETTINGS(name) QSettings name (QSettings::IniFormat, QSettings::UserScope, "openslx", "pvs2")
+#define SYSTEM_SETTINGS(name) QSettings name (QSettings::IniFormat, QSettings::SystemScope, "openslx", "pvs2")
namespace Util
{