diff --git a/include/util/dutil.h b/include/util/dutil.h index 05a1c01..999827b 100644 --- a/include/util/dutil.h +++ b/include/util/dutil.h @@ -78,7 +78,7 @@ inline QString unescapeFromObjectPath(const QString &str) { auto ret = str; for (int i = 0; i < str.size(); ++i) { - if (str[i] == '_' and i + 2 < str.size()) { + if (str[i] == '_' && i + 2 < str.size()) { auto hexStr = str.mid(i + 1, 2); ret.replace(QString{"_%1"}.arg(hexStr), QChar::fromLatin1(hexStr.toUInt(nullptr, 16))); i += 2; @@ -91,7 +91,7 @@ inline QString getAppIdFromAbsolutePath(const QString &path) { static QString desktopSuffix{u8".desktop"}; const auto &appDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation); - if (!path.endsWith(desktopSuffix) or + if (!path.endsWith(desktopSuffix) || !std::any_of(appDirs.cbegin(), appDirs.constEnd(), [&path](const QString &dir) { return path.startsWith(dir); })) { return {}; } diff --git a/src/log/LogManager.cpp b/src/log/LogManager.cpp index 3d0d82e..390a70f 100644 --- a/src/log/LogManager.cpp +++ b/src/log/LogManager.cpp @@ -108,7 +108,7 @@ void DLogManagerPrivate::updateLoggingRules() var = m_dsgConfig->value(RULES_KEY); } else if (m_fallbackConfig && !m_fallbackConfig->isDefaultValue(RULES_KEY)) { var = m_fallbackConfig->value(RULES_KEY); - } else { + } else if (m_dsgConfig) { var = m_dsgConfig->value(RULES_KEY); }