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,13 +342,16 @@ void StatsPanel::OnRangeChange(int index)
return; return;
} }
for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++) if (index != -1)
{ {
item = _account->item(i); for(i=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++, i++)
if (accountIt->hidden || !accountIt->validAt(monthFrom, yearFrom, monthTo, yearTo)) {
item->setCheckState (Qt::Unchecked); item = _account->item(i);
else if (accountIt->hidden || !accountIt->validAt(monthFrom, yearFrom, monthTo, yearTo))
item->setCheckState (Qt::Checked); item->setCheckState (Qt::Unchecked);
else
item->setCheckState (Qt::Checked);
}
} }
_costRepartitionBanner->Reset(); _costRepartitionBanner->Reset();
@ -357,5 +360,5 @@ void StatsPanel::OnRangeChange(int index)
void StatsPanel::OnAccountChange(QListWidgetItem* item) void StatsPanel::OnAccountChange(QListWidgetItem* item)
{ {
OnRangeChange(0); OnRangeChange(-1);
} }