Commit 3de6de27 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

fix sort by duration to not use string sort

separate the display of durations with StringDurationRole of the role
used to sort by duration (i.e. DurationRole) in milliseconds
parent 0e88950d
Pipeline #51234 passed with stage
in 25 seconds
......@@ -87,7 +87,7 @@ QHash<int, QByteArray> DataModel::roleNames() const
roles[static_cast<int>(DataTypes::ColumnsRoles::AlbumRole)] = "album";
roles[static_cast<int>(DataTypes::ColumnsRoles::AlbumArtistRole)] = "albumArtist";
roles[static_cast<int>(DataTypes::ColumnsRoles::DurationRole)] = "duration";
roles[static_cast<int>(DataTypes::ColumnsRoles::StringDurationRole)] = "duration";
roles[static_cast<int>(DataTypes::ColumnsRoles::TrackNumberRole)] = "trackNumber";
roles[static_cast<int>(DataTypes::ColumnsRoles::DiscNumberRole)] = "discNumber";
roles[static_cast<int>(DataTypes::ColumnsRoles::RatingRole)] = "rating";
......@@ -156,7 +156,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
case DataTypes::ColumnsRoles::DurationRole:
case DataTypes::ColumnsRoles::StringDurationRole:
switch (d->mModelType)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment