[vlc-commits] qt: mlbasemodel: remove usage of QObject in get()
Alexandre Janniaux
git at videolan.org
Tue Oct 15 15:01:55 CEST 2019
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Oct 9 19:11:24 2019 +0200| [fd9eb5d956542dff5aa925ea4d0781c6bdcdcb10] | committer: Thomas Guillem
qt: mlbasemodel: remove usage of QObject in get()
get() in never used in QML nor in the mlbasemodel class and can be
replaced by a call to index() in the interface.
Non-QObject entries would have lower memory footprint and help clean
the code across different models.
See https://doc.qt.io/qt-5/qabstractitemmodel.html#index.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fd9eb5d956542dff5aa925ea4d0781c6bdcdcb10
---
modules/gui/qt/components/mediacenter/mlbasemodel.hpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/modules/gui/qt/components/mediacenter/mlbasemodel.hpp b/modules/gui/qt/components/mediacenter/mlbasemodel.hpp
index 8bb273075a..7b273e4810 100644
--- a/modules/gui/qt/components/mediacenter/mlbasemodel.hpp
+++ b/modules/gui/qt/components/mediacenter/mlbasemodel.hpp
@@ -44,8 +44,6 @@ public:
Q_INVOKABLE void sortByColumn(QByteArray name, Qt::SortOrder order);
- Q_INVOKABLE virtual QObject *get(unsigned int idx) const = 0;
-
Q_PROPERTY( MLParentId parentId READ parentId WRITE setParentId NOTIFY parentIdChanged RESET unsetParentId )
Q_PROPERTY( MCMediaLib* ml READ ml WRITE setMl )
Q_PROPERTY( unsigned int maxItems MEMBER m_nb_max_items )
@@ -147,7 +145,7 @@ public:
return m_total_count;
}
- QObject* get(unsigned int idx) const override
+ virtual T* get(unsigned int idx) const
{
vlc_mutex_locker lock( &m_item_lock );
T* obj = item( idx );
More information about the vlc-commits
mailing list