Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ba8d786ca2
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,6 @@ INCLUDEPATH += $$PWD/headers $$PWD
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/sources/ScStw.cpp \
|
$$PWD/sources/ScStw.cpp \
|
||||||
$$PWD/sources/client/scstwremotesettings.cpp \
|
|
||||||
$$PWD/sources/scstwsettings.cpp \
|
$$PWD/sources/scstwsettings.cpp \
|
||||||
$$PWD/sources/scstwsoundplayer.cpp \
|
$$PWD/sources/scstwsoundplayer.cpp \
|
||||||
$$PWD/sources/scstwlibraries.cpp \
|
$$PWD/sources/scstwlibraries.cpp \
|
||||||
|
@ -29,7 +28,6 @@ SOURCES += \
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/headers/ScStw.hpp \
|
$$PWD/headers/ScStw.hpp \
|
||||||
$$PWD/headers/ScStwLibraries_global.h \
|
$$PWD/headers/ScStwLibraries_global.h \
|
||||||
$$PWD/headers/client/scstwremotesettings.h \
|
|
||||||
$$PWD/headers/scstwlibraries.h \
|
$$PWD/headers/scstwlibraries.h \
|
||||||
$$PWD/headers/scstwrace.h \
|
$$PWD/headers/scstwrace.h \
|
||||||
$$PWD/headers/scstwsettings.h \
|
$$PWD/headers/scstwsettings.h \
|
||||||
|
@ -40,11 +38,13 @@ ScStwLibraries_ClientLibs {
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/sources/client/scstwqmlsetting.cpp \
|
$$PWD/sources/client/scstwqmlsetting.cpp \
|
||||||
$$PWD/sources/client/scstwclient.cpp \
|
$$PWD/sources/client/scstwclient.cpp \
|
||||||
|
$$PWD/sources/client/scstwremotesettings.cpp \
|
||||||
$$PWD/sources/client/scstwremotemonitorrace.cpp
|
$$PWD/sources/client/scstwremotemonitorrace.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/headers/client/scstwqmlsetting.h \
|
$$PWD/headers/client/scstwqmlsetting.h \
|
||||||
$$PWD/headers/client/scstwclient.h \
|
$$PWD/headers/client/scstwclient.h \
|
||||||
|
$$PWD/headers/client/scstwremotesettings.h \
|
||||||
$$PWD/headers/client/scstwremotemonitorrace.h
|
$$PWD/headers/client/scstwremotemonitorrace.h
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/headers/client
|
INCLUDEPATH += $$PWD/headers/client
|
||||||
|
|
|
@ -4,7 +4,7 @@ ScStwSettings::ScStwSettings(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
this->settingsFile = new QFile(path+ "/settings.json");
|
this->settingsFile = new QFile(path + "/settings.json");
|
||||||
if(!this->settingsFile->exists())
|
if(!this->settingsFile->exists())
|
||||||
if(!dir.mkpath(path))
|
if(!dir.mkpath(path))
|
||||||
qFatal("[FATAL] Couldn't create settings dir %s", qPrintable(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"));
|
qFatal("[FATAL] Couldn't open settings file %s", qPrintable(path + "/settings.json"));
|
||||||
|
|
||||||
if(!this->loadSettingsFromFile() && this->settingsFile->size() != 0)
|
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);
|
connect(this, &ScStwSettings::settingChanged, this, &ScStwSettings::writeSettingsToFile);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue