playlist view is always randomly sorted

Bug #253939 reported by olo on 2008-08-01
Affects Status Importance Assigned to Milestone
Albert Santoni

Bug Description


the playlists are randomly sorted in "Playlist" view. a patch is attached.

the reason why the the playlists were sorted randomly is the failure of the qSort call in Track::updatePlaylistViews()

this comes due to the fact that the QList that is being sorted ( Track::m_qPlaylists ) consists only of pointers to TrackPlaylist objects. the qSort algorithm only itertates over these pointers and calls the less-than operator of the pointer instead of the real object.

in order to fix this issue, qSort is now called with a custom less-than functor which dereferences the pointers first before calling the less-than operator on the obtained reference.

the used functor is generic and resides currently in track.cpp but it could be useful in other situations as well.

the less-than opertor overloaded by Tracklist was protected and was made public in order to be able to access it. additionally, this operator now only delegates the less-than call to the QString objects which represent the playlist name.

peace, olo

olo (zulumantee) wrote :
Albert Santoni (gamegod) wrote :

Playlist support is going to be replaced with just a basic solid library in the future. For now, I'm going to mark this as WONTFIX, but hopefully we'll have playlist support again one day.

Changed in mixxx:
assignee: nobody → gamegod
importance: Undecided → Medium
milestone: none → 1.6.3
status: New → Won't Fix
Changed in mixxx:
milestone: 1.8.0-moving → 1.8.0
Albert Santoni (gamegod) on 2010-02-23
Changed in mixxx:
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers