Commit feb4d239 authored by ivan tkachenko's avatar ivan tkachenko Committed by David Edmundson
Browse files

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.

(cherry picked from commit 98cfc702)
parent b98dbd14
Pipeline #242683 passed with stage
in 1 minute and 28 seconds
......@@ -341,4 +341,7 @@ PlasmaExtras.ExpandableListItem {
connectionItem.customExpandedViewContent = detailsComponent;
Component.onDestruction: {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment