diff --git a/kmymoney/views/ledgerview.cpp b/kmymoney/views/ledgerview.cpp --- a/kmymoney/views/ledgerview.cpp +++ b/kmymoney/views/ledgerview.cpp @@ -71,26 +71,26 @@ void recalculateBalances() { - QModelIndex start = filterModel->index(0, 0); - QModelIndexList indexes = filterModel->match(start, (int)eLedgerModel::Role::AccountId, account.id(), -1); + const auto start = filterModel->index(0, 0); + const auto indexes = filterModel->match(start, (int)eLedgerModel::Role::AccountId, account.id(), -1); MyMoneyMoney balance; - Q_FOREACH(QModelIndex index, indexes) { + for(const auto &index : indexes) { if(showValuesInverted) { balance -= filterModel->data(index, (int)eLedgerModel::Role::SplitShares).value(); } else { balance += filterModel->data(index, (int)eLedgerModel::Role::SplitShares).value(); } - QString txt = balance.formatMoney(account.fraction()); - QModelIndex dispIndex = filterModel->index(index.row(), (int)eLedgerModel::Column::Balance); + const auto txt = balance.formatMoney(account.fraction()); + const auto dispIndex = filterModel->index(index.row(), (int)eLedgerModel::Column::Balance); filterModel->setData(dispIndex, txt, Qt::DisplayRole); } filterModel->invalidate(); balanceCalculationPending = false; } LedgerDelegate* delegate; - LedgerProxyModel* filterModel; + LedgerProxyModel* filterModel; MyMoneyAccount account; int adjustableColumn; bool adjustingColumn; @@ -442,3 +442,5 @@ SplitView::~SplitView() { } + +// kate: space-indent on; indent-width 2; remove-trailing-space on; remove-trailing-space-save on;