Bug 346673 - Job detail collapses when job appears or disappears
Summary: Job detail collapses when job appears or disappears
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-25 21:15 UTC by Kai Uwe Broulik
Modified: 2015-04-27 18:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.3.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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