From e4ec79b9dfe27c99335b16bbf528fdbe84777681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 11 Mar 2012 17:54:42 +0100 Subject: [PATCH] Fix a bug : in month stats segfault --- src/view/StatsPanel.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/view/StatsPanel.cpp b/src/view/StatsPanel.cpp index 1c0f02a..441a2d1 100644 --- a/src/view/StatsPanel.cpp +++ b/src/view/StatsPanel.cpp @@ -253,20 +253,18 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT _plot->setDataset(0, vec, ""); - vec.clear(); + i=0; for (account = 0, i = 0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); account++, accountIt++, i++) { if (_account->item(account)->checkState() != Qt::Checked) - { - i-- ; continue; - } - for (a=0; aid][a]; - _plot->setDataset(i+1, vec, user->GetAccountName(accountIt->id)); + _plot->setDataset(++i, vec, user->GetAccountName(accountIt->id)); } } else @@ -355,7 +353,6 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT legend->setTitleText(_("Accounts")); legend->setText(0, _("0 line")); { - QVector vec; i = 1; for (a=0, accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); a++, accountIt++)