diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/kconfig.cpp | 6 | ||||
-rw-r--r-- | src/core/kconfiggroup.cpp | 3 | ||||
-rw-r--r-- | src/core/kconfigini.cpp | 5 | ||||
-rw-r--r-- | src/core/kcoreconfigskeleton.cpp | 3 |
4 files changed, 11 insertions, 6 deletions
diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index b4777575..b5fd9d63 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -580,8 +580,9 @@ void KConfig::setMainConfigName(const QString &str) QString KConfig::mainConfigName() { KConfigStaticData *data = globalData(); - if (data->appArgs.isEmpty()) + if (data->appArgs.isEmpty()) { data->appArgs = QCoreApplication::arguments(); + } // --config on the command line overrides everything else const QStringList args = data->appArgs; @@ -722,8 +723,9 @@ void KConfigPrivate::parseGlobalFiles() for (const QString &file : globalFiles) { KConfigBackend::ParseOptions parseOpts = KConfigBackend::ParseGlobal | KConfigBackend::ParseExpansions; - if (file.compare(*sGlobalFileName, sPathCaseSensitivity) != 0) + if (file.compare(*sGlobalFileName, sPathCaseSensitivity) != 0) { parseOpts |= KConfigBackend::ParseDefaults; + } QExplicitlySharedDataPointer<KConfigBackend> backend = KConfigBackend::create(file); if (backend->parseConfig(utf8Locale, entryMap, parseOpts) == KConfigBackend::ParseImmutable) { diff --git a/src/core/kconfiggroup.cpp b/src/core/kconfiggroup.cpp index 5ee9f6ab..a15c45eb 100644 --- a/src/core/kconfiggroup.cpp +++ b/src/core/kconfiggroup.cpp @@ -935,10 +935,11 @@ void KConfigGroup::writeEntry(const char *key, const QVariant &value, WriteConfi data = value.toString().toUtf8(); break; case QMetaType::QVariantList: - if (!value.canConvert(QMetaType::QStringList)) + if (!value.canConvert(QMetaType::QStringList)) { qCWarning(KCONFIG_CORE_LOG) << "not all types in \"" << key << "\" can convert to QString," " information will be lost"; + } Q_FALLTHROUGH(); case QMetaType::QStringList: writeEntry(key, value.toList(), flags); diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index 2792cb4f..5bc8743c 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -592,10 +592,11 @@ void KConfigIniBackend::setFilePath(const QString &file) setLocalFilePath(info.canonicalFilePath()); } else { const QString dir = info.dir().canonicalPath(); - if (!dir.isEmpty()) + if (!dir.isEmpty()) { setLocalFilePath(dir + QLatin1Char('/') + info.fileName()); - else + } else { setLocalFilePath(file); + } } } diff --git a/src/core/kcoreconfigskeleton.cpp b/src/core/kcoreconfigskeleton.cpp index ab968023..e1c5c1dd 100644 --- a/src/core/kcoreconfigskeleton.cpp +++ b/src/core/kcoreconfigskeleton.cpp @@ -17,10 +17,11 @@ static QString obscuredString(const QString &str) { QString result; const QChar *unicode = str.unicode(); - for (int i = 0; i < str.length(); ++i) + for (int i = 0; i < str.length(); ++i) { // yes, no typo. can't encode ' ' or '!' because // they're the unicode BOM. stupid scrambling. stupid. result += (unicode[i].unicode() <= 0x21) ? unicode[i] : QChar(0x1001F - unicode[i].unicode()); + } return result; } |