Commit 2b6507f2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fix removing cancelled transactions

BUG: 388915
parent 8ee02d0d
...@@ -40,7 +40,7 @@ Kirigami.BasicListItem { ...@@ -40,7 +40,7 @@ Kirigami.BasicListItem {
} }
onTransactionRemoved: { onTransactionRemoved: {
if (trans.status == Transaction.CancelledStatus || !trans.resource) { if (!trans.resource) {
var id = progressModel.applicationAt(trans.resource) var id = progressModel.applicationAt(trans.resource)
if(id>=0) if(id>=0)
progressModel.remove(id) progressModel.remove(id)
...@@ -69,7 +69,10 @@ Kirigami.BasicListItem { ...@@ -69,7 +69,10 @@ Kirigami.BasicListItem {
Component { Component {
id: listenerComp id: listenerComp
TransactionListener { TransactionListener {
onCancelled: progressModel.remove(index) property int index: -1
onCancelled: {
progressModel.remove(index)
}
} }
} }
...@@ -85,7 +88,7 @@ Kirigami.BasicListItem { ...@@ -85,7 +88,7 @@ Kirigami.BasicListItem {
Navigation.openApplication(model.application) Navigation.openApplication(model.application)
} }
} }
readonly property QtObject listener: listenerComp.createObject(del, (model.transaction.resource ? {resource: model.transaction.resource} : {transaction: model.transaction})) readonly property QtObject listener: listenerComp.createObject(del, (model.transaction.resource ? {resource: model.transaction.resource, index: index} : {transaction: model.transaction, index: index}))
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment