Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2022-07-20 21:17:59 +0300
committerRobert Adam <dev@robert-adam.de>2022-07-20 21:17:59 +0300
commit900d7f5b470df6f3c1685a30c1c3d3cf1108bb2e (patch)
tree8249ab6b85b94a77bf35e9f939170c0d1da08fc7
parent414ab61b61b0d446eccba1c60dcad7c158a7c701 (diff)
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
-rw-r--r--src/murmur/Meta.cpp12
1 files changed, 12 insertions, 0 deletions
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()));