[vlc-commits] qt: mlalbummodel: move roles to class and use Q_ENUM
Pierre Lamot
git at videolan.org
Tue Oct 15 15:01:52 CEST 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Oct 9 19:11:22 2019 +0200| [2fe13cb781d1547c67aee9e2ff62e120e98aea46] | committer: Thomas Guillem
qt: mlalbummodel: move roles to class and use Q_ENUM
... so that roles are exposed to QML.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2fe13cb781d1547c67aee9e2ff62e120e98aea46
---
modules/gui/qt/components/mediacenter/mlalbummodel.cpp | 14 --------------
modules/gui/qt/components/mediacenter/mlalbummodel.hpp | 14 ++++++++++++++
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt/components/mediacenter/mlalbummodel.cpp b/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
index 4a585ac7f4..4b5eca576a 100644
--- a/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
@@ -18,20 +18,6 @@
#include "mlalbummodel.hpp"
-namespace {
- enum Roles
- {
- ALBUM_ID = Qt::UserRole + 1,
- ALBUM_TITLE,
- ALBUM_RELEASE_YEAR,
- ALBUM_SHORT_SUMMARY,
- ALBUM_COVER,
- ALBUM_MAIN_ARTIST,
- ALBUM_NB_TRACKS,
- ALBUM_DURATION
- };
-}
-
QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumModel::M_names_to_criteria = {
{"id", VLC_ML_SORTING_DEFAULT},
{"title", VLC_ML_SORTING_ALBUM},
diff --git a/modules/gui/qt/components/mediacenter/mlalbummodel.hpp b/modules/gui/qt/components/mediacenter/mlalbummodel.hpp
index ab267e376d..6899bf4a86 100644
--- a/modules/gui/qt/components/mediacenter/mlalbummodel.hpp
+++ b/modules/gui/qt/components/mediacenter/mlalbummodel.hpp
@@ -32,6 +32,20 @@ class MLAlbumModel : public MLSlidingWindowModel<MLAlbum>
{
Q_OBJECT
+public:
+ enum Roles
+ {
+ ALBUM_ID = Qt::UserRole + 1,
+ ALBUM_TITLE,
+ ALBUM_RELEASE_YEAR,
+ ALBUM_SHORT_SUMMARY,
+ ALBUM_COVER,
+ ALBUM_MAIN_ARTIST,
+ ALBUM_NB_TRACKS,
+ ALBUM_DURATION
+ };
+ Q_ENUM(Roles)
+
public:
explicit MLAlbumModel(QObject *parent = nullptr);
virtual ~MLAlbumModel() = default;
More information about the vlc-commits
mailing list