From e9a0d06867f973f5979190c8c97dd3d319e0e1f9 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 22 Jul 2022 10:35:11 +0200 Subject: [PATCH] DebuggerKitAspectWidget: Use Utils::Guard Change-Id: I42407c110971f97599295f5d2be7652e512d3c72 Reviewed-by: hjk --- src/plugins/debugger/debuggerkitinformation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 87821effb44..1838b2da36c 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -96,7 +97,7 @@ private: void refresh() override { - m_ignoreChanges = true; + const GuardLocker locker(m_ignoreChanges); m_comboBox->clear(); m_comboBox->addItem(Tr::tr("None"), QString()); for (const DebuggerItem &item : DebuggerItemManager::debuggers()) @@ -104,13 +105,12 @@ private: const DebuggerItem *item = DebuggerKitAspect::debugger(m_kit); updateComboBox(item ? item->id() : QVariant()); - m_ignoreChanges = false; } void currentDebuggerChanged(int idx) { Q_UNUSED(idx) - if (m_ignoreChanges) + if (m_ignoreChanges.isLocked()) return; int currentIndex = m_comboBox->currentIndex(); @@ -131,7 +131,7 @@ private: m_comboBox->setCurrentIndex(0); } - bool m_ignoreChanges = false; + Guard m_ignoreChanges; QComboBox *m_comboBox; QWidget *m_manageButton; };