forked from qt-creator/qt-creator
QMakeStep: Use Utils::Guard
Change-Id: I1fbc830620cb2db42ac71e3c02e1d3993197a727 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -587,10 +587,11 @@ void QMakeStep::qtVersionChanged()
|
||||
void QMakeStep::qmakeBuildConfigChanged()
|
||||
{
|
||||
QmakeBuildConfiguration *bc = qmakeBuildConfiguration();
|
||||
bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild;
|
||||
m_ignoreChange = true;
|
||||
const bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild;
|
||||
{
|
||||
const GuardLocker locker(m_ignoreChanges);
|
||||
m_buildType->setValue(debug ? 0 : 1);
|
||||
m_ignoreChange = false;
|
||||
}
|
||||
updateAbiWidgets();
|
||||
updateEffectiveQMakeCall();
|
||||
}
|
||||
@@ -674,7 +675,7 @@ void QMakeStep::abisChanged()
|
||||
|
||||
void QMakeStep::buildConfigurationSelected()
|
||||
{
|
||||
if (m_ignoreChange)
|
||||
if (m_ignoreChanges.isLocked())
|
||||
return;
|
||||
QmakeBuildConfiguration *bc = qmakeBuildConfiguration();
|
||||
QtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration();
|
||||
@@ -683,9 +684,11 @@ void QMakeStep::buildConfigurationSelected()
|
||||
} else {
|
||||
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
|
||||
}
|
||||
m_ignoreChange = true;
|
||||
|
||||
{
|
||||
const GuardLocker locker(m_ignoreChanges);
|
||||
bc->setQMakeBuildConfiguration(buildConfiguration);
|
||||
m_ignoreChange = false;
|
||||
}
|
||||
|
||||
updateAbiWidgets();
|
||||
updateEffectiveQMakeCall();
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/guard.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -206,7 +207,7 @@ private:
|
||||
QStringList m_selectedAbis;
|
||||
Utils::OutputFormatter *m_outputFormatter = nullptr;
|
||||
|
||||
bool m_ignoreChange = false;
|
||||
Utils::Guard m_ignoreChanges;
|
||||
|
||||
QLabel *abisLabel = nullptr;
|
||||
Utils::SelectionAspect *m_buildType = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user