Bug 346673

Summary: Job detail collapses when job appears or disappears
Product: [Plasma] plasmashell Reporter: Kai Uwe Broulik <kde>
Component: NotificationsAssignee: Martin Klapetek <mklapetek>
Status: RESOLVED FIXED    
Severity: normal CC: plasma-bugs
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.3.1
Sentry Crash Report:

Description Kai Uwe Broulik 2015-04-25 21:15:57 UTC
The expandable job details collapse when a job finishes, or a new one appears.

This is due to the model of the JobDelegate Repeater being bound to jobSource.sources which is exposed to QML as a JavaScript Array. When it changes for any reason, all the delegates are destroyed and re-created because QML cannot track contents of JS items, only a re-assignment of the whole thing.

Reproducible: Always

Steps to Reproduce:
1. Start a copy job
2. Expand its details by clicking on plus, preferrably click the pin icon to better observe the behavior
3. Start another copy job

Actual Results:  
The details collapse

Expected Results:  
The details stay opened
Comment 1 Kai Uwe Broulik 2015-04-27 18:10:47 UTC
Git commit bc5c47537f3bbb706b3fe7af66508f5ef2fadc6e by Kai Uwe Broulik.
Committed on 27/04/2015 at 18:09.
Pushed by broulik into branch 'Plasma/5.3'.

Manually keep track of jobs sources

DataSources source is a QStringList property which means changes within cannot be tracked
causing all the job delegates to be destroyed and re-created when sourcesChanged is emitted.
This is pretty wasteful and also causes the delegates to lose their state (eg. details expanded)

REVIEW: 123502
FIXED-IN: 5.3.1

M  +6    -5    applets/notifications/package/contents/ui/JobDelegate.qml
M  +18   -9    applets/notifications/package/contents/ui/Jobs.qml

http://commits.kde.org/plasma-workspace/bc5c47537f3bbb706b3fe7af66508f5ef2fadc6e