diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 7797cecc..a5a5a1f3 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -184,7 +184,7 @@ DrawerType2 { return } - const nativeConfigStringItem = headerItem.children.find(c => c.objectName === "nativeConfigString"); + const nativeConfigStringItem = configListView.findChildWithObjectName(headerItem.children, "nativeConfigString"); if (!nativeConfigStringItem) { console.error("Failed to copy: nativeConfigString item not found in ListView") return @@ -206,7 +206,7 @@ DrawerType2 { return } - const configTextItem = headerItem.children.find(c => c.objectName === "configText"); + const configTextItem = configListView.findChildWithObjectName(headerItem.children, "configText"); if (!configTextItem) { console.error("Failed to copy: configText item not found in ListView") return diff --git a/client/ui/qml/Controls2/ListViewType.qml b/client/ui/qml/Controls2/ListViewType.qml index e15f4a39..8d067537 100644 --- a/client/ui/qml/Controls2/ListViewType.qml +++ b/client/ui/qml/Controls2/ListViewType.qml @@ -10,4 +10,12 @@ ListView { clip: true reuseItems: true + + function findChildWithObjectName(items, name) { + for (var i = 0; i < items.length; ++i) { + if (items[i].objectName === name) + return items[i]; + } + return null; + } } diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index fd5a665c..ecd104a2 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -199,7 +199,7 @@ PageType { return } - const cloakingCheckBoxItem = headerItem.children.find(c => c.objectName === "cloakingCheckBox"); + const cloakingCheckBoxItem = listView.findChildWithObjectName(headerItem.children, "cloakingCheckBox"); if (!cloakingCheckBoxItem) { console.error("cloakingCheckBox not found") return diff --git a/client/ui/qml/Pages2/PageShareFullAccess.qml b/client/ui/qml/Pages2/PageShareFullAccess.qml index 2513d061..1912dd54 100644 --- a/client/ui/qml/Pages2/PageShareFullAccess.qml +++ b/client/ui/qml/Pages2/PageShareFullAccess.qml @@ -160,7 +160,7 @@ PageType { return } - const serverSelectorItem = headerItem.children.find(c => c.objectName === "serverSelector"); + const serverSelectorItem = listView.findChildWithObjectName(headerItem.children, "serverSelector"); if (!serverSelectorItem) { PageController.showBusyIndicator(false) console.error("Failed to share: serverSelector item not found in ListView")