Add PreferencesPanel (incomplete)

This commit is contained in:
2011-12-18 13:51:04 +01:00
parent 9b0222323a
commit 649bdb32c7
12 changed files with 1217 additions and 19 deletions

View File

@@ -281,9 +281,8 @@ bool User::Group(std::vector<Operation>* ops, const Operation& op)
if (it->id == op.parent)
{
it2 = std::find(it->childs.begin(), it->childs.end(), op.id);
// Already into childs
if (it2 != it->childs.end()) return true;
it->childs.push_back(op.id);
if (it2 == it->childs.end())
it->childs.push_back(op.id);
return true;
}
}
@@ -293,10 +292,14 @@ bool User::Group(std::vector<Operation>* ops, const Operation& op)
void User::Group(const Operation& op)
{
std::vector<Operation>::iterator it;
if (!Group(&(*_operations[op.year])[op.month], op)
&& _db->LoadOperation(this, op.parent))
{
(*_operations[op.year])[op.month][(*_operations[op.year])[op.month].size()-1].childs.push_back(op.id);
it = std::find ((*_operations[op.year])[op.month].begin(), (*_operations[op.year])[op.month].end(), op.parent);
if (it != (*_operations[op.year])[op.month].end())
it->childs.push_back(op.id);
}
}