folder: fixed bug in "ChildExistsWithName"

Fixes bug where sequence auto-naming would fail.
This commit is contained in:
itsmattkc
2021-03-25 16:54:01 +11:00
parent 62505456ef
commit b137b8e0ac
+4 -4
View File
@@ -50,13 +50,13 @@ void Folder::Retranslate()
bool ChildExistsWithNameInternal(const Folder* n, const QString& s) bool ChildExistsWithNameInternal(const Folder* n, const QString& s)
{ {
foreach (const Node::OutputConnection& c, n->output_connections()) { for (int i=0; i<n->item_child_count(); i++) {
Node* connected = c.second.node(); Node* child = n->item_child(i);
if (connected->GetLabel() == s) { if (child->GetLabel() == s) {
return true; return true;
} else { } else {
Folder* subfolder = dynamic_cast<Folder*>(connected); Folder* subfolder = dynamic_cast<Folder*>(child);
if (subfolder && ChildExistsWithNameInternal(subfolder, s)) { if (subfolder && ChildExistsWithNameInternal(subfolder, s)) {
return true; return true;