diff --git a/ScStwLibraries/sources/scstwsettings.cpp b/ScStwLibraries/sources/scstwsettings.cpp index 6f39147..d0b21b9 100644 --- a/ScStwLibraries/sources/scstwsettings.cpp +++ b/ScStwLibraries/sources/scstwsettings.cpp @@ -20,12 +20,16 @@ ScStwSettings::ScStwSettings(QObject *parent) : QObject(parent) { - QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); +#ifdef RASPI + QString path = "/root/.config/ScStwBasestation"; +#else + QString path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); +#endif QDir dir(path); + if(!dir.mkpath(path)) + qFatal("[FATAL] Failed to create writable directory for settings at %s", qPrintable(path)); + this->settingsFile = new QFile(path + "/settings.json"); - if(!this->settingsFile->exists()) - if(!dir.mkpath(path)) - qFatal("[FATAL] Couldn't create settings dir %s", qPrintable(path)); if(!this->settingsFile->open(QFile::ReadWrite)) qFatal("[FATAL] Couldn't open settings file %s", qPrintable(path + "/settings.json"));