playlist view is always randomly sorted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Medium
|
Albert Santoni |
Bug Description
hi,
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::
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
Changed in mixxx: | |
milestone: | 1.8.0-moving → 1.8.0 |
Changed in mixxx: | |
status: | Won't Fix → Fix Released |
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.