aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfigtest.cpp
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2019-04-01 10:28:02 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2019-04-01 10:28:02 +0200
commitcad4889e490f4376849744ec6ab3c84c71807706 (patch)
tree71ef0ac3eda821e0fe24475ed99e9ccbe3d97b84 /autotests/kconfigtest.cpp
parent998982a47cbc4ab8779c85a28052fb96195fd2a1 (diff)
downloadkconfig-cad4889e490f4376849744ec6ab3c84c71807706.tar.gz
kconfig-cad4889e490f4376849744ec6ab3c84c71807706.tar.bz2
Add Notify capability to revertToDefault
This enables KConfigWatcher to detect those changes, too. Differential Revision: https://phabricator.kde.org/D20039
Diffstat (limited to 'autotests/kconfigtest.cpp')
-rw-r--r--autotests/kconfigtest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index 32d3eef8..410b5b80 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -1926,6 +1926,15 @@ void KConfigTest::testNotify()
QCOMPARE(watcherSpy[0][0].value<KConfigGroup>().name(), QStringLiteral("TopLevelGroup"));
QCOMPARE(watcherSpy[0][1].value<QByteArrayList>(), QByteArrayList({"entryA"}));
+ //revert to default an entry
+ watcherSpy.clear();
+ myConfigGroup.revertToDefault("entryA", KConfig::Persistent | KConfig::Notify);
+ config.sync();
+ watcherSpy.wait();
+ QCOMPARE(watcherSpy.count(), 1);
+ QCOMPARE(watcherSpy[0][0].value<KConfigGroup>().name(), QStringLiteral("TopLevelGroup"));
+ QCOMPARE(watcherSpy[0][1].value<QByteArrayList>(), QByteArrayList({"entryA"}));
+
//deleting a group, should notify that every entry in that group has changed
watcherSpy.clear();
myConfigGroup.deleteGroup("aSubGroup", KConfig::Persistent | KConfig::Notify);