Make Qt4ProjectManager::QMakeStep mulithreading safe

Change-Id: I41abb5e7138351e61c6c9dfc87121837edb21fbe
Reviewed-on: http://codereview.qt-project.org/5452
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Daniel Teske
2011-09-22 13:36:46 +02:00
parent b96d7b9bd8
commit 3a449bdab6

View File

@@ -80,6 +80,7 @@ const char * const QMAKE_QMLDEBUGLIB_KEY("QtProjectManager.QMakeBuildStep.LinkQm
QMakeStep::QMakeStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, QLatin1String(QMAKE_BS_ID)),
m_forced(false),
m_needToRunQMake(false),
m_linkQmlDebuggingLibrary(DebugLink)
{
ctor();
@@ -227,8 +228,6 @@ bool QMakeStep::init()
QString program = qtVersion->qmakeCommand();
// Check whether we need to run qmake
m_needToRunQMake = true;
QString makefile = workingDirectory;
if (qt4bc->subNodeBuild()) {
@@ -244,17 +243,18 @@ bool QMakeStep::init()
makefile.append("/Makefile");
}
// Check whether we need to run qmake
bool makefileOutDated = true;
if (QFileInfo(makefile).exists()) {
QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
if (qtVersion->qmakeCommand() == qmakePath) {
m_needToRunQMake = !qt4bc->compareToImportFrom(makefile);
makefileOutDated = !qt4bc->compareToImportFrom(makefile);
}
}
if (m_forced) {
m_forced = false;
if (m_forced || makefileOutDated)
m_needToRunQMake = true;
}
m_forced = false;
setEnabled(m_needToRunQMake);
ProcessParameters *pp = processParameters();
@@ -309,6 +309,7 @@ void QMakeStep::run(QFutureInterface<bool> &fi)
return;
}
m_needToRunQMake = false;
AbstractProcessStep::run(fi);
}
@@ -334,7 +335,7 @@ bool QMakeStep::immutable() const
void QMakeStep::processStartupFailed()
{
m_forced = true;
m_needToRunQMake = true;
AbstractProcessStep::processStartupFailed();
}
@@ -342,7 +343,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
{
bool result = AbstractProcessStep::processSucceeded(exitCode, status);
if (!result)
m_forced = true;
m_needToRunQMake = true;
qt4BuildConfiguration()->emitBuildDirectoryInitialized();
return result;
}