created new sequence dialog

This commit is contained in:
itsmattkc
2019-07-21 18:21:40 -07:00
parent 9cfed140b3
commit f8830beac7
37 changed files with 911 additions and 101 deletions
+26
View File
@@ -132,6 +132,32 @@ bool Item::CanHaveChildren() const
return false;
}
bool Item::ChildExistsWithName(const QString &name)
{
return ChildExistsWithNameInternal(name, this);
}
bool Item::ChildExistsWithNameInternal(const QString &name, Item *folder)
{
// Loop through all children
for (int i=0;i<folder->child_count();i++) {
Item* child = folder->child(i);
// If this child has the same name, return true
if (child->name() == name) {
return true;
} else if (child->CanHaveChildren()) {
// If the child has children, run function recursively on this item
if (ChildExistsWithNameInternal(name, child)) {
// If it returns true, we've found a child so we can return now
return true;
}
}
}
return false;
}
void Item::Lock()
{
mutex_.lock();