[vlc-commits] qt: add first_symbol model roles in album model
Prince Gupta
git at videolan.org
Wed Jun 24 17:41:59 CEST 2020
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Wed Jun 10 15:18:48 2020 +0530| [483648bd6c4943b7794ded659c63e51f2541d454] | committer: Pierre Lamot
qt: add first_symbol model roles in album model
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=483648bd6c4943b7794ded659c63e51f2541d454
---
modules/gui/qt/medialibrary/mlalbummodel.cpp | 8 +++++++-
modules/gui/qt/medialibrary/mlalbummodel.hpp | 5 ++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/medialibrary/mlalbummodel.cpp b/modules/gui/qt/medialibrary/mlalbummodel.cpp
index 0d4b438284..b4a62b9de0 100644
--- a/modules/gui/qt/medialibrary/mlalbummodel.cpp
+++ b/modules/gui/qt/medialibrary/mlalbummodel.cpp
@@ -59,6 +59,10 @@ QVariant MLAlbumModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue( ml_item->getNbTracks() );
case ALBUM_DURATION:
return QVariant::fromValue( ml_item->getDuration() );
+ case ALBUM_TITLE_FIRST_SYMBOL:
+ return QVariant::fromValue( getFirstSymbol( ml_item->getTitle() ) );
+ case ALBUM_MAIN_ARTIST_FIRST_SYMBOL:
+ return QVariant::fromValue( getFirstSymbol( ml_item->getArtist() ) );
default:
return QVariant();
}
@@ -74,7 +78,9 @@ QHash<int, QByteArray> MLAlbumModel::roleNames() const
{ALBUM_COVER, "cover"},
{ALBUM_MAIN_ARTIST, "main_artist"},
{ALBUM_NB_TRACKS, "nb_tracks"},
- {ALBUM_DURATION, "duration"}
+ {ALBUM_DURATION, "duration"},
+ {ALBUM_TITLE_FIRST_SYMBOL, "title_first_symbol"},
+ {ALBUM_MAIN_ARTIST_FIRST_SYMBOL, "main_artist_first_symbol"}
};
}
diff --git a/modules/gui/qt/medialibrary/mlalbummodel.hpp b/modules/gui/qt/medialibrary/mlalbummodel.hpp
index 6b5dcfc145..f531851d00 100644
--- a/modules/gui/qt/medialibrary/mlalbummodel.hpp
+++ b/modules/gui/qt/medialibrary/mlalbummodel.hpp
@@ -42,7 +42,10 @@ public:
ALBUM_COVER,
ALBUM_MAIN_ARTIST,
ALBUM_NB_TRACKS,
- ALBUM_DURATION
+ ALBUM_DURATION,
+
+ ALBUM_TITLE_FIRST_SYMBOL,
+ ALBUM_MAIN_ARTIST_FIRST_SYMBOL
};
Q_ENUM(Roles)
More information about the vlc-commits
mailing list