playlist view is always randomly sorted

Bug #253939 reported by olo
2
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::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

Tags: library
Revision history for this message
olo (zulumantee) wrote :
Revision history for this message
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)
Changed in mixxx:
status: Won't Fix → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5012

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.