[vlc-commits] qml: access grid/list index using viewIndexPropertyName

Abel Tesfaye git at videolan.org
Wed Aug 21 15:09:05 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Tue Aug 20 13:14:10 2019 +0300| [b29646e6166e1603ecd6e3998ac502878de51f38] | committer: Jean-Baptiste Kempf

qml: access grid/list index using viewIndexPropertyName

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

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

 modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml     | 2 +-
 modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml | 4 ++--
 modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml      | 4 ++--
 modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
index 2fbc29bc34..9522c90365 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
@@ -56,7 +56,7 @@ Utils.ListItem {
             contextMenu.popup(this)
         }
         delegateModel.updateSelection( modifier, view.currentIndex, index )
-        view.currentIndex = index
+        view[viewIndexPropertyName] = index
         this.forceActiveFocus()
     }
     onItemDoubleClicked: {
diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
index 0b756b5b1a..2c8d6701ca 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
@@ -56,8 +56,8 @@ Utils.GridItem {
             contextMenu.model = model
             contextMenu.popup(menuParent)
         }
-        delegateModel.updateSelection( modifier ,  view.currentIndex, index)
-        view.currentItem.currentIndex = index
+        delegateModel.updateSelection( modifier ,  view[viewIndexPropertyName], index)
+        view[viewIndexPropertyName] = index
         item.forceActiveFocus()
     }
     noActionButtons: true
diff --git a/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml b/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
index 3726b79bba..c2d77bc927 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
@@ -51,8 +51,8 @@ Utils.ListItem {
             contextMenu.model = model
             contextMenu.popup(this)
         }
-        delegateModel.updateSelection( modifier, view.currentIndex, index )
-        view.currentIndex = index
+        delegateModel.updateSelection( modifier, view[viewIndexPropertyName], index )
+        view[viewIndexPropertyName] = index
         this.forceActiveFocus()
     }
     onItemDoubleClicked: {
diff --git a/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml b/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
index 6c19bda892..2a03745833 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
@@ -41,8 +41,8 @@ Utils.GridItem {
             contextMenu.model = model
             contextMenu.popup(menuParent)
         }
-        delegateModel.updateSelection( modifier , view.currentIndex, index)
-        view.currentItem.currentIndex = index
+        delegateModel.updateSelection( modifier , view[viewIndexPropertyName], index)
+        view[viewIndexPropertyName] = index
         item.forceActiveFocus()
     }
     showContextButton: true



More information about the vlc-commits mailing list