Account/Category modification are immediatly reported in other panels

This commit is contained in:
Grégory Soutadé 2012-04-27 21:37:51 +02:00
parent ac7deb340c
commit 2e468c14b4
2 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,14 @@ struct Category
QString font;
bool fix_cost;
bool operator() (const Category& cat1, const Category& cat2) const
{
if (cat1.fix_cost) return true;
if (cat2.fix_cost) return false;
return cat1.name < cat2.name;
}
bool operator == (int catId)
{
return id == catId;

View File

@ -45,6 +45,9 @@ void User::InvalidateOperations()
}
_operations.clear();
std::sort(_accounts.begin(), _accounts.end(), Account());
std::sort(_categories.begin(), _categories.end(), Category());
}
Category User::GetCategory(int catId)