diff --git a/src/view/StatsPanel.cpp b/src/view/StatsPanel.cpp index c00f1d1..62c1200 100644 --- a/src/view/StatsPanel.cpp +++ b/src/view/StatsPanel.cpp @@ -342,13 +342,16 @@ void StatsPanel::OnRangeChange(int index) return; } - for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++) + if (index != -1) { - item = _account->item(i); - if (accountIt->hidden || !accountIt->validAt(monthFrom, yearFrom, monthTo, yearTo)) - item->setCheckState (Qt::Unchecked); - else - item->setCheckState (Qt::Checked); + for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++) + { + item = _account->item(i); + if (accountIt->hidden || !accountIt->validAt(monthFrom, yearFrom, monthTo, yearTo)) + item->setCheckState (Qt::Unchecked); + else + item->setCheckState (Qt::Checked); + } } _costRepartitionBanner->Reset(); @@ -357,5 +360,5 @@ void StatsPanel::OnRangeChange(int index) void StatsPanel::OnAccountChange(QListWidgetItem* item) { - OnRangeChange(0); + OnRangeChange(-1); }