From 8579ec54838b7188ed016f7adb4a69bbf2e39712 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 10 Oct 2018 14:48:49 +0100 Subject: Add mechanism to notify other clients of config changes over DBus Summary: Intention is not to create a registry like system, but to replace KDElibs4Support::KGlobalSettings and to replace other system settingss -> some app communication in a more generic way. writeEntry gains an additional flag Notify which if set, will notify clients of what has actually changed when we sync. Rationale to put this into KConfig was so that we could have everything batched and sychronised to the file sync and to get the fine detailed exposure of what has actually changed which we don't get with a file watcher. Default behaviour remains identical without any broadcast messages. As it is a new dependency it is purely optional and anything referencing DBus is not in the public API. Our deployment on platforms without DBus tend to be standalone applications anyway. Test Plan: Attached unit test Reviewers: broulik, dfaure Reviewed By: broulik, dfaure Subscribers: dfaure, broulik, zzag, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D13034 --- src/core/kconfigbase.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/core/kconfigbase.h') diff --git a/src/core/kconfigbase.h b/src/core/kconfigbase.h index b7403de1..62a0cc31 100644 --- a/src/core/kconfigbase.h +++ b/src/core/kconfigbase.h @@ -57,14 +57,20 @@ public: * application specific config file. */ Localized = 0x04, + /**< + * Notify remote KConfigWatchers of changes (requires DBus support) + * Implied persistent + * @since 5.51 + */ + Notify = 0x08 | Persistent, /**< * Add the locale tag to the key when writing it. */ Normal = Persistent - /**< - * Save the entry to the application specific config file without - * a locale tag. This is the default. - */ + /**< + * Save the entry to the application specific config file without + * a locale tag. This is the default. + */ }; Q_DECLARE_FLAGS(WriteConfigFlags, WriteConfigFlag) -- cgit v1.2.1