From 978627d14e1dc12ad096c6572d3c79f9a9e7e570 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 10 Jul 2020 15:37:35 -0400 Subject: [PATCH] CNodeSelection: Make use of QSignalBlocker --- src/Editor/CNodeSelection.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Editor/CNodeSelection.h b/src/Editor/CNodeSelection.h index 396bb194..099c4d9b 100644 --- a/src/Editor/CNodeSelection.h +++ b/src/Editor/CNodeSelection.h @@ -6,6 +6,7 @@ #include #include #include +#include class CNodeSelection : public QObject { @@ -61,20 +62,23 @@ public: void ClearAndSelectNode(CSceneNode *pNode) { // Block signals for Clear so that Modified only emits once. - blockSignals(true); - Clear(); - blockSignals(false); + { + [[maybe_unused]] const QSignalBlocker blocker{this}; + Clear(); + } + SelectNode(pNode); } void SetSelectedNodes(const QList& rkList) { - blockSignals(true); - Clear(); + { + [[maybe_unused]] const QSignalBlocker blocker{this}; + Clear(); - for (CSceneNode *pNode : rkList) - SelectNode(pNode); - blockSignals(false); + for (CSceneNode* pNode : rkList) + SelectNode(pNode); + } mBoundsDirty = true; emit Modified();