applet: Clean up model delaying in list delegate's destructor
After opening a password prompt and scrolling away too far, a delegate may get destroyed while still holding a "lock" on model updates.
It didn't make much sense to clean up in destructor when the code used a shared variable (until recent refactoring), so it got removed. But now with individually controlled state in model/role it must be used again.
Test plan:
- Open Networks applet,
- Wait for Wi-Fi scanning,
- Press "Connect" on a first password-protected available network,
- Scroll to the bottom,
- Scroll back to the top. That network's list item should be collapsed, and the scanning should not be blocked.
If in doubts, add this code to the end of Toolbar.qml component:
PlasmaComponents3.CheckBox {
enabled: false
tristate: true
checkState: connectionModel === null ? Qt.PartiallyChecked
: connectionModel.delayModelUpdates ? Qt.Checked : Qt.Unchecked
}
It will show you whether the aggregated lock is actually being held.