vlc | branch: master | Fatih Uzunoglu <[email protected]> | Fri Jan  8 
00:36:52 2021 +0300| [40c19d93eee56d5fadfad04909d15895e8eea69f] | committer: 
Pierre Lamot

qt: accept -1 index in isSelected() in SelectableListModel

this allows to remove explicit '-1' checks in the frontend

Signed-off-by: Pierre Lamot <[email protected]>

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

 modules/gui/qt/util/selectable_list_model.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/util/selectable_list_model.cpp 
b/modules/gui/qt/util/selectable_list_model.cpp
index 3371893e9a..232ddfda14 100644
--- a/modules/gui/qt/util/selectable_list_model.cpp
+++ b/modules/gui/qt/util/selectable_list_model.cpp
@@ -37,7 +37,10 @@ void SelectableListModel::setSelected(int row, bool selected)
 
 bool SelectableListModel::isSelected(int row) const
 {
-    assert( row >= 0 && row < rowCount() );
+    assert( row >= -1 && row < rowCount() );
+
+    if ( row == -1 )
+        return false;
 
     return isRowSelected(row);
 }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to