From 75691e8bea26ffa616bfcf0d2c744e2af430cc0c Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Fri, 21 Jan 2022 10:08:06 -0800 Subject: [PATCH] group: when adding input passthrough, return unique ID --- app/node/group/group.cpp | 6 ++++-- app/node/group/group.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/node/group/group.cpp b/app/node/group/group.cpp index 1f7531fa4..4a6e7702f 100644 --- a/app/node/group/group.cpp +++ b/app/node/group/group.cpp @@ -58,14 +58,14 @@ void NodeGroup::Retranslate() } } -void NodeGroup::AddInputPassthrough(const NodeInput &input) +QString NodeGroup::AddInputPassthrough(const NodeInput &input) { Q_ASSERT(ContextContainsNode(input.node())); for (auto it=input_passthroughs_.cbegin(); it!=input_passthroughs_.cend(); it++) { if (it.value() == input) { // Already passing this input through - return; + return it.key(); } } @@ -77,6 +77,8 @@ void NodeGroup::AddInputPassthrough(const NodeInput &input) input_passthroughs_.insert(id, input); emit InputPassthroughAdded(this, input); + + return id; } void NodeGroup::RemoveInputPassthrough(const NodeInput &input) diff --git a/app/node/group/group.h b/app/node/group/group.h index 4a56b39db..cccfe36b7 100644 --- a/app/node/group/group.h +++ b/app/node/group/group.h @@ -41,7 +41,7 @@ public: virtual void Retranslate() override; - void AddInputPassthrough(const NodeInput &input); + QString AddInputPassthrough(const NodeInput &input); void RemoveInputPassthrough(const NodeInput &input);