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
path: root/src
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2022-07-21 11:11:28 +0300
committerGitHub <noreply@github.com>2022-07-21 11:11:28 +0300
commit93c13bdeea15c92f4590832b6bfd11c7dcfc86fa (patch)
tree91131d39f6e7381764ddbddddaa869e274e1a187 /src
parenteeea6d78b85b445e3d8513e1be639b725faa3820 (diff)
parent900d7f5b470df6f3c1685a30c1c3d3cf1108bb2e (diff)
Merge PR #5751: 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
Diffstat (limited to 'src')
-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()));