Skip to content
  • ivan tkachenko's avatar
    applet: Clean up model delaying in list delegate's destructor · feb4d239
    ivan tkachenko authored and David Edmundson's avatar David Edmundson committed
    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.
    
    
    (cherry picked from commit 98cfc702)
    feb4d239