Skip to content
Verified Commit 98cfc702 authored by ivan tkachenko's avatar ivan tkachenko 🗯
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:

```qml
    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.
parent 6957e585
Pipeline #242681 passed with stage
in 1 minute and 55 seconds
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