From 48c132be8aa983165126b0641a083848dd5c6620 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 22 Feb 2021 19:25:40 +0200 Subject: Fix formatting in a couple of places after running clang-format NO_CHANGELOG --- src/core/kauthorized.cpp | 17 ++++++++++++----- src/core/kconfig.cpp | 7 +++---- src/core/kconfigdata.h | 8 +++++++- src/core/kconfigini.cpp | 6 +++++- 4 files changed, 27 insertions(+), 11 deletions(-) (limited to 'src/core') diff --git a/src/core/kauthorized.cpp b/src/core/kauthorized.cpp index a08586c5..46b33ab2 100644 --- a/src/core/kauthorized.cpp +++ b/src/core/kauthorized.cpp @@ -77,11 +77,14 @@ public: bool baseMatch(const QUrl &url, const QString &protClass) const { if (baseProtWildCard) { - if (!baseProt.isEmpty() && !url.scheme().startsWith(baseProt) && (protClass.isEmpty() || (protClass != baseProt))) { + if (!baseProt.isEmpty() // + && !url.scheme().startsWith(baseProt) // + && (protClass.isEmpty() || (protClass != baseProt))) { return false; } } else { - if ((url.scheme() != baseProt) && (protClass.isEmpty() || (protClass != baseProt))) { + if (url.scheme() != baseProt // + && (protClass.isEmpty() || (protClass != baseProt))) { return false; } } @@ -109,15 +112,19 @@ public: bool destMatch(const QUrl &url, const QString &protClass, const QUrl &base, const QString &baseClass) const { if (destProtEqual) { - if ((url.scheme() != base.scheme()) && (protClass.isEmpty() || baseClass.isEmpty() || protClass != baseClass)) { + if (url.scheme() != base.scheme() // + && (protClass.isEmpty() || baseClass.isEmpty() || protClass != baseClass)) { return false; } } else if (destProtWildCard) { - if (!destProt.isEmpty() && !url.scheme().startsWith(destProt) && (protClass.isEmpty() || (protClass != destProt))) { + if (!destProt.isEmpty() // + && !url.scheme().startsWith(destProt) // + && (protClass.isEmpty() || (protClass != destProt))) { return false; } } else { - if ((url.scheme() != destProt) && (protClass.isEmpty() || (protClass != destProt))) { + if (url.scheme() != destProt // + && (protClass.isEmpty() || (protClass != destProt))) { return false; } } diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 2da1dd48..ab6ac5c5 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -756,8 +756,8 @@ void KConfigPrivate::parseConfigFiles() } } else { QExplicitlySharedDataPointer backend = KConfigBackend::create(file); - bFileImmutable = (backend->parseConfig(utf8Locale, entryMap, KConfigBackend::ParseDefaults | KConfigBackend::ParseExpansions) - == KConfigBackend::ParseImmutable); + constexpr auto parseOpts = KConfigBackend::ParseDefaults | KConfigBackend::ParseExpansions; + bFileImmutable = backend->parseConfig(utf8Locale, entryMap, parseOpts) == KConfigBackend::ParseImmutable; } if (bFileImmutable) { @@ -918,8 +918,7 @@ bool KConfig::isConfigWritable(bool warnUser) errorMsg += QCoreApplication::translate("KConfig", "Please contact your system administrator."); QString cmdToExec = QStandardPaths::findExecutable(QStringLiteral("kdialog")); if (!cmdToExec.isEmpty()) { - QProcess::execute(cmdToExec, - QStringList() << QStringLiteral("--title") << QCoreApplication::applicationName() << QStringLiteral("--msgbox") << errorMsg); + QProcess::execute(cmdToExec, QStringList{QStringLiteral("--title"), QCoreApplication::applicationName(), QStringLiteral("--msgbox"), errorMsg}); } } diff --git a/src/core/kconfigdata.h b/src/core/kconfigdata.h index bb9ee717..afa18877 100644 --- a/src/core/kconfigdata.h +++ b/src/core/kconfigdata.h @@ -79,7 +79,13 @@ struct KEntry { // omits the dirty/notify flag from the comparison. inline bool operator==(const KEntry &k1, const KEntry &k2) { - return k1.bGlobal == k2.bGlobal && k1.bImmutable == k2.bImmutable && k1.bDeleted == k2.bDeleted && k1.bExpand == k2.bExpand && k1.mValue == k2.mValue; + /* clang-format off */ + return k1.bGlobal == k2.bGlobal + && k1.bImmutable == k2.bImmutable + && k1.bDeleted == k2.bDeleted + && k1.bExpand == k2.bExpand + && k1.mValue == k2.mValue; + /* clang-format on */ } inline bool operator!=(const KEntry &k1, const KEntry &k2) diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index 6271bcd5..f47310d0 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -133,7 +133,11 @@ KConfigBackend::ParseInfo KConfigIniBackend::parseConfig(const QByteArray &curre } ++end; } - if (end + 1 == line.length() && start + 2 == end && line.at(start) == '$' && line.at(start + 1) == 'i') { + /* clang-format off */ + if (end + 1 == line.length() + && start + 2 == end + && line.at(start) == '$' + && line.at(start + 1) == 'i') { /* clang-format on */ if (newGroup.isEmpty()) { fileOptionImmutable = !kde_kiosk_exception; } else { -- cgit v1.2.1