Commit 7e0bf642 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Follow through on some Transaction warnings, to make them more useful

parent 09654c6a
......@@ -40,8 +40,8 @@ Transaction::~Transaction()
{
if(status()<DoneStatus || TransactionModel::global()->contains(this)) {
qWarning() << "destroying Transaction before it's over" << this;
TransactionModel::global()->removeTransaction(this);
}
TransactionModel::global()->removeTransaction(this);
}
AbstractResource *Transaction::resource() const
......
......@@ -171,9 +171,10 @@ void TransactionModel::addTransaction(Transaction *trans)
void TransactionModel::removeTransaction(Transaction *trans)
{
Q_ASSERT(trans);
trans->deleteLater();
int r = m_transactions.indexOf(trans);
if (r<0) {
qWarning() << "transaction not part of the model already" << trans;
qWarning() << "transaction not part of the model" << trans;
return;
}
......@@ -186,7 +187,6 @@ void TransactionModel::removeTransaction(Transaction *trans)
emit transactionRemoved(trans);
if (m_transactions.isEmpty())
emit lastTransactionFinished();
trans->deleteLater();
}
void TransactionModel::transactionChanged(int role)
......
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