From 7ab8275bdb56882692846d046a5bbeca5795b009 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 10 Dec 2019 11:15:11 +0000 Subject: Expose getter to KConfigWatcher's config Summary: It can help save users having to member variables for the config and the watcher. Reviewers: broulik Reviewed By: broulik Subscribers: broulik, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25833 --- src/core/kconfigwatcher.cpp | 5 +++++ src/core/kconfigwatcher.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/core/kconfigwatcher.cpp b/src/core/kconfigwatcher.cpp index 4d4d1355..c4a877c5 100644 --- a/src/core/kconfigwatcher.cpp +++ b/src/core/kconfigwatcher.cpp @@ -92,6 +92,11 @@ KConfigWatcher::KConfigWatcher(const KSharedConfig::Ptr &config): KConfigWatcher::~KConfigWatcher() = default; +KSharedConfig::Ptr KConfigWatcher::config() const +{ + return d->m_config; +} + void KConfigWatcher::onConfigChangeNotification(const QHash &changes) { //should we ever need it we can determine the file changed with QDbusContext::message().path(), but it doesn't seem too useful diff --git a/src/core/kconfigwatcher.h b/src/core/kconfigwatcher.h index 00c0fab5..4d44c752 100644 --- a/src/core/kconfigwatcher.h +++ b/src/core/kconfigwatcher.h @@ -51,6 +51,12 @@ public: ~KConfigWatcher() override; + /** + * Returns the config being watched + * @since 5.65 + */ + KSharedConfig::Ptr config() const; + Q_SIGNALS: /** * Emitted when a config group has changed -- cgit v1.2.1