From 7c24d1924159e79f5c6a93d490fc713b654fe426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Mon, 2 Sep 2024 13:29:55 +0200 Subject: [PATCH] Usages of SubmodelProxyModel migrated to ObjectProxyModel --- .../panels/SharedAddressesAccountSelector.qml | 15 +++++++---- .../Wallet/popups/swap/SwapModalAdaptor.qml | 25 +++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ui/app/AppLayouts/Communities/panels/SharedAddressesAccountSelector.qml b/ui/app/AppLayouts/Communities/panels/SharedAddressesAccountSelector.qml index bbd638319e..96ae3668d9 100644 --- a/ui/app/AppLayouts/Communities/panels/SharedAddressesAccountSelector.qml +++ b/ui/app/AppLayouts/Communities/panels/SharedAddressesAccountSelector.qml @@ -179,13 +179,15 @@ StatusListView { onClicked: shareAddressCheckbox.toggle() - SubmodelProxyModel { + ObjectProxyModel { id: filteredBalances - sourceModel: root.walletAssetsModel - submodelRoleName: "balances" - delegateModel: SortFilterProxyModel { - sourceModel: submodel + sourceModel: root.walletAssetsModel + + delegate: SortFilterProxyModel { + readonly property SortFilterProxyModel balances: this + + sourceModel: model.balances filters: RegExpFilter { roleName: "account" pattern: listItem.address @@ -193,6 +195,9 @@ StatusListView { caseSensitivity: Qt.CaseInsensitive } } + + expectedRoles: "balances" + exposedRoles: "balances" } SortFilterProxyModel { diff --git a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml index eb306ee6fc..6a63c9ca5f 100644 --- a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml +++ b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml @@ -105,22 +105,27 @@ QObject { // storing txHash to verify against tx completed event property string txHash - readonly property SubmodelProxyModel filteredBalancesModel: SubmodelProxyModel { + readonly property ObjectProxyModel filteredBalancesModel: ObjectProxyModel { sourceModel: root.walletAssetsStore.baseGroupedAccountAssetModel - submodelRoleName: "balances" - delegateModel: SortFilterProxyModel { - sourceModel: joinModel - filters: ValueFilter { - roleName: "chainId" - value: root.swapFormData.selectedNetworkChainId - } - readonly property LeftJoinModel joinModel: LeftJoinModel { - leftModel: submodel + + delegate: SortFilterProxyModel { + readonly property var balances: this + + sourceModel: LeftJoinModel { + leftModel: model.balances rightModel: root.swapStore.flatNetworks joinRole: "chainId" } + + filters: ValueFilter { + roleName: "chainId" + value: root.swapFormData.selectedNetworkChainId + } } + + expectedRoles: "balances" + exposedRoles: "balances" } function processAccountBalance(address) {