Changeset View
Changeset View
Standalone View
Standalone View
src/core/kconfigwatcher.cpp
Show All 14 Lines | |||||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "kconfigwatcher.h" | 20 | #include "kconfigwatcher.h" | ||
21 | 21 | | |||
22 | #include "config-kconfig.h" | 22 | #include "config-kconfig.h" | ||
23 | #include "kconfig_core_log_settings.h" | ||||
23 | 24 | | |||
24 | #if KCONFIG_USE_DBUS | 25 | #if KCONFIG_USE_DBUS | ||
25 | #include <QDBusConnection> | 26 | #include <QDBusConnection> | ||
26 | #include <QDBusMessage> | 27 | #include <QDBusMessage> | ||
27 | #include <QDBusMetaType> | 28 | #include <QDBusMetaType> | ||
28 | #endif | 29 | #endif | ||
29 | 30 | | |||
30 | #include <QDebug> | 31 | #include <QDebug> | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 80 | for(const QString &path: qAsConst(watchedPaths)) { | |||
80 | QDBusConnection::sessionBus().connect(QString(), | 81 | QDBusConnection::sessionBus().connect(QString(), | ||
81 | path, | 82 | path, | ||
82 | QStringLiteral("org.kde.kconfig.notify"), | 83 | QStringLiteral("org.kde.kconfig.notify"), | ||
83 | QStringLiteral("ConfigChanged"), | 84 | QStringLiteral("ConfigChanged"), | ||
84 | this, | 85 | this, | ||
85 | SLOT(onConfigChangeNotification(QHash<QString,QByteArrayList>))); | 86 | SLOT(onConfigChangeNotification(QHash<QString,QByteArrayList>))); | ||
86 | } | 87 | } | ||
87 | #else | 88 | #else | ||
88 | qWarning() << "Use of KConfigWatcher without DBus support. You will not receive updates"; | 89 | qCWarning(KCONFIG_CORE_LOG) << "Use of KConfigWatcher without DBus support. You will not receive updates"; | ||
89 | #endif | 90 | #endif | ||
90 | } | 91 | } | ||
91 | 92 | | |||
92 | void KConfigWatcher::onConfigChangeNotification(const QHash<QString, QByteArrayList> &changes) | 93 | void KConfigWatcher::onConfigChangeNotification(const QHash<QString, QByteArrayList> &changes) | ||
93 | { | 94 | { | ||
94 | //should we ever need it we can determine the file changed with QDbusContext::message().path(), but it doesn't seem too useful | 95 | //should we ever need it we can determine the file changed with QDbusContext::message().path(), but it doesn't seem too useful | ||
95 | 96 | | |||
96 | d->m_config->reparseConfiguration(); | 97 | d->m_config->reparseConfiguration(); | ||
Show All 11 Lines |