From 604914c15e3629b946872a82f05f5686dc2eae22 Mon Sep 17 00:00:00 2001 From: crowning- Date: Sun, 12 Jul 2015 18:00:48 +0200 Subject: [PATCH] De-selecting all transactions resets computed sum to 0 now. --- src/qt/transactionview.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index bbd37940f7..11b70c4fa3 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -472,14 +472,12 @@ void TransactionView::computeSum() return; QModelIndexList selection = transactionView->selectionModel()->selectedRows(); - if(!selection.isEmpty()){ - foreach (QModelIndex index, selection){ - amount += index.data(TransactionTableModel::AmountRole).toLongLong(); - } - QString strAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, amount, true, BitcoinUnits::separatorAlways)); - if (amount < 0) strAmount = "" + strAmount + ""; - emit trxAmount(strAmount); + foreach (QModelIndex index, selection){ + amount += index.data(TransactionTableModel::AmountRole).toLongLong(); } + QString strAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, amount, true, BitcoinUnits::separatorAlways)); + if (amount < 0) strAmount = "" + strAmount + ""; + emit trxAmount(strAmount); } void TransactionView::openThirdPartyTxUrl(QString url)