[vlc-devel] [PATCH 5/9] qt: update row/colCount signatures of models

Pierre Lamot pierre at videolabs.io
Thu Oct 15 11:25:08 CEST 2020


  to match QAbstractItemModel definition
---
 modules/gui/qt/medialibrary/mlbasemodel.hpp       | 2 +-
 modules/gui/qt/medialibrary/mlbookmarkmodel.hpp   | 4 ++--
 modules/gui/qt/network/networkdevicemodel.hpp     | 2 +-
 modules/gui/qt/network/networkmediamodel.hpp      | 2 +-
 modules/gui/qt/network/networksourcesmodel.hpp    | 2 +-
 modules/gui/qt/network/servicesdiscoverymodel.hpp | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp
index 4d7c87b574..5795347c2b 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp
@@ -144,7 +144,7 @@ public:
         m_query_param.i_nbResults = BatchSize;
     }
 
-    int rowCount(const QModelIndex &parent) const override
+    int rowCount(const QModelIndex &parent = {}) const override
     {
         bool countHasChanged = false;
         if (parent.isValid())
diff --git a/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp b/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
index b36f65936d..ff989560b0 100644
--- a/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
@@ -39,8 +39,8 @@ public:
     QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const override;
     bool setData( const QModelIndex& index, const QVariant& value, int role ) override;
     Qt::ItemFlags flags( const QModelIndex & ) const override;
-    int rowCount( const QModelIndex& index ) const override;
-    int columnCount( const QModelIndex& index ) const override;
+    int rowCount( const QModelIndex& index = {} ) const override;
+    int columnCount( const QModelIndex& index = {} ) const override;
     QModelIndex index( int row, int column,
                        const QModelIndex& parent = QModelIndex() ) const override;
     QModelIndex parent( const QModelIndex& ) const override;
diff --git a/modules/gui/qt/network/networkdevicemodel.hpp b/modules/gui/qt/network/networkdevicemodel.hpp
index 1096ec9349..18ab61aa92 100644
--- a/modules/gui/qt/network/networkdevicemodel.hpp
+++ b/modules/gui/qt/network/networkdevicemodel.hpp
@@ -85,7 +85,7 @@ public:
 
     QVariant data(const QModelIndex& index, int role) const override;
     QHash<int, QByteArray> roleNames() const override;
-    int rowCount(const QModelIndex& parent) const override;
+    int rowCount(const QModelIndex& parent = {}) const override;
 
     void setCtx(QmlMainContext* ctx);
     void setSdSource(SDCatType s);
diff --git a/modules/gui/qt/network/networkmediamodel.hpp b/modules/gui/qt/network/networkmediamodel.hpp
index 28b7cbb5ca..776361d0c9 100644
--- a/modules/gui/qt/network/networkmediamodel.hpp
+++ b/modules/gui/qt/network/networkmediamodel.hpp
@@ -116,7 +116,7 @@ public:
 
     QVariant data(const QModelIndex& index, int role) const override;
     QHash<int, QByteArray> roleNames() const override;
-    int rowCount(const QModelIndex& parent) const override;
+    int rowCount(const QModelIndex& parent = {}) const override;
 
     Qt::ItemFlags flags( const QModelIndex& idx ) const override;
     bool setData( const QModelIndex& idx,const QVariant& value, int role ) override;
diff --git a/modules/gui/qt/network/networksourcesmodel.hpp b/modules/gui/qt/network/networksourcesmodel.hpp
index f7b5bf4396..3f0fe9aeb0 100644
--- a/modules/gui/qt/network/networksourcesmodel.hpp
+++ b/modules/gui/qt/network/networksourcesmodel.hpp
@@ -61,7 +61,7 @@ public:
 
     QVariant data(const QModelIndex& index, int role) const override;
     QHash<int, QByteArray> roleNames() const override;
-    int rowCount(const QModelIndex& parent) const override;
+    int rowCount(const QModelIndex& parent = {}) const override;
 
     void setCtx(QmlMainContext* ctx);
 
diff --git a/modules/gui/qt/network/servicesdiscoverymodel.hpp b/modules/gui/qt/network/servicesdiscoverymodel.hpp
index 0eb5221bdc..c196bab3e6 100644
--- a/modules/gui/qt/network/servicesdiscoverymodel.hpp
+++ b/modules/gui/qt/network/servicesdiscoverymodel.hpp
@@ -71,7 +71,7 @@ public:
 
     QVariant data(const QModelIndex& index, int role) const override;
     QHash<int, QByteArray> roleNames() const override;
-    int rowCount(const QModelIndex& parent) const override;
+    int rowCount(const QModelIndex& parent = {}) const override;
 
     void setCtx(QmlMainContext* ctx);
 
-- 
2.25.1



More information about the vlc-devel mailing list