Reduce superfluous changedEntriesChanged emissions
Needs ReviewPublic

Authored by broulik on Mar 26 2020, 9:33 AM.

Details

Reviewers
leinir
ahiemstra
Group Reviewers
Frameworks
Summary

For some reason I couldn't entirely get behind, changedEntries was signalled to change on the QML side on component creation.
Even when replacing the Binding by a direct binding, this wouldn't work. However, while I can't just alias it, it turns out, ghnsDialog already has a changedEntries alias, which we can then just alias to.
Furthermore, don't signal a change when clearing if it was already empty.

This fixes the wallpaper model in Plasma reloading in-flight, causing thumbnail generation to fail. While this is a genuine bug in the model that should be fixed it only started to be a problem with GHNS needlessly reloading the model.

BUG: 419234

Test Plan
  • My thumbnails show up fine again
  • Installing a new thumbnail still reloads the model (changedEntries is signalled to change when I install something)

Diff Detail

Repository
R304 KNewStuff
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Mar 26 2020, 9:33 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 26 2020, 9:33 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Mar 26 2020, 9:33 AM
broulik edited the summary of this revision. (Show Details)

Hmm, when doing this, Qt suddenly refuses to pass the entries through to a QQmlListReference

leinir added inline comments.Mar 30 2020, 12:48 PM
src/qtquick/qml/Button.qml
90

Given the various annoying side effects of the cleaner solutions, perhaps reintroduce this, but add a "when" clause to ensure it only happens when we want it to? Maybe something as simple as just checking it is only forwarded when engine is, in fact, not null might work... or, perhaps, if engine is not null, and also initialised? since it really shouldn't be giving you any changed entries until after initialisation has been completed... Meaning something like

when: ghnsDialog.engine !== null && ghndDialog.engine.isInitialized

maybe perhaps could be...