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.cpp | |
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.cpp')
-rw-r--r-- | src/core/kconfigdata.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/kconfigdata.cpp b/src/core/kconfigdata.cpp index 6ef6af07..d80b7d07 100644 --- a/src/core/kconfigdata.cpp +++ b/src/core/kconfigdata.cpp @@ -134,6 +134,8 @@ bool KEntryMap::setEntry(const QByteArray &group, const QByteArray &key, const Q e.mValue = value; e.bDirty = e.bDirty || (options & EntryDirty); + e.bNotify = e.bNotify || (options & EntryNotify); + e.bGlobal = (options & EntryGlobal); //we can't use || here, because changes to entries in //kdeglobals would be written to kdeglobals instead //of the local config file, regardless of the globals flag @@ -269,6 +271,8 @@ bool KEntryMap::getEntryOption(const QMap< KEntryKey, KEntry >::ConstIterator &i return it->bDeleted; case EntryExpansion: return it->bExpand; + case EntryNotify: + return it->bNotify; default: break; // fall through } @@ -296,6 +300,9 @@ void KEntryMap::setEntryOption(QMap< KEntryKey, KEntry >::Iterator it, KEntryMap case EntryExpansion: it->bExpand = bf; break; + case EntryNotify: + it->bNotify = bf; + break; default: break; // fall through } |