diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-28 04:17:16 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-28 04:17:16 -0500 |
| commit | 462ea08c348b6c524691e435ea7fb911ffd2367e (patch) | |
| tree | ea8cdf4a40fd463a4304e31d116ede6c66bf948d /src/settings.cpp | |
| parent | 3c62a048da24ae58d5d9d490914ba9e8dbdc89f0 (diff) | |
fixed warning about ini files with utf8 bom
fixed main thread name still getting clobbered by QWebEngine
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 6445bfbe..f5ad83a7 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -470,7 +470,34 @@ const DiagnosticsSettings& Settings::diagnostics() const QSettings::Status Settings::sync() const { m_Settings.sync(); - return m_Settings.status(); + + const auto s = m_Settings.status(); + + // there's a bug in Qt at least until 5.15.0 where a utf-8 bom in the ini is + // handled correctly but still sets FormatError + // + // see qsettings.cpp, in QConfFileSettingsPrivate::readIniFile(), there's a + // specific check for utf-8, which adjusts `dataPos` so it's skipped, but + // the FLUSH_CURRENT_SECTION() macro uses `currentSectionStart`, and that one + // isn't adjusted when changing `dataPos` on the first line and so stays 0 + // + // this puts the bom in `unparsedIniSections` and eventually sets FormatError + // somewhere + // + // + // the other problem is that the status is never reset, not even when calling + // sync(), so the FormatError that's returned here is actually from reading + // the ini, not writing it + // + // + // since it's impossible to get a FormatError on write, it's considered to + // be a NoError here + + if (s == QSettings::FormatError) { + return QSettings::NoError; + } else { + return s; + } } QSettings::Status Settings::iniStatus() const |
