diff options
author | David Edmundson <kde@davidedmundson.co.uk> | 2018-10-10 14:48:49 +0100 |
---|---|---|
committer | David Edmundson <kde@davidedmundson.co.uk> | 2018-10-10 14:51:04 +0100 |
commit | 8579ec54838b7188ed016f7adb4a69bbf2e39712 (patch) | |
tree | b9614b014ba779dae40e96069fc2cadeeecea9de /src/core/kconfigdata.h | |
parent | 8e56083463374fa6525b5feff4373b5ab58914bb (diff) | |
download | kconfig-8579ec54838b7188ed016f7adb4a69bbf2e39712.tar.gz kconfig-8579ec54838b7188ed016f7adb4a69bbf2e39712.tar.bz2 |
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
Diffstat (limited to 'src/core/kconfigdata.h')
-rw-r--r-- | src/core/kconfigdata.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/kconfigdata.h b/src/core/kconfigdata.h index f84e51e3..2a5c643d 100644 --- a/src/core/kconfigdata.h +++ b/src/core/kconfigdata.h @@ -37,7 +37,7 @@ struct KEntry { KEntry() : mValue(), bDirty(false), bGlobal(false), bImmutable(false), bDeleted(false), bExpand(false), bReverted(false), - bLocalizedCountry(false) {} + bLocalizedCountry(false), bNotify(false) {} /** @internal */ QByteArray mValue; /** @@ -69,11 +69,13 @@ struct KEntry { * if @c true the value references language and country, e.g. "de_DE". **/ bool bLocalizedCountry: 1; + + bool bNotify: 1; }; // These operators are used to check whether an entry which is about // to be written equals the previous value. As such, this intentionally -// omits the dirty flag from the comparison. +// omits the dirty/notify flag from the comparison. inline bool operator ==(const KEntry &k1, const KEntry &k2) { return k1.bGlobal == k2.bGlobal && k1.bImmutable == k2.bImmutable @@ -172,6 +174,7 @@ public: EntryExpansion = 16, EntryRawKey = 32, EntryLocalizedCountry = 64, + EntryNotify = 128, EntryDefault = (SearchDefaults << 16), EntryLocalized = (SearchLocalized << 16) }; |