Commit 975c1ec8 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

use standard Qt::SortOrder type instead of Elisa specific one

remove code and remove data converion done in qml
parent 5a83e25d
......@@ -23,7 +23,6 @@ private Q_SLOTS:
void initTestCase()
{
qRegisterMetaType<ViewManager::SortOrder>("ViewManager::SortOrder");
qRegisterMetaType<ViewManager::RadioSpecificStyle>("ViewManager::RadioSpecificStyle");
qRegisterMetaType<ViewManager::AlbumViewStyle>("ViewManager::AlbumViewStyle");
qRegisterMetaType<ElisaUtils::PlayListEntryType>("ElisaUtils::PlayListEntryType");
......
......@@ -168,7 +168,6 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
qRegisterMetaType<DataTypes::ColumnsRoles>("DataTypes::ColumnsRoles");
qRegisterMetaType<ModelDataLoader::TrackDataType>("ModelDataLoader::TrackDataType");
qRegisterMetaType<TracksListener::TrackDataType>("TracksListener::TrackDataType");
qRegisterMetaType<ViewManager::SortOrder>("ViewManager::SortOrder");
qmlRegisterUncreatableType<ElisaConfigurationDialog>(uri, 1, 0, "ElisaConfigurationDialog", QStringLiteral("only one and done in c++"));
qmlRegisterUncreatableType<ElisaApplication>(uri, 1, 0, "ElisaApplication", QStringLiteral("only one and done in c++"));
......
......@@ -224,10 +224,8 @@ FocusScope {
realModel.initialize(elisa.musicManager, elisa.musicManager.viewDatabase, modelType, filterType, mainTitle, secondaryTitle, databaseId)
}
if (sortAscending === ViewManager.SortAscending) {
proxyModel.sortModel(Qt.AscendingOrder)
} else if (sortAscending === ViewManager.SortDescending) {
proxyModel.sortModel(Qt.DescendingOrder)
if (!displaySingleAlbum) {
proxyModel.sortModel(sortAscending)
}
}
}
......@@ -24,7 +24,7 @@ public:
ElisaUtils::FilterById,
ElisaUtils::Track,
Qt::DisplayRole,
ViewManager::NoSort,
Qt::AscendingOrder,
ViewManager::SingleAlbum,
ViewManager::DiscHeaders,
ViewManager::IsTrack}},
......
......@@ -13,6 +13,7 @@
#include <QObject>
#include <QUrl>
#include <Qt>
#include <memory>
......@@ -32,14 +33,6 @@ class ELISALIB_EXPORT ViewManager : public QObject
public:
enum SortOrder {
NoSort,
SortAscending,
SortDescending,
};
Q_ENUM(SortOrder)
enum AlbumCardinality {
SingleAlbum = true,
MultipleAlbum = false,
......@@ -105,7 +98,7 @@ Q_SIGNALS:
void openListView(ElisaUtils::FilterType filterType, int expectedDepth,
const QString &mainTitle, const QString &secondaryTitle, qulonglong databaseId,
const QUrl &imageUrl, ElisaUtils::PlayListEntryType dataType, const QVariant &sortRole,
ViewManager::SortOrder sortOrder, ViewManager::AlbumCardinality displaySingleAlbum,
Qt::SortOrder sortOrder, ViewManager::AlbumCardinality displaySingleAlbum,
ViewManager::AlbumViewStyle showDiscHeaders, ViewManager::RadioSpecificStyle radioCase);
void switchFilesBrowserView(int expectedDepth, const QString &mainTitle, const QUrl &imageUrl);
......
......@@ -22,7 +22,7 @@ public:
ElisaUtils::FilterByRecentlyPlayed,
ElisaUtils::Track,
DataTypes::LastPlayDate,
ViewManager::SortDescending,
Qt::DescendingOrder,
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack},
......@@ -32,7 +32,7 @@ public:
ElisaUtils::FilterByFrequentlyPlayed,
ElisaUtils::Track,
DataTypes::PlayFrequency,
ViewManager::SortDescending,
Qt::DescendingOrder,
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack},
......@@ -58,7 +58,7 @@ public:
ElisaUtils::NoFilter,
ElisaUtils::Track,
Qt::DisplayRole,
ViewManager::SortAscending,
Qt::AscendingOrder,
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsTrack},
......@@ -79,7 +79,7 @@ public:
ElisaUtils::NoFilter,
ElisaUtils::Radio,
Qt::DisplayRole,
ViewManager::SortAscending,
Qt::AscendingOrder,
ViewManager::MultipleAlbum,
ViewManager::NoDiscHeaders,
ViewManager::IsRadio}};
......
......@@ -62,7 +62,7 @@ public:
ElisaUtils::FilterType filterType,
ElisaUtils::PlayListEntryType dataType,
int sortRole,
ViewManager::SortOrder sortOrder,
Qt::SortOrder sortOrder,
ViewManager::AlbumCardinality albumCardinality,
ViewManager::AlbumViewStyle albumViewStyle,
ViewManager::RadioSpecificStyle radioSpecificStyle)
......@@ -124,7 +124,7 @@ public:
int mSortRole = Qt::DisplayRole;
ViewManager::SortOrder mSortOrder = ViewManager::SortAscending;
Qt::SortOrder mSortOrder = Qt::AscendingOrder;
ViewManager::AlbumCardinality mAlbumCardinality = ViewManager::MultipleAlbum;
......
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