Bug 335217 - Auto-expand after collection browser search expands less than desired (affects also 'Show in Media sources')
Summary: Auto-expand after collection browser search expands less than desired (affect...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: 2.8-git
Platform: Ubuntu Linux
: NOR minor
Target Milestone: 2.8.1
Assignee: Amarok Developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-05-22 19:58 UTC by robert marshall
Modified: 2016-10-16 22:09 UTC (History)
1 user (show)

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


Attachments

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