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

Γιώργος Κυλάφας (Giorgos Kylafas) gekylafas at gmail.com
Thu Jun 9 01:00:32 BST 2011


2011/6/8 Michael Pyne <mpyne at kde.org>:
> On Tuesday, June 07, 2011 10:53:02 Γιώργος Κυλάφας wrote:
>> [...]. whenever JuK restores a
>> manually sorted playlist, it should keep the original order.
>>
>> I have found an easy way to implement this for plain Playlists
>> [...], as per the attached patch.
>
> It makes sense, and you even use the appropriate version of setSorting() such
> that the user can re-enable sorting later if desired, which is a nice touch.
>
> 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.

Regards,

-- 
Γιώργος Κυλάφας (Giorgos Kylafas)
http://en.wikipedia.org/wiki/Posting_style#Inline_replying
_______________________________________________
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