[vlc-devel] [PATCH 27/29] qml: access grid/list index using viewIndexPropertyName
Abel Tesfaye
abeltesfaye45 at gmail.com
Tue Aug 20 12:42:44 CEST 2019
From: Abel Tesfaye <Abeltesfaye45 at gmail.com>
---
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
--
2.21.0
More information about the vlc-devel
mailing list