Skip to content

Commit

Permalink
Merge PR #6231: FIX(server,settings,log): announce if settings file i…
Browse files Browse the repository at this point in the history
…s 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
  • Loading branch information
Krzmbrzl authored Oct 12, 2023
2 parents ca3f296 + c12990b commit c21a90a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/murmur/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ void MetaParams::read(QString fname) {
}
}
if (qsAbsSettingsFilePath.isEmpty()) {
QDir::root().mkpath(qdBasePath.absolutePath());
qdBasePath = QDir(datapaths.at(0));
qsAbsSettingsFilePath = qdBasePath.absolutePath() + QLatin1String("/mumble-server.ini");
}
Expand Down Expand Up @@ -228,8 +227,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()) {
Expand Down

0 comments on commit c21a90a

Please sign in to comment.