[PATCH] juk: keep the order of tracks when loading a plain playlist.

Michael Pyne mpyne at kde.org
Thu Jun 9 01:25:01 BST 2011


On Thursday, June 09, 2011 03:00:32 Γιώργος Κυλάφας wrote:
> 2011/6/8 Michael Pyne <mpyne at kde.org>:
> > How does this interact with playlists that are *not* manually sorted?
> > Wouldn't this call disable that automatic sorting, or is that
> > re-enabled later while the Playlist is loading its settings from the
> > KConfig?
> 
> The original sorting column is restored in
> http://websvn.kde.org/trunk/KDE/kdemultimedia/juk/cache.cpp?revision=1012680
> &view=markup#l211.
> 
> The problem was that, when the files were added (line 202, ends up
> calling Playlist::read), the default sorting column (Artist) would be
> used, which messed up the order they were saved. If the restored
> sorting column was an existing one, there would be no problem. But if
> it was column()+1, i.e. manual sorting, the original order had been
> gone.
> 
> So, my patch just makes sure that no sorting happens while the files are
> added.
> 
> Initially, I was unsure whether I should put the setSorting() call
> before line 202, or in Playlist::read. However, I thought that perhaps
> in the future Playlist::read could be called from other places. So by
> putting setSorting() there, I made sure that the files of a Playlist
> are always restored in the order they were saved.

Alright, looks good to me then.

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20110608/a0f62b02/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list