From cad4889e490f4376849744ec6ab3c84c71807706 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 1 Apr 2019 10:28:02 +0200 Subject: Add Notify capability to revertToDefault This enables KConfigWatcher to detect those changes, too. Differential Revision: https://phabricator.kde.org/D20039 --- autotests/kconfigtest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'autotests/kconfigtest.cpp') 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().name(), QStringLiteral("TopLevelGroup")); QCOMPARE(watcherSpy[0][1].value(), 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().name(), QStringLiteral("TopLevelGroup")); + QCOMPARE(watcherSpy[0][1].value(), QByteArrayList({"entryA"})); + //deleting a group, should notify that every entry in that group has changed watcherSpy.clear(); myConfigGroup.deleteGroup("aSubGroup", KConfig::Persistent | KConfig::Notify); -- cgit v1.2.1