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.
This commit is contained in:
Christoph Wolk 2025-04-11 13:54:07 +02:00
parent 9e35eb6e86
commit 970dc01ca1

View file

@ -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()
}
})
}
}
}
}