FIX(server,settings,log): announce if settings file is not present

Apparently, QSettings does not care if the specified settings file exists or not.
Therefore, no keys will be loaded into the settings as if the file was empty.
We specifically check for the missing file to not reference a ghost file in the logs.

Fixes #6077
This commit is contained in:
Thomas Windt 2023-10-08 12:37:42 +02:00 committed by Thomas Windt
parent 5b83d0fe45
commit 89ba6acff7

View File

@ -228,8 +228,13 @@ void MetaParams::read(QString fname) {
break;
}
qWarning("Initializing settings from %s (basepath %s)", qPrintable(qsSettings->fileName()),
qPrintable(qdBasePath.absolutePath()));
if (QFile::exists(qsAbsSettingsFilePath)) {
qWarning("Initializing settings from %s (basepath %s)", qPrintable(qsSettings->fileName()),
qPrintable(qdBasePath.absolutePath()));
} else {
qWarning("No ini file at %s (basepath %s). Initializing with default settings.",
qPrintable(qsSettings->fileName()), qPrintable(qdBasePath.absolutePath()));
}
QString qsHost = qsSettings->value("host", QString()).toString();
if (!qsHost.isEmpty()) {