From c7f0cc6130020e918c2565611a61917564d6190c Mon Sep 17 00:00:00 2001 From: Benjamin Arnaud Date: Thu, 16 Mar 2023 10:39:25 +0100 Subject: [PATCH] BrowseDisplay: Refactor with 'stackViewItem' alias --- modules/gui/qt/network/qml/BrowseDisplay.qml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/gui/qt/network/qml/BrowseDisplay.qml b/modules/gui/qt/network/qml/BrowseDisplay.qml index 5e17885d83..3dd5cf9a46 100644 --- a/modules/gui/qt/network/qml/BrowseDisplay.qml +++ b/modules/gui/qt/network/qml/BrowseDisplay.qml @@ -75,8 +75,7 @@ Widgets.PageLoader { // Connections Connections { - target: (stackView.currentItem instanceof BrowseHomeDisplay) ? stackView.currentItem - : null + target: (stackViewItem instanceof BrowseHomeDisplay) ? stackViewItem : null onSeeAll: { if (sd_source === -1) @@ -84,17 +83,17 @@ Widgets.PageLoader { else History.push(["mc", "network", "device", { title: title, sd_source: sd_source }]) - stackView.currentItem.setCurrentItemFocus(reason) + stackViewItem.setCurrentItemFocus(reason) } } Connections { - target: stackView.currentItem + target: stackViewItem onBrowse: { History.push(["mc", "network", "browse", { tree: tree }]) - stackView.currentItem.setCurrentItemFocus(reason) + stackViewItem.setCurrentItemFocus(reason) } } @@ -158,7 +157,7 @@ Widgets.PageLoader { Navigation.cancelAction: function() { History.previous() - stackView.currentItem.setCurrentItemFocus(Qt.BacktabFocusReason) + stackViewItem.setCurrentItemFocus(Qt.BacktabFocusReason) } } } @@ -167,18 +166,18 @@ Widgets.PageLoader { id: componentBar NetworkAddressbar { - path: view.name === "browse" ? root.stackView.currentItem.providerModel.path : [] + path: view.name === "browse" ? root.stackViewItem.providerModel.path : [] onHomeButtonClicked: { History.push(["mc", "network", "home"]) - stackView.currentItem.setCurrentItemFocus(reason) + stackViewItem.setCurrentItemFocus(reason) } onBrowse: { History.push(["mc", "network", "browse", { "tree": tree }]) - stackView.currentItem.setCurrentItemFocus(reason) + stackViewItem.setCurrentItemFocus(reason) } } }