From 970dc01ca19edb2203497c7a6b6ee5a290431057 Mon Sep 17 00:00:00 2001 From: Christoph Wolk Date: Fri, 11 Apr 2025 13:54:07 +0200 Subject: [PATCH] shell/configuration: track unsaved changes signal plasma-desktop added support for a unsavedChanges property in applet configuration pages to inform the dialog that the present state is modifed from the saved state in cases where the automatic tracking of cfg_ properties does not work. This is intended to replace most uses of the configurationChanged signal, which does not allow communicating that the previous state has been restored and saving is no longer necessary. plasma-mobile automatically saves changes, so does not need to do special handling here, but it does need to track changes in this property to work correctly with applets that have switched to this method. This change adds a handler for changes to this property similar to the existing handler for the configurationChanged signal. --- shell/contents/configuration/ConfigurationAppletPage.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/contents/configuration/ConfigurationAppletPage.qml b/shell/contents/configuration/ConfigurationAppletPage.qml index fef0f8dd..1eb01339 100644 --- a/shell/contents/configuration/ConfigurationAppletPage.qml +++ b/shell/contents/configuration/ConfigurationAppletPage.qml @@ -75,6 +75,15 @@ Kirigami.ScrollablePage { if (configurationChangedSignal) { configurationChangedSignal.connect(root.settingValueChanged) } + + var unsavedChangesChangedSignal = item.unsavedChangesChanged + if (unsavedChangesChangedSignal) { + unsavedChangesChangedSignal.connect( () => { + if (item.unsavedChanges) { + root.settingValueChanged() + } + }) + } } } }