[vlc-devel] [PATCH 7/8] qt: medialib: merge base list models

Romain Vimont rom1v at videolabs.io
Thu Dec 3 12:12:11 CET 2020


Since Qt signals/slots are incompatible with templates, the base list
model was initially split into two parts:
 - MLBaseModel, non-template, with signals/slots
 - MLSlidingWindowModel, template, inheriting MLBaseModel

Now that MLSlidingWindowModel is not template anymore, there is no
reason to keep it separated. Simplify.
---
 modules/gui/qt/medialibrary/mlalbummodel.cpp  |   4 +-
 modules/gui/qt/medialibrary/mlalbummodel.hpp  |   2 +-
 .../gui/qt/medialibrary/mlalbumtrackmodel.cpp |   2 +-
 .../gui/qt/medialibrary/mlalbumtrackmodel.hpp |   2 +-
 modules/gui/qt/medialibrary/mlartistmodel.cpp |   4 +-
 modules/gui/qt/medialibrary/mlartistmodel.hpp |   2 +-
 modules/gui/qt/medialibrary/mlbasemodel.cpp   | 111 ++++++++----------
 modules/gui/qt/medialibrary/mlbasemodel.hpp   |  98 ++++++----------
 modules/gui/qt/medialibrary/mlgenremodel.cpp  |   4 +-
 modules/gui/qt/medialibrary/mlgenremodel.hpp  |   2 +-
 .../gui/qt/medialibrary/mlrecentsmodel.cpp    |   2 +-
 .../gui/qt/medialibrary/mlrecentsmodel.hpp    |   2 +-
 .../qt/medialibrary/mlrecentsvideomodel.cpp   |   2 +-
 .../qt/medialibrary/mlrecentsvideomodel.hpp   |   2 +-
 modules/gui/qt/medialibrary/mlurlmodel.cpp    |   2 +-
 modules/gui/qt/medialibrary/mlurlmodel.hpp    |   2 +-
 modules/gui/qt/medialibrary/mlvideomodel.cpp  |   4 +-
 modules/gui/qt/medialibrary/mlvideomodel.hpp  |   2 +-
 18 files changed, 102 insertions(+), 147 deletions(-)

diff --git a/modules/gui/qt/medialibrary/mlalbummodel.cpp b/modules/gui/qt/medialibrary/mlalbummodel.cpp
index 4b78a8196d..150784df48 100644
--- a/modules/gui/qt/medialibrary/mlalbummodel.cpp
+++ b/modules/gui/qt/medialibrary/mlalbummodel.cpp
@@ -29,7 +29,7 @@ QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumModel::M_names_to_criteria =
 };
 
 MLAlbumModel::MLAlbumModel(QObject *parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
@@ -120,7 +120,7 @@ void MLAlbumModel::onVlcMlEvent(const MLEvent &event)
         default:
             break;
     }
-    MLSlidingWindowModel::onVlcMlEvent( event );
+    MLBaseModel::onVlcMlEvent( event );
 }
 
 void MLAlbumModel::thumbnailUpdated(int idx)
diff --git a/modules/gui/qt/medialibrary/mlalbummodel.hpp b/modules/gui/qt/medialibrary/mlalbummodel.hpp
index da5dd9071e..32e668d6ad 100644
--- a/modules/gui/qt/medialibrary/mlalbummodel.hpp
+++ b/modules/gui/qt/medialibrary/mlalbummodel.hpp
@@ -28,7 +28,7 @@
 #include "mlalbum.hpp"
 #include "medialib.hpp"
 
-class MLAlbumModel : public MLSlidingWindowModel
+class MLAlbumModel : public MLBaseModel
 {
     Q_OBJECT
 
diff --git a/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp b/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp
index 7ef6b3a87e..f4db5bd0a8 100644
--- a/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp
@@ -30,7 +30,7 @@ QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumTrackModel::M_names_to_crite
 };
 
 MLAlbumTrackModel::MLAlbumTrackModel(QObject *parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
diff --git a/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp b/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp
index 889a7e0502..7cc4d46bc9 100644
--- a/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp
+++ b/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp
@@ -28,7 +28,7 @@
 #include "mlalbumtrack.hpp"
 
 
-class MLAlbumTrackModel : public MLSlidingWindowModel
+class MLAlbumTrackModel : public MLBaseModel
 {
     Q_OBJECT
 
diff --git a/modules/gui/qt/medialibrary/mlartistmodel.cpp b/modules/gui/qt/medialibrary/mlartistmodel.cpp
index 9438681b2d..b489e4a65b 100644
--- a/modules/gui/qt/medialibrary/mlartistmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlartistmodel.cpp
@@ -23,7 +23,7 @@ QHash<QByteArray, vlc_ml_sorting_criteria_t> MLArtistModel::M_names_to_criteria
 };
 
 MLArtistModel::MLArtistModel(QObject *parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
@@ -103,7 +103,7 @@ void MLArtistModel::onVlcMlEvent(const MLEvent &event)
                 m_need_reset = true;
             break;
     }
-    MLSlidingWindowModel::onVlcMlEvent(event);
+    MLBaseModel::onVlcMlEvent(event);
 }
 
 void MLArtistModel::thumbnailUpdated(int idx)
diff --git a/modules/gui/qt/medialibrary/mlartistmodel.hpp b/modules/gui/qt/medialibrary/mlartistmodel.hpp
index a0153c1483..7cf9439842 100644
--- a/modules/gui/qt/medialibrary/mlartistmodel.hpp
+++ b/modules/gui/qt/medialibrary/mlartistmodel.hpp
@@ -27,7 +27,7 @@
 #include "mlbasemodel.hpp"
 #include "mlartist.hpp"
 
-class MLArtistModel : public MLSlidingWindowModel
+class MLArtistModel : public MLBaseModel
 {
     Q_OBJECT
 public:
diff --git a/modules/gui/qt/medialibrary/mlbasemodel.cpp b/modules/gui/qt/medialibrary/mlbasemodel.cpp
index 4a8f77dca5..b69e5b1c80 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.cpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.cpp
@@ -37,9 +37,8 @@ MLBaseModel::MLBaseModel(QObject *parent)
     connect( this, &MLBaseModel::resetRequested, this, &MLBaseModel::onResetRequested );
 }
 
-MLBaseModel::~MLBaseModel()
-{
-}
+/* For std::unique_ptr, see Effective Modern C++, Item 22 */
+MLBaseModel::~MLBaseModel() = default;
 
 void MLBaseModel::sortByColumn(QByteArray name, Qt::SortOrder order)
 {
@@ -99,6 +98,34 @@ void MLBaseModel::onVlcMlEvent(const MLEvent &event)
                 m_need_reset = false;
             }
             break;
+        case VLC_ML_EVENT_MEDIA_THUMBNAIL_GENERATED:
+        {
+            if (event.media_thumbnail_generated.b_success) {
+                if (!m_cache)
+                    break;
+
+                ssize_t stotal = m_cache->count();
+                if (stotal == COUNT_UNINITIALIZED)
+                    break;
+
+                size_t total = static_cast<size_t>(stotal);
+                for (size_t i = 0; i < total; ++i)
+                {
+                    const std::unique_ptr<MLItem> *item = m_cache->get(i);
+                    if (!item)
+                        /* Only consider items available locally in cache */
+                        break;
+
+                    MLItem *localItem = item->get();
+                    if (localItem->getId().id == event.media_thumbnail_generated.i_media_id)
+                    {
+                        thumbnailUpdated(i);
+                        break;
+                    }
+                }
+            }
+            break;
+        }
     }
 }
 
@@ -210,15 +237,7 @@ void MLBaseModel::unsetSortCriteria()
     emit sortCriteriaChanged();
 }
 
-MLSlidingWindowModel::MLSlidingWindowModel(QObject *parent)
-    : MLBaseModel(parent)
-{
-}
-
-/* For std::unique_ptr, see Effective Modern C++, Item 22 */
-MLSlidingWindowModel::~MLSlidingWindowModel() = default;
-
-int MLSlidingWindowModel::rowCount(const QModelIndex &parent) const
+int MLBaseModel::rowCount(const QModelIndex &parent) const
 {
     if (parent.isValid())
         return 0;
@@ -228,13 +247,13 @@ int MLSlidingWindowModel::rowCount(const QModelIndex &parent) const
     return m_cache->count();
 }
 
-void MLSlidingWindowModel::clear()
+void MLBaseModel::clear()
 {
     invalidateCache();
     emit countChanged( static_cast<unsigned int>(0) );
 }
 
-QVariant MLSlidingWindowModel::getIdForIndex(QVariant index) const
+QVariant MLBaseModel::getIdForIndex(QVariant index) const
 {
     MLItem* obj = nullptr;
     if (index.canConvert<int>())
@@ -249,7 +268,7 @@ QVariant MLSlidingWindowModel::getIdForIndex(QVariant index) const
 }
 
 
-QVariantList MLSlidingWindowModel::getIdsForIndexes(QModelIndexList indexes) const
+QVariantList MLBaseModel::getIdsForIndexes(QModelIndexList indexes) const
 {
     QVariantList idList;
     idList.reserve(indexes.length());
@@ -262,7 +281,7 @@ QVariantList MLSlidingWindowModel::getIdsForIndexes(QModelIndexList indexes) con
     return idList;
 }
 
-QVariantList MLSlidingWindowModel::getIdsForIndexes(QVariantList indexes) const
+QVariantList MLBaseModel::getIdsForIndexes(QVariantList indexes) const
 {
     QVariantList idList;
 
@@ -283,14 +302,14 @@ QVariantList MLSlidingWindowModel::getIdsForIndexes(QVariantList indexes) const
     return idList;
 }
 
-unsigned MLSlidingWindowModel::getCount() const
+unsigned MLBaseModel::getCount() const
 {
     if (!m_cache || m_cache->count() == COUNT_UNINITIALIZED)
         return 0;
     return static_cast<unsigned>(m_cache->count());
 }
 
-void MLSlidingWindowModel::validateCache() const
+void MLBaseModel::validateCache() const
 {
     if (m_cache)
         return;
@@ -299,21 +318,21 @@ void MLSlidingWindowModel::validateCache() const
     auto loader = createLoader();
     m_cache.reset(new ListCache<std::unique_ptr<MLItem>>(threadPool, loader));
     connect(&*m_cache, &BaseListCache::localSizeAboutToBeChanged,
-            this, &MLSlidingWindowModel::onLocalSizeAboutToBeChanged);
+            this, &MLBaseModel::onLocalSizeAboutToBeChanged);
     connect(&*m_cache, &BaseListCache::localSizeChanged,
-            this, &MLSlidingWindowModel::onLocalSizeChanged);
+            this, &MLBaseModel::onLocalSizeChanged);
     connect(&*m_cache, &BaseListCache::localDataChanged,
-            this, &MLSlidingWindowModel::onLocalDataChanged);
+            this, &MLBaseModel::onLocalDataChanged);
 
     m_cache->initCount();
 }
 
-void MLSlidingWindowModel::invalidateCache()
+void MLBaseModel::invalidateCache()
 {
     m_cache.reset();
 }
 
-MLItem *MLSlidingWindowModel::item(int signedidx) const
+MLItem *MLBaseModel::item(int signedidx) const
 {
     validateCache();
 
@@ -334,46 +353,8 @@ MLItem *MLSlidingWindowModel::item(int signedidx) const
     return item->get();
 }
 
-void MLSlidingWindowModel::onVlcMlEvent(const MLEvent &event)
-{
-    switch (event.i_type)
-    {
-        case VLC_ML_EVENT_MEDIA_THUMBNAIL_GENERATED:
-        {
-            if (event.media_thumbnail_generated.b_success) {
-                if (!m_cache)
-                    break;
-
-                ssize_t stotal = m_cache->count();
-                if (stotal == COUNT_UNINITIALIZED)
-                    break;
-
-                size_t total = static_cast<size_t>(stotal);
-                for (size_t i = 0; i < total; ++i)
-                {
-                    const std::unique_ptr<MLItem> *item = m_cache->get(i);
-                    if (!item)
-                        /* Only consider items available locally in cache */
-                        break;
-
-                    MLItem *localItem = item->get();
-                    if (localItem->getId().id == event.media_thumbnail_generated.i_media_id)
-                    {
-                        thumbnailUpdated(i);
-                        break;
-                    }
-                }
-            }
-            break;
-        }
-        default:
-            break;
-    }
-    MLBaseModel::onVlcMlEvent( event );
-}
-
-MLSlidingWindowModel::BaseLoader::BaseLoader(vlc_medialibrary_t *ml, MLItemId parent, QString searchPattern,
-                                             vlc_ml_sorting_criteria_t sort, bool sort_desc)
+MLBaseModel::BaseLoader::BaseLoader(vlc_medialibrary_t *ml, MLItemId parent, QString searchPattern,
+                                    vlc_ml_sorting_criteria_t sort, bool sort_desc)
     : m_ml(ml)
     , m_parent(parent)
     , m_searchPattern(searchPattern)
@@ -382,12 +363,12 @@ MLSlidingWindowModel::BaseLoader::BaseLoader(vlc_medialibrary_t *ml, MLItemId pa
 {
 }
 
-MLSlidingWindowModel::BaseLoader::BaseLoader(const MLSlidingWindowModel &model)
+MLBaseModel::BaseLoader::BaseLoader(const MLBaseModel &model)
     : BaseLoader(model.m_ml, model.m_parent, model.m_search_pattern, model.m_sort, model.m_sort_desc)
 {
 }
 
-MLQueryParams MLSlidingWindowModel::BaseLoader::getParams(size_t index, size_t count) const
+MLQueryParams MLBaseModel::BaseLoader::getParams(size_t index, size_t count) const
 {
     return { m_searchPattern.toUtf8(), m_sort, m_sort_desc, index, count };
 }
diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp
index da8ec363c7..901e313b63 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp
@@ -24,6 +24,7 @@
 #endif
 #include "vlc_common.h"
 
+
 #include <memory>
 #include <QObject>
 #include <QAbstractListModel>
@@ -45,6 +46,9 @@ class MLBaseModel : public QAbstractListModel
     Q_OBJECT
 
 public:
+    /* ListCache<std::unique_ptr<MLItem>>::COUNT_UNINITIALIZED */
+    static constexpr ssize_t COUNT_UNINITIALIZED = -1;
+
     explicit MLBaseModel(QObject *parent = nullptr);
     virtual ~MLBaseModel();
 
@@ -58,9 +62,9 @@ public:
     Q_PROPERTY( QString sortCriteria READ getSortCriteria WRITE setSortCriteria NOTIFY sortCriteriaChanged RESET unsetSortCriteria )
     Q_PROPERTY( unsigned int count READ getCount NOTIFY countChanged )
 
-    Q_INVOKABLE virtual QVariant getIdForIndex( QVariant index) const = 0;
-    Q_INVOKABLE virtual QVariantList getIdsForIndexes( QVariantList indexes ) const = 0;
-    Q_INVOKABLE virtual QVariantList getIdsForIndexes( QModelIndexList indexes ) const = 0;
+    Q_INVOKABLE virtual QVariant getIdForIndex( QVariant index) const;
+    Q_INVOKABLE virtual QVariantList getIdsForIndexes( QVariantList indexes ) const;
+    Q_INVOKABLE virtual QVariantList getIdsForIndexes( QModelIndexList indexes ) const;
 
     Q_INVOKABLE QMap<QString, QVariant> getDataAt(int index);
 
@@ -81,7 +85,7 @@ private:
     static void onVlcMlEvent( void* data, const vlc_ml_event_t* event );
 
 protected:
-    virtual void clear() = 0;
+    virtual void clear();
     virtual vlc_ml_sorting_criteria_t roleToCriteria(int role) const = 0;
     static QString getFirstSymbol(QString str);
     virtual vlc_ml_sorting_criteria_t nameToCriteria(QByteArray) const {
@@ -92,6 +96,32 @@ protected:
         return "";
     }
 
+    void validateCache() const;
+    void invalidateCache();
+    MLItem* item(int signedidx) const;
+    virtual void onVlcMlEvent( const MLEvent &event );
+
+    virtual ListCacheLoader<std::unique_ptr<MLItem>> *createLoader() const = 0;
+
+    virtual void thumbnailUpdated( int ) {}
+
+    /* Data loader for the cache */
+    struct BaseLoader : public ListCacheLoader<std::unique_ptr<MLItem>>
+    {
+        BaseLoader(vlc_medialibrary_t *ml, MLItemId parent, QString searchPattern,
+                   vlc_ml_sorting_criteria_t sort, bool sort_desc);
+        BaseLoader(const MLBaseModel &model);
+
+        MLQueryParams getParams(size_t index = 0, size_t count = 0) const;
+
+    protected:
+        vlc_medialibrary_t *m_ml;
+        MLItemId m_parent;
+        QString m_searchPattern;
+        vlc_ml_sorting_criteria_t m_sort;
+        bool m_sort_desc;
+    };
+
 public:
     MLItemId parentId() const;
     void setParentId(MLItemId parentId);
@@ -109,11 +139,10 @@ public:
     void setSortCriteria(const QString& criteria);
     void unsetSortCriteria();
 
-    virtual unsigned int getCount() const = 0;
+    int rowCount(const QModelIndex &parent = {}) const;
+    virtual unsigned int getCount() const;
 
 protected:
-    virtual void onVlcMlEvent( const MLEvent &event );
-
     MLItemId m_parent;
 
     vlc_medialibrary_t* m_ml;
@@ -125,61 +154,6 @@ protected:
     std::unique_ptr<vlc_ml_event_callback_t,
                     std::function<void(vlc_ml_event_callback_t*)>> m_ml_event_handle;
     bool m_need_reset;
-};
-
-/**
- * Implements a basic sliding window.
- * const_cast & immutable are unavoidable, since all access member functions
- * are marked as const. fetchMore & canFetchMore don't allow for the full size
- * to be known (so the scrollbar would grow as we scroll, until we displayed all
- * elements), and implies having all elements loaded in RAM at all time.
- */
-class MLSlidingWindowModel : public MLBaseModel
-{
-public:
-    /* ListCache<std::unique_ptr<MLItem>>::COUNT_UNINITIALIZED */
-    static constexpr ssize_t COUNT_UNINITIALIZED = -1;
-
-    MLSlidingWindowModel(QObject* parent = nullptr);
-    ~MLSlidingWindowModel();
-
-    int rowCount(const QModelIndex &parent = {}) const override;
-
-    void clear() override;
-
-    QVariant getIdForIndex( QVariant index ) const override;
-    QVariantList getIdsForIndexes( QModelIndexList indexes ) const override;
-    QVariantList getIdsForIndexes( QVariantList indexes ) const override;
-
-    unsigned getCount() const override;
-
-protected:
-    virtual ListCacheLoader<std::unique_ptr<MLItem>> *createLoader() const = 0;
-
-    void validateCache() const;
-    void invalidateCache();
-    MLItem* item(int signedidx) const;
-    void onVlcMlEvent(const MLEvent &event) override;
-
-    /* Data loader for the cache */
-    struct BaseLoader : public ListCacheLoader<std::unique_ptr<MLItem>>
-    {
-        BaseLoader(vlc_medialibrary_t *ml, MLItemId parent, QString searchPattern,
-                   vlc_ml_sorting_criteria_t sort, bool sort_desc);
-        BaseLoader(const MLSlidingWindowModel &model);
-
-        MLQueryParams getParams(size_t index = 0, size_t count = 0) const;
-
-    protected:
-        vlc_medialibrary_t *m_ml;
-        MLItemId m_parent;
-        QString m_searchPattern;
-        vlc_ml_sorting_criteria_t m_sort;
-        bool m_sort_desc;
-    };
-
-private:
-    virtual void thumbnailUpdated( int ) {}
 
     mutable std::unique_ptr<ListCache<std::unique_ptr<MLItem>>> m_cache;
 };
diff --git a/modules/gui/qt/medialibrary/mlgenremodel.cpp b/modules/gui/qt/medialibrary/mlgenremodel.cpp
index 534b7fcf32..acaba18762 100644
--- a/modules/gui/qt/medialibrary/mlgenremodel.cpp
+++ b/modules/gui/qt/medialibrary/mlgenremodel.cpp
@@ -26,7 +26,7 @@ QHash<QByteArray, vlc_ml_sorting_criteria_t> MLGenreModel::M_names_to_criteria =
 };
 
 MLGenreModel::MLGenreModel(QObject *parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
@@ -78,7 +78,7 @@ void MLGenreModel::onVlcMlEvent(const MLEvent &event)
             m_need_reset = true;
             break;
     }
-    MLSlidingWindowModel::onVlcMlEvent(event);
+    MLBaseModel::onVlcMlEvent(event);
 }
 
 void MLGenreModel::thumbnailUpdated(int idx)
diff --git a/modules/gui/qt/medialibrary/mlgenremodel.hpp b/modules/gui/qt/medialibrary/mlgenremodel.hpp
index b907ec1dc9..f0e781a28d 100644
--- a/modules/gui/qt/medialibrary/mlgenremodel.hpp
+++ b/modules/gui/qt/medialibrary/mlgenremodel.hpp
@@ -28,7 +28,7 @@
 #include "mlbasemodel.hpp"
 #include "mlgenre.hpp"
 
-class MLGenreModel : public MLSlidingWindowModel
+class MLGenreModel : public MLBaseModel
 {
     Q_OBJECT
 
diff --git a/modules/gui/qt/medialibrary/mlrecentsmodel.cpp b/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
index 5b801ccb26..4351b0c0f2 100644
--- a/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
@@ -39,7 +39,7 @@ MLRecentMedia* MLRecentMedia::clone() const {
 
 
 MLRecentsModel::MLRecentsModel( QObject* parent )
-    : MLSlidingWindowModel( parent )
+    : MLBaseModel( parent )
 {
 }
 
diff --git a/modules/gui/qt/medialibrary/mlrecentsmodel.hpp b/modules/gui/qt/medialibrary/mlrecentsmodel.hpp
index 98b716d25b..60190e2035 100644
--- a/modules/gui/qt/medialibrary/mlrecentsmodel.hpp
+++ b/modules/gui/qt/medialibrary/mlrecentsmodel.hpp
@@ -48,7 +48,7 @@ private:
     QDateTime m_lastPlayedDate;
 };
 
-class MLRecentsModel : public MLSlidingWindowModel
+class MLRecentsModel : public MLBaseModel
 {
     Q_OBJECT
     Q_PROPERTY(int numberOfItemsToShow READ getNumberOfItemsToShow WRITE setNumberOfItemsToShow)
diff --git a/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp b/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
index 5b13c27f6c..7835fae2a7 100644
--- a/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
+++ b/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
@@ -37,7 +37,7 @@ enum Role {
 }
 
 MLRecentsVideoModel::MLRecentsVideoModel( QObject* parent )
-    : MLSlidingWindowModel( parent )
+    : MLBaseModel( parent )
 {
 }
 
diff --git a/modules/gui/qt/medialibrary/mlrecentsvideomodel.hpp b/modules/gui/qt/medialibrary/mlrecentsvideomodel.hpp
index 86bb1d4874..9eb63a0bbe 100644
--- a/modules/gui/qt/medialibrary/mlrecentsvideomodel.hpp
+++ b/modules/gui/qt/medialibrary/mlrecentsvideomodel.hpp
@@ -31,7 +31,7 @@
 
 #include <QObject>
 
-class MLRecentsVideoModel : public MLSlidingWindowModel
+class MLRecentsVideoModel : public MLBaseModel
 {
     Q_OBJECT
     Q_PROPERTY(int numberOfItemsToShow READ getNumberOfItemsToShow WRITE setNumberOfItemsToShow)
diff --git a/modules/gui/qt/medialibrary/mlurlmodel.cpp b/modules/gui/qt/medialibrary/mlurlmodel.cpp
index 5ebe66eaac..d21a4b26d1 100644
--- a/modules/gui/qt/medialibrary/mlurlmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlurlmodel.cpp
@@ -21,7 +21,7 @@
 #include <QDateTime>
 
 MLUrlModel::MLUrlModel(QObject *parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
diff --git a/modules/gui/qt/medialibrary/mlurlmodel.hpp b/modules/gui/qt/medialibrary/mlurlmodel.hpp
index b560c71997..859b76feb3 100644
--- a/modules/gui/qt/medialibrary/mlurlmodel.hpp
+++ b/modules/gui/qt/medialibrary/mlurlmodel.hpp
@@ -46,7 +46,7 @@ private:
     QString m_lastPlayedDate;
 };
 
-class MLUrlModel : public MLSlidingWindowModel
+class MLUrlModel : public MLBaseModel
 {
     Q_OBJECT
 
diff --git a/modules/gui/qt/medialibrary/mlvideomodel.cpp b/modules/gui/qt/medialibrary/mlvideomodel.cpp
index d2df1b942c..f2dcfad4b3 100644
--- a/modules/gui/qt/medialibrary/mlvideomodel.cpp
+++ b/modules/gui/qt/medialibrary/mlvideomodel.cpp
@@ -27,7 +27,7 @@ QHash<QByteArray, vlc_ml_sorting_criteria_t> MLVideoModel::M_names_to_criteria =
 };
 
 MLVideoModel::MLVideoModel(QObject* parent)
-    : MLSlidingWindowModel(parent)
+    : MLBaseModel(parent)
 {
 }
 
@@ -129,7 +129,7 @@ void MLVideoModel::onVlcMlEvent(const MLEvent &event)
         default:
             break;
     }
-    MLSlidingWindowModel::onVlcMlEvent( event );
+    MLBaseModel::onVlcMlEvent( event );
 }
 
 void MLVideoModel::thumbnailUpdated(int idx)
diff --git a/modules/gui/qt/medialibrary/mlvideomodel.hpp b/modules/gui/qt/medialibrary/mlvideomodel.hpp
index 23ae8b51e2..fd581f6331 100644
--- a/modules/gui/qt/medialibrary/mlvideomodel.hpp
+++ b/modules/gui/qt/medialibrary/mlvideomodel.hpp
@@ -31,7 +31,7 @@
 
 #include <QObject>
 
-class MLVideoModel : public MLSlidingWindowModel
+class MLVideoModel : public MLBaseModel
 {
     Q_OBJECT
 
-- 
2.29.2



More information about the vlc-devel mailing list