aboutsummaryrefslogtreecommitdiff
path: root/src/core/kconfigwatcher.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2022-07-14 15:42:43 +0200
committerAhmad Samir <a.samirh78@gmail.com>2022-08-19 16:16:54 +0000
commit73de2d51c0cd9e35c86584a18d9bcb3c08672f5f (patch)
treefb88aee6260fec922f1ffab4ab582ae3c023fcbe /src/core/kconfigwatcher.cpp
parent607af6a32c60a4667982b1ad23e7662f693cb7d7 (diff)
downloadkconfig-73de2d51c0cd9e35c86584a18d9bcb3c08672f5f.tar.gz
kconfig-73de2d51c0cd9e35c86584a18d9bcb3c08672f5f.tar.bz2
General code clean-up
- use the strings in a QStringList directly - slightly better readability: less if-else-nesting, return early GIT_SILENT
Diffstat (limited to 'src/core/kconfigwatcher.cpp')
-rw-r--r--src/core/kconfigwatcher.cpp11
1 files changed, 6 insertions, 5 deletions
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<QByteArrayList>();
qDBusRegisterMetaType<QHash<QString, QByteArrayList>>();
- 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");
}