aboutsummaryrefslogtreecommitdiff
path: root/src/core/kcoreconfigskeleton.h
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2019-04-24 16:20:56 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2019-04-24 16:21:29 +0200
commit5d2ed13479a480111355657bf22324118fa576e9 (patch)
treed55fe47fa3d017391b8c6c1a735d4b098adbe8f8 /src/core/kcoreconfigskeleton.h
parentb327f5f6cef127980e84926b134d5c7c72e833b1 (diff)
downloadkconfig-5d2ed13479a480111355657bf22324118fa576e9.tar.gz
kconfig-5d2ed13479a480111355657bf22324118fa576e9.tar.bz2
Add Notify capability to KConfigXT
Lets you specify Notifiers= in .kcfg for config entries that should be written with Notify flag, i.e. announce the change to KConfigWatcher Differential Revision: https://phabricator.kde.org/D20196
Diffstat (limited to 'src/core/kcoreconfigskeleton.h')
-rw-r--r--src/core/kcoreconfigskeleton.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/kcoreconfigskeleton.h b/src/core/kcoreconfigskeleton.h
index b384129d..771d8cc9 100644
--- a/src/core/kcoreconfigskeleton.h
+++ b/src/core/kcoreconfigskeleton.h
@@ -133,6 +133,19 @@ public:
QString whatsThis() const;
/**
+ The write flags to be used when writing configuration.
+ @since 5.58
+ */
+ void setWriteFlags(KConfigBase::WriteConfigFlags flags);
+
+ /**
+ Return write flags to be used when writing configuration.
+ They should be passed to every call of writeEntry() and revertToDefault().
+ @since 5.58
+ */
+ KConfigBase::WriteConfigFlags writeFlags() const;
+
+ /**
* This function is called by @ref KCoreConfigSkeleton to read the value for this setting
* from a config file.
*/
@@ -141,6 +154,7 @@ public:
/**
* This function is called by @ref KCoreConfigSkeleton to write the value of this setting
* to a config file.
+ * Make sure to pass writeFlags() to every call of writeEntry() and revertToDefault().
*/
virtual void writeConfig(KConfig *) = 0;
@@ -274,9 +288,9 @@ public:
if (mReference != mLoadedValue) { // Is this needed?
KConfigGroup cg(config, mGroup);
if ((mDefault == mReference) && !cg.hasDefault(mKey)) {
- cg.revertToDefault(mKey);
+ cg.revertToDefault(mKey, writeFlags());
} else {
- cg.writeEntry(mKey, mReference);
+ cg.writeEntry(mKey, mReference, writeFlags());
}
mLoadedValue = mReference;
}