From 89ba6acff7feff64521391aa739f5d375e7ed348 Mon Sep 17 00:00:00 2001 From: Thomas Windt Date: Sun, 8 Oct 2023 12:37:42 +0200 Subject: [PATCH] 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 --- src/murmur/Meta.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/murmur/Meta.cpp b/src/murmur/Meta.cpp index 94976bef9..a1dae1c30 100644 --- a/src/murmur/Meta.cpp +++ b/src/murmur/Meta.cpp @@ -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()) {