Fix for outstanding collection browser bug

Ralf Engels ralf-engels at gmx.de
Fri Aug 6 02:40:24 CEST 2010


Hi,

> Date: Thu, 05 Aug 2010 21:46:28 +0200
> From: Nanno Langstraat <langstr at gmail.com>
> Subject: Re: Fix for outstanding collection browser bug
> To: amarok-devel at kde.org
> Message-ID: <4C5B1514.7060803 at gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On 2010-08-05 20:43, Ralf Engels wrote:
> > It seems like I found the reason for at least some of the effects in
> > https://bugs.kde.org/show_bug.cgi?id=172542
> >
> > After handling the row moved signal in GroupingProxy everything
> seems to
> > work.
> >
> > Here is the diff. It would be nice if somebody would integrate it.
> >    
> 
> ----
> A) +1 for this patch, it seems OK.
> 
> 
> ----
> B) Mystery #1:
> 
> That 'rowsMoved' QAbstractItemModel signal is new in Qt 4.6.
> 
> It's a somewhat-non-backward-compatible API change by Qt. By itself,
> it 
> would break Qt 4.5-and-earlier QAbstractItemModel-based code.
> 
> To work around that API breakage, Qt decided to also emit a 
> 'layoutChanged' with every 'rowsMoved' signal. From Qt's
> documentation:
> 
> 
>           void QAbstractItemModel::endMoveRows ()
> 
>     [...]
>     layoutChanged is emitted by this method for compatibility reasons.
> 
>     This function was introduced in Qt 4.6.

Again I didn't notice this.
Connecting the signal on 4.5 will not work but only produce a runtime
warning.

This bug was also reported for Qt 4.5 (and the original bug is even
older).
So there might be several root causes.

Anyway, in my build this patch fixed the bug.

> 
> GroupingProxy already properly handles the 'layoutChanged' signal.
> 
> So, riddle: why didn't that fallback mechanism work the way Qt planned
> it?
> 

A good question.
I will check in Qt why this is not working as intended.

> 
> ----
> C) Mystery #2: The linked bug report is about the Collection Browser. 
> This patch is for the Playlist.
> 
> To the best of my knowledge these two parts of Amarok have almost 
> nothing to do with each other.
> 

As far as I understand the collection browser is using the proxies and
the playlist model to display the tracks.
Still some explaining comments in the source code would help.

>      Regards,
>      Nanno
> 

One issue is outstanding.
When having several albums with the same name then expanded albums will
be displayed before un-expanded ones. 
So clicking on an album will change it's position.

I think I can explain the behaviour but it's still annoying. Expecially
since the collection scanner does such a bad job detecting a collection
album.

But that's something for another day.

Ralf



More information about the Amarok-devel mailing list