From 900d7f5b470df6f3c1685a30c1c3d3cf1108bb2e Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Wed, 20 Jul 2022 20:17:59 +0200 Subject: FIX(server): Don't silently ignore errors in INI In theory these changes should cause the server to no longer silently ignore encountered INI syntax errors. In practice however, it seems that it is pretty much impossible to create an INI file that Qt actually considers erroneous and thus this code essentially doesn't work. But in case Qt ever fixes this weird behavior, at least in theory Mumble users should immediately profit from it. Fixes #5749 --- src/murmur/Meta.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/murmur/Meta.cpp b/src/murmur/Meta.cpp index d066f6cf9..c9e7f45ed 100644 --- a/src/murmur/Meta.cpp +++ b/src/murmur/Meta.cpp @@ -209,6 +209,18 @@ void MetaParams::read(QString fname) { qsSettings = new QSettings(qsAbsSettingsFilePath, QSettings::IniFormat); qsSettings->setIniCodec("UTF-8"); + qsSettings->sync(); + switch (qsSettings->status()) { + case QSettings::NoError: + break; + case QSettings::AccessError: + qFatal("Access error while trying to access %s", qPrintable(qsSettings->fileName())); + break; + case QSettings::FormatError: + qFatal("Your INI file at %s is invalid - check for syntax errors!", qPrintable(qsSettings->fileName())); + break; + } + qWarning("Initializing settings from %s (basepath %s)", qPrintable(qsSettings->fileName()), qPrintable(qdBasePath.absolutePath())); -- cgit v1.2.3