Fix a bug : cannot select/deselect accounts in StatsPanel

This commit is contained in:
Grégory Soutadé 2017-10-29 18:21:53 +01:00 committed by Grégory Soutadé
parent 2e70586e97
commit ada23a4092

View File

@ -342,6 +342,8 @@ void StatsPanel::OnRangeChange(int index)
return; return;
} }
if (index != -1)
{
for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++) for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++)
{ {
item = _account->item(i); item = _account->item(i);
@ -350,6 +352,7 @@ void StatsPanel::OnRangeChange(int index)
else else
item->setCheckState (Qt::Checked); item->setCheckState (Qt::Checked);
} }
}
_costRepartitionBanner->Reset(); _costRepartitionBanner->Reset();
UpdateStats(monthFrom, yearFrom, monthTo, yearTo); UpdateStats(monthFrom, yearFrom, monthTo, yearTo);
@ -357,5 +360,5 @@ void StatsPanel::OnRangeChange(int index)
void StatsPanel::OnAccountChange(QListWidgetItem* item) void StatsPanel::OnAccountChange(QListWidgetItem* item)
{ {
OnRangeChange(0); OnRangeChange(-1);
} }