Bug 335217

Summary: Auto-expand after collection browser search expands less than desired (affects also 'Show in Media sources')
Product: [Applications] amarok Reporter: robert marshall <robert>
Component: Collection BrowserAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: minor CC: matej
Priority: NOR Keywords: regression
Version: 2.8-git   
Target Milestone: 2.8.1   
Platform: Ubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=300557
Latest Commit: Version Fixed In: 2.9
Sentry Crash Report:

Description robert marshall 2014-05-22 19:58:51 UTC
As a result of the fix of bug https://bugs.kde.org/show_bug.cgi?id=300557 the build from git now no longer shows the tracks when 'Show in Media Sources' is selected. Instead the album is displayed but the album is not opened to display the tracks. 

From a discussion on the devel list I wrote:

 I've recently updated amarok via git and got Matěj's fix - which does
 look good. Unfortunately there's I guess a side effect (at least I
 assume the change is responsible for this) that if you - in the play
 list - click 'Show in Media Sources' before that used to open that album
 fully in sources showing all the tracks, now - for me - it opens down to
 one level (I have Album->TrackArtist sorting) and you have to move the
 mouse over to see the tracks - so the menu option doesn't actually show
 the track in media sources - you have to fiddle slightly to get it
 shown!
 
 Is this a necessary side effect of the fix (was the previous behaviour
 regarded as part of the 300557 bug) or do you want me to file a bug
 report?

And Matěj responded:

I think that yes, this is a side-effect. My fix revealed a bug in 
CollectionTreeView::slotCheckAutoExpand() - it does not count with the fact 
that CollectionTreeItemModel is asynchronous. Previously this bug was hidden 
because slotCheckAutoExpand() got (mistakenly) called multiple times.

The solution would be to make slotCheckAutoExpand() aware of asyncronicity of 
the model - perhaps by introducing a single-shot RAII class to expand what is 
necessary and then auto-delete itself.

Hence the filing of this bug.



Reproducible: Always
Comment 1 Matěj Laitl 2016-10-16 22:09:10 UTC
Git commit 9fb00e5a97574af3f0cb22d740da7e0cd0761d78 by Matěj Laitl.
Committed on 16/10/2016 at 22:03.
Pushed by laitl into branch 'master'.

Fix Collection Browser auto-expand after search expanding too little

Underlying model is asynchronous, we need to cope with that. Do it
using a RAII self-destructing object AutoExpander.

As a side-effect, Amarok no longer expands collection after start in
split collection mode. If this is desired, we may expand them
explicitly upon start.
Related: bug 300557
FIXED-IN: 2.9

M  +1    -0    ChangeLog
M  +68   -20   src/browsers/CollectionTreeView.cpp

http://commits.kde.org/amarok/9fb00e5a97574af3f0cb22d740da7e0cd0761d78