diff options
| author | David Edmundson <kde@davidedmundson.co.uk> | 2019-12-10 11:15:11 +0000 | 
|---|---|---|
| committer | David Edmundson <kde@davidedmundson.co.uk> | 2019-12-10 11:15:11 +0000 | 
| commit | 7ab8275bdb56882692846d046a5bbeca5795b009 (patch) | |
| tree | 9b01cba30d882a33dc144408346b51a8dbf2bf83 /src | |
| parent | 89fb70b571155deaee5a20af97d86c01460f9dcd (diff) | |
| download | kconfig-7ab8275bdb56882692846d046a5bbeca5795b009.tar.gz kconfig-7ab8275bdb56882692846d046a5bbeca5795b009.tar.bz2 | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/kconfigwatcher.cpp | 5 | ||||
| -rw-r--r-- | src/core/kconfigwatcher.h | 6 | 
2 files changed, 11 insertions, 0 deletions
| 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<QString, QByteArrayList> &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 | 
