Commit df7d96dc authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

sort related view parameters now comes from c++ side of Elisa

parent c952167b
......@@ -66,11 +66,11 @@ RowLayout {
isSubPage: (browseStackView.depth >= 2),
haveTreeModel: configurationData.isTreeModel,
stackView: configurationData.browseStackView,
sortRole: Qt.DisplayRole,
sortRoles: [Qt.DisplayRole],
sortRoleNames: [''],
sortOrderNames: ['A-Z', 'Z-A'],
sortOrder: Qt.AscendingOrder,
sortRole: configurationData.sortRole,
sortRoles: configurationData.sortRoles,
sortRoleNames: configurationData.sortRoleNames,
sortOrder: configurationData.sortOrder,
sortOrderNames: configurationData.sortOrderNames,
opacity: 1,
}, StackView.Immediate)
}
......@@ -101,11 +101,11 @@ RowLayout {
showSection: configurationData.showDiscHeaders,
radioCase: configurationData.radioCase,
haveTreeModel: configurationData.isTreeModel,
sortRole: Qt.DisplayRole,
sortRoles: [Qt.DisplayRole],
sortRoleNames: [''],
sortOrderNames: ['A-Z', 'Z-A'],
sortOrder: Qt.AscendingOrder,
sortRole: configurationData.sortRole,
sortRoles: configurationData.sortRoles,
sortRoleNames: configurationData.sortRoleNames,
sortOrder: configurationData.sortOrder,
sortOrderNames: configurationData.sortOrderNames,
opacity: 1,
}, StackView.Immediate)
}
......
......@@ -29,7 +29,6 @@ FocusScope {
property alias sortRoleNames: listView.sortRoleNames
property alias sortOrderNames: listView.sortOrderNames
property alias sortOrder: listView.sortOrder
property var sortAscending
property bool displaySingleAlbum: false
property alias radioCase: listView.showCreateRadioButton
property bool modelIsInitialized: false
......
......@@ -30,9 +30,9 @@ ColumnLayout {
property bool expandedFilterView
property bool enableSorting: true
property alias sortRole: sortMenu.sortRole
property var sortOrder
property alias sortRoles: sortMenu.sortRoles
property alias sortRoleNames: sortMenu.sortRoleNames
property alias sortOrder: sortMenu.sortOrder
property alias sortOrderNames: sortMenu.sortOrderNames
signal enqueue();
......@@ -145,8 +145,6 @@ ColumnLayout {
SortMenu {
id: sortMenu
onSortOrderChanged: navigationBar.sortOrder = sortOrder
}
},
FlatButtonWithToolTip {
......
......@@ -38,18 +38,18 @@ Menu {
Repeater {
id: rolesRepeater
model: sortRoleNames.length > 1 ? sortRoleNames : []
model: sortRoleNames.length > 1 ? sortRoleNames.length : 0
delegate: MenuItem {
text: modelData
text: sortMenu.sortRoleNames[index]
checkable: true
checked: sortRoles[index] === sortMenu.sortRole
checked: sortMenu.sortRoles[index] === sortMenu.sortRole
onToggled: {
sortMenu.sortRole = sortRoles[index]
checked = (sortRoles[index] === sortMenu.sortRole)
sortMenu.sortRole = sortMenu.sortRoles[index]
checked = (sortMenu.sortRoles[index] === sortMenu.sortRole)
}
ButtonGroup.group: rolesButtonGroup
......
......@@ -18,6 +18,8 @@ public:
QUrl imageUrl, ElisaUtils::PlayListEntryType dataType,
QAbstractItemModel *model, QAbstractProxyModel *associatedProxyModel,
QUrl viewDefaultIcon, DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::ViewCanBeRated viewShowRating,
ViewManager::DelegateUseSecondaryText viewDelegateDisplaySecondaryText,
ViewManager::IsTreeModelType isTreeModel)
......@@ -34,6 +36,11 @@ public:
, mViewShowRating(viewShowRating)
, mViewDelegateDisplaySecondaryText(viewDelegateDisplaySecondaryText)
, mIsTreeModel(isTreeModel)
, mSortRole(sortRole)
, mSortRoles(std::move(sortRoles))
, mSortRoleNames(std::move(sortRoleNames))
, mSortOrder(sortOrder)
, mSortOrderNames(std::move(sortOrderNames))
{
}
......@@ -41,7 +48,9 @@ public:
QString mainTitle, QString secondaryTitle,
QUrl imageUrl, ElisaUtils::PlayListEntryType dataType,
QAbstractItemModel *model, QAbstractProxyModel *associatedProxyModel,
DataTypes::DataType dataFilter, int sortRole, Qt::SortOrder sortOrder,
DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::AlbumCardinality displaySingleAlbum,
ViewManager::AlbumViewStyle showDiscHeaders,
ViewManager::RadioSpecificStyle radioCase,
......@@ -57,7 +66,10 @@ public:
, mDataFilter(std::move(dataFilter))
, mIsTreeModel(isTreeModel)
, mSortRole(sortRole)
, mSortRoles(std::move(sortRoles))
, mSortRoleNames(std::move(sortRoleNames))
, mSortOrder(sortOrder)
, mSortOrderNames(std::move(sortOrderNames))
, mDisplaySingleAlbum(displaySingleAlbum)
, mShowDiscHeaders(showDiscHeaders)
, mRadioCase(radioCase)
......@@ -92,8 +104,14 @@ public:
int mSortRole;
QVector<int> mSortRoles;
QList<QString> mSortRoleNames;
Qt::SortOrder mSortOrder;
QList<QString> mSortOrderNames;
ViewManager::AlbumCardinality mDisplaySingleAlbum;
ViewManager::AlbumViewStyle mShowDiscHeaders;
......@@ -112,6 +130,8 @@ ViewConfigurationData::ViewConfigurationData(ElisaUtils::FilterType filterType,
QUrl imageUrl, ElisaUtils::PlayListEntryType dataType,
QAbstractItemModel *model, QAbstractProxyModel *associatedProxyModel,
QUrl viewDefaultIcon, DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::ViewCanBeRated viewShowRating,
ViewManager::DelegateUseSecondaryText viewDelegateDisplaySecondaryText,
ViewManager::IsTreeModelType isTreeModel, QObject *parent)
......@@ -120,6 +140,8 @@ ViewConfigurationData::ViewConfigurationData(ElisaUtils::FilterType filterType,
std::move(secondaryTitle), std::move(imageUrl),
dataType, model, associatedProxyModel,
std::move(viewDefaultIcon), std::move(dataFilter),
sortRole, std::move(sortRoles), std::move(sortRoleNames),
sortOrder, std::move(sortOrderNames),
viewShowRating,viewDelegateDisplaySecondaryText,
isTreeModel))
{
......@@ -129,7 +151,9 @@ ViewConfigurationData::ViewConfigurationData(ElisaUtils::FilterType filterType,
QString mainTitle, QString secondaryTitle,
QUrl imageUrl, ElisaUtils::PlayListEntryType dataType,
QAbstractItemModel *model, QAbstractProxyModel *associatedProxyModel,
DataTypes::DataType dataFilter, int sortRole, Qt::SortOrder sortOrder,
DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::AlbumCardinality displaySingleAlbum,
ViewManager::AlbumViewStyle showDiscHeaders,
ViewManager::RadioSpecificStyle radioCase,
......@@ -138,7 +162,8 @@ ViewConfigurationData::ViewConfigurationData(ElisaUtils::FilterType filterType,
, d(std::make_unique<ViewConfigurationDataPrivate>(filterType, expectedDepth, std::move(mainTitle),
std::move(secondaryTitle), std::move(imageUrl),
dataType, model, associatedProxyModel, std::move(dataFilter),
sortRole, sortOrder, displaySingleAlbum, showDiscHeaders,
sortRole, std::move(sortRoles), std::move(sortRoleNames),
sortOrder, std::move(sortOrderNames), displaySingleAlbum, showDiscHeaders,
radioCase, isTreeModel))
{
}
......@@ -213,11 +238,26 @@ int ViewConfigurationData::sortRole() const
return d->mSortRole;
}
QVector<int> ViewConfigurationData::sortRoles() const
{
return d->mSortRoles;
}
QList<QString> ViewConfigurationData::sortRoleNames() const
{
return d->mSortRoleNames;
}
Qt::SortOrder ViewConfigurationData::sortOrder() const
{
return d->mSortOrder;
}
QList<QString> ViewConfigurationData::sortOrderNames() const
{
return d->mSortOrderNames;
}
ViewManager::AlbumCardinality ViewConfigurationData::displaySingleAlbum() const
{
return d->mDisplaySingleAlbum;
......
......@@ -83,10 +83,22 @@ class ELISALIB_EXPORT ViewConfigurationData : public QObject
READ sortRole
CONSTANT)
Q_PROPERTY(QVector<int> sortRoles
READ sortRoles
CONSTANT)
Q_PROPERTY(QList<QString> sortRoleNames
READ sortRoleNames
CONSTANT)
Q_PROPERTY(Qt::SortOrder sortOrder
READ sortOrder
CONSTANT)
Q_PROPERTY(QList<QString> sortOrderNames
READ sortOrderNames
CONSTANT)
Q_PROPERTY(ViewManager::AlbumCardinality displaySingleAlbum
READ displaySingleAlbum
CONSTANT)
......@@ -106,15 +118,20 @@ public:
QString mainTitle, QString secondaryTitle, QUrl imageUrl,
ElisaUtils::PlayListEntryType dataType, QAbstractItemModel *model,
QAbstractProxyModel *associatedProxyModel, QUrl viewDefaultIcon,
DataTypes::DataType dataFilter, ViewManager::ViewCanBeRated viewShowRating,
DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::ViewCanBeRated viewShowRating,
ViewManager::DelegateUseSecondaryText viewDelegateDisplaySecondaryText,
ViewManager::IsTreeModelType isTreeModel, QObject *parent = nullptr);
explicit ViewConfigurationData(ElisaUtils::FilterType filterType, int expectedDepth,
QString mainTitle, QString secondaryTitle,
QUrl imageUrl, ElisaUtils::PlayListEntryType dataType, QAbstractItemModel *model,
QAbstractProxyModel *associatedProxyModel, DataTypes::DataType dataFilter, int sortRole,
Qt::SortOrder sortOrder, ViewManager::AlbumCardinality displaySingleAlbum,
QAbstractProxyModel *associatedProxyModel, DataTypes::DataType dataFilter,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::AlbumCardinality displaySingleAlbum,
ViewManager::AlbumViewStyle showDiscHeaders, ViewManager::RadioSpecificStyle radioCase,
ViewManager::IsTreeModelType isTreeModel, QObject *parent = nullptr);
......@@ -148,8 +165,14 @@ public:
int sortRole() const;
QVector<int> sortRoles() const;
QList<QString> sortRoleNames() const;
Qt::SortOrder sortOrder() const;
QList<QString> sortOrderNames() const;
ViewManager::AlbumCardinality displaySingleAlbum() const;
ViewManager::AlbumViewStyle showDiscHeaders() const;
......
......@@ -32,7 +32,10 @@ public:
ElisaUtils::FilterById,
ElisaUtils::Track,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Title")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
ViewManager::SingleAlbum,
ViewManager::DiscHeaders,
ViewManager::IsTrack,
......@@ -43,6 +46,11 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::FilterByGenre,
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......@@ -53,6 +61,11 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::FilterByArtist,
ElisaUtils::Album,
DataTypes::TitleRole,
{DataTypes::TitleRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Genre"), i18n("Sort by Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
ViewManager::DelegateWithSecondaryText,
ViewManager::ViewShowRating,
......@@ -63,6 +76,11 @@ public:
ViewManager::FileBrowserModel,
ElisaUtils::FilterByPath,
ElisaUtils::FileName,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/folder")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......@@ -299,6 +317,8 @@ void ViewManager::openViewFromData(const ViewParameters &viewParamaters)
viewParamaters.mMainImage, viewParamaters.mDataType,
newModel, proxyModel, viewParamaters.mFallbackItemIcon,
viewParamaters.mDataFilter,
viewParamaters.mSortRole, viewParamaters.mSortRoles, viewParamaters.mSortRoleNames,
viewParamaters.mSortOrder, viewParamaters.mSortOrderNames,
viewParamaters.mViewCanBeRated, viewParamaters.mShowSecondaryTextOnDelegates,
viewParamaters.mIsTreeModel);
......@@ -322,7 +342,8 @@ void ViewManager::openViewFromData(const ViewParameters &viewParamaters)
viewParamaters.mMainTitle, viewParamaters.mSecondaryTitle,
viewParamaters.mMainImage, viewParamaters.mDataType,
newModel, proxyModel, viewParamaters.mDataFilter,
viewParamaters.mSortRole, viewParamaters.mSortOrder,
viewParamaters.mSortRole, viewParamaters.mSortRoles, viewParamaters.mSortRoleNames,
viewParamaters.mSortOrder, viewParamaters.mSortOrderNames,
viewParamaters.mAlbumCardinality, viewParamaters.mAlbumViewStyle,
viewParamaters.mRadioSpecificStyle, viewParamaters.mIsTreeModel);
......
......@@ -30,7 +30,10 @@ public:
ElisaUtils::FilterByRecentlyPlayed,
ElisaUtils::Track,
DataTypes::LastPlayDate,
{DataTypes::LastPlayDate},
{i18n("Sort by Last Played Date")},
Qt::DescendingOrder,
{i18n("Least Recently Played First"), i18n("Most Recently Played First")},
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack,
......@@ -42,7 +45,10 @@ public:
ElisaUtils::FilterByFrequentlyPlayed,
ElisaUtils::Track,
DataTypes::PlayFrequency,
{DataTypes::PlayFrequency},
{i18n("Sort by Play Frequency")},
Qt::DescendingOrder,
{i18n("Least Frequently Played First"), i18n("Most Frequently Played First")},
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack,
......@@ -53,6 +59,11 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Album,
DataTypes::TitleRole,
{DataTypes::TitleRole, DataTypes::ArtistRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Artist"), i18n("Sort by Genre"), i18n("Sort by Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
ViewManager::DelegateWithSecondaryText,
ViewManager::ViewShowRating,
......@@ -63,6 +74,11 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......@@ -73,8 +89,15 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Track,
Qt::DisplayRole,
DataTypes::TitleRole,
{DataTypes::TitleRole, DataTypes::AlbumRole, DataTypes::ArtistRole,
DataTypes::GenreRole, DataTypes::YearRole, DataTypes::DurationRole,
DataTypes::ComposerRole, DataTypes::LyricistRole},
{i18n("Sort by Title"), i18n("Sort by Album"), i18n("Sort by Artist"), i18n("Sort by Genre"),
i18n("Sort by Year"), i18n("Sort by Duration"), i18n("Sort by Composer"), i18n("Sort by Lyricist")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"),
i18n("Oldest First"), i18n("Newest First"), i18n("Shortest First"), i18n("Longest First"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A")},
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack,
......@@ -85,6 +108,11 @@ public:
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Genre,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Genre")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-genre")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......@@ -108,7 +136,10 @@ public:
ElisaUtils::NoFilter,
ElisaUtils::Radio,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsRadio,
......@@ -326,7 +357,10 @@ void ViewsListData::albumsAdded(DataTypes::ListAlbumDataType newData)
ElisaUtils::Track,
ElisaUtils::Album,
Qt::DisplayRole,
Qt::SortOrder::AscendingOrder,
{Qt::DisplayRole},
{QStringLiteral("Title")},
Qt::AscendingOrder,
{QStringLiteral("A-Z"), QStringLiteral("Z-A")},
ViewManager::SingleAlbum,
ViewManager::DiscHeaders,
ViewManager::IsTrack,
......@@ -494,6 +528,11 @@ void ViewsListData::refreshEmbeddedCategory()
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Album,
Qt::DisplayRole,
{DataTypes::TitleRole, DataTypes::ArtistRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Artist"), i18n("Sort by Genre"), i18n("Sort by Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
ViewManager::DelegateWithSecondaryText,
ViewManager::ViewShowRating,
......@@ -508,6 +547,11 @@ void ViewsListData::refreshEmbeddedCategory()
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
Qt::AscendingOrder,
{QStringLiteral("A-Z"), QStringLiteral("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......@@ -522,6 +566,11 @@ void ViewsListData::refreshEmbeddedCategory()
ViewManager::GenericDataModel,
ElisaUtils::NoFilter,
ElisaUtils::Genre,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Genre")},
Qt::AscendingOrder,
{QStringLiteral("A-Z"), QStringLiteral("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-genre")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating,
......
......@@ -56,6 +56,8 @@ public:
ViewManager::ModelType modelType,
ElisaUtils::FilterType filterType,
ElisaUtils::PlayListEntryType dataType,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
QUrl fallbackItemIcon,
ViewManager::DelegateUseSecondaryText showSecondaryTextOnDelegates,
ViewManager::ViewCanBeRated viewCanBeRated,
......@@ -70,6 +72,11 @@ public:
, mShowSecondaryTextOnDelegates(showSecondaryTextOnDelegates)
, mViewCanBeRated(viewCanBeRated)
, mIsTreeModel(isTreeModel)
, mSortRole(sortRole)
, mSortRoles(std::move(sortRoles))
, mSortRoleNames(std::move(sortRoleNames))
, mSortOrder(sortOrder)
, mSortOrderNames(std::move(sortOrderNames))
, mIsValid(true)
{
}
......@@ -106,8 +113,8 @@ public:
ViewManager::ModelType modelType,
ElisaUtils::FilterType filterType,
ElisaUtils::PlayListEntryType dataType,
int sortRole,
Qt::SortOrder sortOrder,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::AlbumCardinality albumCardinality,
ViewManager::AlbumViewStyle albumViewStyle,
ViewManager::RadioSpecificStyle radioSpecificStyle,
......@@ -120,7 +127,10 @@ public:
, mDataType(dataType)
, mIsTreeModel(isTreeModel)
, mSortRole(sortRole)
, mSortRoles(std::move(sortRoles))
, mSortRoleNames(std::move(sortRoleNames))
, mSortOrder(sortOrder)
, mSortOrderNames(std::move(sortOrderNames))
, mAlbumCardinality(albumCardinality)
, mAlbumViewStyle(albumViewStyle)
, mRadioSpecificStyle(radioSpecificStyle)
......@@ -146,7 +156,7 @@ public:
, mFilterType(filterType)
, mDataType(dataType)
, mEntryType(entryType)
, mFallbackItemIcon(fallbackItemIcon)
, mFallbackItemIcon(std::move(fallbackItemIcon))
, mShowSecondaryTextOnDelegates(showSecondaryTextOnDelegates)
, mViewCanBeRated(viewCanBeRated)
, mIsValid(true)
......@@ -162,8 +172,8 @@ public:
qulonglong databaseId,
ElisaUtils::PlayListEntryType dataType,
ElisaUtils::PlayListEntryType entryType,
int sortRole,
Qt::SortOrder sortOrder,
int sortRole, QVector<int> sortRoles, QList<QString> sortRoleNames,
Qt::SortOrder sortOrder, QList<QString> sortOrderNames,
ViewManager::AlbumCardinality albumCardinality,
ViewManager::AlbumViewStyle albumViewStyle,
ViewManager::RadioSpecificStyle radioSpecificStyle,
......@@ -176,7 +186,10 @@ public:
, mDataType(dataType)
, mEntryType(entryType)
, mSortRole(sortRole)
, mSortRoles(std::move(sortRoles))
, mSortRoleNames(std::move(sortRoleNames))
, mSortOrder(sortOrder)
, mSortOrderNames(std::move(sortOrderNames))
, mAlbumCardinality(albumCardinality)
, mAlbumViewStyle(albumViewStyle)
, mRadioSpecificStyle(radioSpecificStyle)
......@@ -192,7 +205,8 @@ public:
mModelType == other.mModelType && mFilterType == other.mFilterType &&
mDataType == other.mDataType && mIsTreeModel == other.mIsTreeModel && mFallbackItemIcon == other.mFallbackItemIcon &&
mShowSecondaryTextOnDelegates == other.mShowSecondaryTextOnDelegates && mViewCanBeRated == other.mViewCanBeRated &&
mSortRole == other.mSortRole && mSortOrder == other.mSortOrder &&
mSortRole == other.mSortRole && mSortRoles == other.mSortRoles && mSortRoleNames == other.mSortRoleNames &&
mSortOrder == other.mSortOrder && mSortOrderNames == other.mSortOrderNames &&
mAlbumCardinality == other.mAlbumCardinality && mAlbumViewStyle == other.mAlbumViewStyle &&
mRadioSpecificStyle == other.mRadioSpecificStyle && mDepth == other.mDepth &&
mDataFilter == other.mDataFilter;
......@@ -204,7 +218,8 @@ public:
mModelType != other.mModelType || mFilterType != other.mFilterType ||
mDataType != other.mDataType || mIsTreeModel != other.mIsTreeModel || mFallbackItemIcon != other.mFallbackItemIcon ||
mShowSecondaryTextOnDelegates != other.mShowSecondaryTextOnDelegates || mViewCanBeRated != other.mViewCanBeRated ||
mSortRole != other.mSortRole || mSortOrder != other.mSortOrder ||
mSortRole != other.mSortRole || mSortRoles != other.mSortRoles || mSortRoleNames != other.mSortRoleNames ||
mSortOrder != other.mSortOrder || mSortOrderNames != other.mSortOrderNames ||
mAlbumCardinality != other.mAlbumCardinality || mAlbumViewStyle != other.mAlbumViewStyle ||
mRadioSpecificStyle != other.mRadioSpecificStyle || mDepth != other.mDepth ||
mDataFilter != other.mDataFilter;
......@@ -236,8 +251,14 @@ public:
int mSortRole = Qt::DisplayRole;
QVector<int> mSortRoles = {Qt::DisplayRole};
QList<QString> mSortRoleNames = {QString{}};
Qt::SortOrder mSortOrder = Qt::AscendingOrder;
QList<QString> mSortOrderNames = {QStringLiteral("A-Z"), QStringLiteral("Z-A")};
ViewManager::AlbumCardinality mAlbumCardinality = ViewManager::MultipleAlbum;
ViewManager::AlbumViewStyle mAlbumViewStyle = ViewManager::NoDiscHeaders;
......
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