From 73de2d51c0cd9e35c86584a18d9bcb3c08672f5f Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 14 Jul 2022 15:42:43 +0200 Subject: General code clean-up - use the strings in a QStringList directly - slightly better readability: less if-else-nesting, return early GIT_SILENT --- src/core/kconfigwatcher.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/core/kconfigwatcher.cpp') diff --git a/src/core/kconfigwatcher.cpp b/src/core/kconfigwatcher.cpp index ae5d8849..0811db80 100644 --- a/src/core/kconfigwatcher.cpp +++ b/src/core/kconfigwatcher.cpp @@ -56,12 +56,13 @@ KConfigWatcher::KConfigWatcher(const KSharedConfig::Ptr &config) qDBusRegisterMetaType(); qDBusRegisterMetaType>(); - QStringList watchedPaths; - watchedPaths << QLatin1Char('/') + d->m_config->name(); - const auto cfgSources = d->m_config->additionalConfigSources(); - for (const QString &file : cfgSources) { - watchedPaths << QLatin1Char('/') + file; + + QStringList watchedPaths = d->m_config->additionalConfigSources(); + for (QString &file : watchedPaths) { + file.prepend(QLatin1Char('/')); } + watchedPaths.prepend(QLatin1Char('/') + d->m_config->name()); + if (d->m_config->openFlags() & KConfig::IncludeGlobals) { watchedPaths << QStringLiteral("/kdeglobals"); } -- cgit v1.2.1