- creating settings path automatically now
- changed includes
This commit is contained in:
parent
6c1ce8e654
commit
2cffaf6a91
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,6 @@ INCLUDEPATH += $$PWD/headers $$PWD
|
|||
|
||||
SOURCES += \
|
||||
$$PWD/sources/ScStw.cpp \
|
||||
$$PWD/sources/client/scstwremotesettings.cpp \
|
||||
$$PWD/sources/scstwsettings.cpp \
|
||||
$$PWD/sources/scstwsoundplayer.cpp \
|
||||
$$PWD/sources/scstwlibraries.cpp \
|
||||
|
@ -29,7 +28,6 @@ SOURCES += \
|
|||
HEADERS += \
|
||||
$$PWD/headers/ScStw.hpp \
|
||||
$$PWD/headers/ScStwLibraries_global.h \
|
||||
$$PWD/headers/client/scstwremotesettings.h \
|
||||
$$PWD/headers/scstwlibraries.h \
|
||||
$$PWD/headers/scstwrace.h \
|
||||
$$PWD/headers/scstwsettings.h \
|
||||
|
@ -39,10 +37,12 @@ HEADERS += \
|
|||
ScStwLibraries_ClientLibs {
|
||||
SOURCES += \
|
||||
$$PWD/sources/client/scstwclient.cpp \
|
||||
$$PWD/sources/client/scstwremotesettings.cpp \
|
||||
$$PWD/sources/client/scstwremotemonitorrace.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/headers/client/scstwclient.h \
|
||||
$$PWD/headers/client/scstwremotesettings.h \
|
||||
$$PWD/headers/client/scstwremotemonitorrace.h
|
||||
|
||||
INCLUDEPATH += $$PWD/headers/client
|
||||
|
|
|
@ -4,7 +4,7 @@ ScStwSettings::ScStwSettings(QObject *parent) : QObject(parent)
|
|||
{
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
QDir dir(path);
|
||||
this->settingsFile = new QFile(path+ "/settings.json");
|
||||
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));
|
||||
|
@ -13,7 +13,7 @@ ScStwSettings::ScStwSettings(QObject *parent) : QObject(parent)
|
|||
qFatal("[FATAL] Couldn't open settings file %s", qPrintable(path + "/settings.json"));
|
||||
|
||||
if(!this->loadSettingsFromFile() && this->settingsFile->size() != 0)
|
||||
qFatal("[FATAL] Settings file (%s) is of invalid format!", qPrintable(path));
|
||||
qFatal("[FATAL] Settings file (%s) is of invalid format!", qPrintable(path + "/settings.json"));
|
||||
|
||||
connect(this, &ScStwSettings::settingChanged, this, &ScStwSettings::writeSettingsToFile);
|
||||
}
|
||||
|
|
Reference in a new issue