[vlc-commits] qt: add criteriaToName to mlvideomodel

Abel Tesfaye git at videolan.org
Tue Aug 20 18:21:13 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Fri Aug  9 15:02:32 2019 +0300| [daf58b6c07aa74cd97e0792e44466ab8a0909a64] | committer: Jean-Baptiste Kempf

qt: add criteriaToName to mlvideomodel

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=daf58b6c07aa74cd97e0792e44466ab8a0909a64
---

 modules/gui/qt/components/mediacenter/mlvideomodel.cpp | 5 +++++
 modules/gui/qt/components/mediacenter/mlvideomodel.hpp | 1 +
 2 files changed, 6 insertions(+)

diff --git a/modules/gui/qt/components/mediacenter/mlvideomodel.cpp b/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
index 26136de8ac..c779a14736 100644
--- a/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
@@ -147,6 +147,11 @@ vlc_ml_sorting_criteria_t MLVideoModel::nameToCriteria(QByteArray name) const
     return M_names_to_criteria.value(name, VLC_ML_SORTING_DEFAULT);
 }
 
+QByteArray MLVideoModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
+{
+    return M_names_to_criteria.key(criteria, "");
+}
+
 void MLVideoModel::onVlcMlEvent(const vlc_ml_event_t* event)
 {
     switch (event->i_type)
diff --git a/modules/gui/qt/components/mediacenter/mlvideomodel.hpp b/modules/gui/qt/components/mediacenter/mlvideomodel.hpp
index ae0bac0dc6..2e55a5f94e 100644
--- a/modules/gui/qt/components/mediacenter/mlvideomodel.hpp
+++ b/modules/gui/qt/components/mediacenter/mlvideomodel.hpp
@@ -51,6 +51,7 @@ private:
 
     static QHash<QByteArray, vlc_ml_sorting_criteria_t> M_names_to_criteria;
     static QString getFirstSymbol( const QString& str );
+    QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
 };
 
 #endif // MCVIDEOMODEL_H



More information about the vlc-commits mailing list