Usages of SubmodelProxyModel migrated to ObjectProxyModel

This commit is contained in:
Michał Cieślak 2024-09-02 13:29:55 +02:00 committed by Michał
parent 1e06a9c15a
commit 7c24d19241
2 changed files with 25 additions and 15 deletions

View File

@ -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 {

View File

@ -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) {