Skip to content

applets/systemtray: remove KSortFilterProxyModel binding loop

Reason for the change

The systemtray's KSortFilterProxyModels bind to the model exposed on the C++ side, which are in turn QSortFilterProxyModels. This causes a binding loop.

The binding is unnecessary in first place though, the (sorted) models are marked as CONSTANT and cannot themselves change (their contents can, of course, but it's still the same sorted models). So we can just set it once on startup and avoid the bindings and any errors or effort associated with them.

Test plan

  1. Start plasmashell with a system tray, or open the system tray configuration dialog
  2. (without) binding loop (with) no binding loop

Screenshots or screen recordings

N/A

Bugs fixed

BUG: 500374


Honestly I'm not 100% certain why this causes a binding loop - I think it's because sourceModel is a bindable property, and although the model itself is a CONSTANT property, as a QSortFilterProxyModel it still has the signal and after binding they end up calling each other until the qml engine stops the fun. But I haven't traced it in depth to see if that's actually the case.

Merge request reports

Loading