Add PreferencesPanel (incomplete)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user