forked from qt-creator/qt-creator
Make Open Project wizard skippable
Task-Nr: QTCREATORBUG-6063 Change-Id: Ieace3e9e68b4e0342c35ac7c279f4b0b61076419 Reviewed-by: Eike Ziller <eike.ziller@nokia.com> Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -39,7 +39,6 @@
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4projectconfigwidget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "projectloadwizard.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "findqt4profiles.h"
|
||||
|
||||
@@ -64,6 +63,8 @@
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/profilereader.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtconcurrent/QtConcurrentTools>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
@@ -379,20 +380,6 @@ bool Qt4Project::fromMap(const QVariantMap &map)
|
||||
}
|
||||
}
|
||||
|
||||
// Add buildconfigurations so we can parse the pro-files.
|
||||
if (targets().isEmpty()) {
|
||||
ProjectLoadWizard wizard(this);
|
||||
wizard.exec();
|
||||
}
|
||||
|
||||
if (targets().isEmpty()) {
|
||||
qWarning() << "Unable to create targets!";
|
||||
return false;
|
||||
}
|
||||
|
||||
Q_ASSERT(activeTarget());
|
||||
Q_ASSERT(activeTarget()->activeBuildConfiguration());
|
||||
|
||||
m_manager->registerProject(this);
|
||||
|
||||
m_rootProjectNode = new Qt4ProFileNode(this, m_fileInfo->fileName(), this);
|
||||
@@ -480,7 +467,7 @@ void Qt4Project::updateCodeModels()
|
||||
if (debug)
|
||||
qDebug()<<"Qt4Project::updateCodeModel()";
|
||||
|
||||
if (!activeTarget() || !activeTarget()->activeBuildConfiguration())
|
||||
if (activeTarget() && !activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
updateCppCodeModel();
|
||||
@@ -489,7 +476,15 @@ void Qt4Project::updateCodeModels()
|
||||
|
||||
void Qt4Project::updateCppCodeModel()
|
||||
{
|
||||
Qt4BuildConfiguration *activeBC = activeTarget()->activeQt4BuildConfiguration();
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
ToolChain *tc = 0;
|
||||
if (Qt4BaseTarget *target = activeTarget()) {
|
||||
qtVersion = target->activeQt4BuildConfiguration()->qtVersion();
|
||||
tc = target->activeQt4BuildConfiguration()->toolChain();
|
||||
} else {
|
||||
qtVersion = qt4ProjectManager()->unconfiguredSettings().version;
|
||||
tc = qt4ProjectManager()->unconfiguredSettings().toolchain;
|
||||
}
|
||||
|
||||
CPlusPlus::CppModelManagerInterface *modelmanager =
|
||||
CPlusPlus::CppModelManagerInterface::instance();
|
||||
@@ -503,18 +498,17 @@ void Qt4Project::updateCppCodeModel()
|
||||
QByteArray predefinedMacros;
|
||||
|
||||
QString qtFrameworkPath;
|
||||
if (activeBC->qtVersion())
|
||||
qtFrameworkPath = activeBC->qtVersion()->frameworkInstallPath();
|
||||
if (qtVersion)
|
||||
qtFrameworkPath = qtVersion->frameworkInstallPath();
|
||||
if (!qtFrameworkPath.isEmpty())
|
||||
predefinedFrameworkPaths.append(qtFrameworkPath);
|
||||
|
||||
ToolChain *tc = activeBC->toolChain();
|
||||
if (tc) {
|
||||
predefinedMacros = tc->predefinedMacros();
|
||||
|
||||
QList<HeaderPath> headers = tc->systemHeaderPaths();
|
||||
if (activeBC->qtVersion())
|
||||
headers.append(activeBC->qtVersion()->systemHeaderPathes());
|
||||
if (qtVersion)
|
||||
headers.append(qtVersion->systemHeaderPathes());
|
||||
foreach (const HeaderPath &headerPath, headers) {
|
||||
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
||||
predefinedFrameworkPaths.append(headerPath.path());
|
||||
@@ -562,8 +556,8 @@ void Qt4Project::updateCppCodeModel()
|
||||
// Add mkspec directory
|
||||
if (rootQt4ProjectNode())
|
||||
allIncludePaths.append(rootQt4ProjectNode()->resolvedMkspecPath());
|
||||
else if (activeBC->qtVersion())
|
||||
allIncludePaths.append(activeBC->qtVersion()->mkspecPath().toString());
|
||||
else if (qtVersion)
|
||||
allIncludePaths.append(qtVersion->mkspecPath().toString());
|
||||
|
||||
allIncludePaths.append(predefinedIncludePaths);
|
||||
|
||||
@@ -628,9 +622,18 @@ void Qt4Project::updateQmlJSCodeModel()
|
||||
|
||||
bool preferDebugDump = false;
|
||||
projectInfo.tryQmlDump = false;
|
||||
if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
|
||||
preferDebugDump = activeTarget()->activeQt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
|
||||
QtSupport::BaseQtVersion *qtVersion = activeTarget()->activeQt4BuildConfiguration()->qtVersion();
|
||||
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
if (Qt4BaseTarget *t = activeTarget()) {
|
||||
if (Qt4BuildConfiguration *bc = t->activeQt4BuildConfiguration()) {
|
||||
qtVersion = bc->qtVersion();
|
||||
preferDebugDump = bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
|
||||
}
|
||||
} else {
|
||||
qtVersion = qt4ProjectManager()->unconfiguredSettings().version;
|
||||
preferDebugDump = qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild;
|
||||
}
|
||||
if (qtVersion) {
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
projectInfo.tryQmlDump = qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|
||||
|| qtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT);
|
||||
@@ -643,9 +646,15 @@ void Qt4Project::updateQmlJSCodeModel()
|
||||
projectInfo.importPaths.removeDuplicates();
|
||||
|
||||
if (projectInfo.tryQmlDump) {
|
||||
const Qt4BuildConfiguration *bc = activeTarget()->activeQt4BuildConfiguration();
|
||||
if (bc) {
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, bc->qtVersion(), bc->toolChain(),
|
||||
if (Qt4BaseTarget *target = activeTarget()) {
|
||||
const Qt4BuildConfiguration *bc = target->activeQt4BuildConfiguration();
|
||||
if (bc)
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, bc->qtVersion(), bc->toolChain(),
|
||||
preferDebugDump, &projectInfo.qmlDumpPath,
|
||||
&projectInfo.qmlDumpEnvironment);
|
||||
} else {
|
||||
UnConfiguredSettings us = qt4ProjectManager()->unconfiguredSettings();
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, us.version, us.toolchain,
|
||||
preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
|
||||
}
|
||||
} else {
|
||||
@@ -668,7 +677,9 @@ void Qt4Project::update()
|
||||
if (debug)
|
||||
qDebug()<<"State is now Base";
|
||||
m_asyncUpdateState = Base;
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
Qt4BaseTarget *target = activeTarget();
|
||||
if (target)
|
||||
target->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
emit proParsingDone();
|
||||
}
|
||||
|
||||
@@ -690,7 +701,8 @@ void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
|
||||
return;
|
||||
}
|
||||
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
if (activeTarget() && activeTarget()->activeQt4BuildConfiguration())
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
|
||||
if (m_asyncUpdateState == AsyncFullUpdatePending) {
|
||||
// Just postpone
|
||||
@@ -760,7 +772,8 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
qDebug()<<" update in progress, canceling and setting state to full update pending";
|
||||
m_cancelEvaluate = true;
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
if (activeTarget() && activeTarget()->activeQt4BuildConfiguration())
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->setParseInProgressRecursive(true);
|
||||
return;
|
||||
}
|
||||
@@ -768,7 +781,8 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
if (debug)
|
||||
qDebug()<<" starting timer for full update, setting state to full update pending";
|
||||
m_partialEvaluate.clear();
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
if (activeTarget() && activeTarget()->activeQt4BuildConfiguration())
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->setParseInProgressRecursive(true);
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
m_asyncUpdateTimer.start();
|
||||
@@ -816,7 +830,8 @@ void Qt4Project::decrementPendingEvaluateFutures()
|
||||
} else if (m_asyncUpdateState != ShuttingDown){
|
||||
// After being done, we need to call:
|
||||
m_asyncUpdateState = Base;
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
if (activeTarget() && activeTarget()->activeQt4BuildConfiguration())
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
foreach (Target *t, targets())
|
||||
static_cast<Qt4BaseTarget *>(t)->createApplicationProFiles(true);
|
||||
updateFileList();
|
||||
@@ -952,32 +967,50 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
||||
m_proFileOption = new ProFileOption;
|
||||
m_proFileOptionRefCnt = 0;
|
||||
|
||||
if (!bc && activeTarget())
|
||||
bc = activeTarget()->activeQt4BuildConfiguration();
|
||||
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
ProjectExplorer::ToolChain *tc = 0;
|
||||
Utils::Environment env = Utils::Environment::systemEnvironment();
|
||||
QStringList qmakeArgs;
|
||||
if (bc) {
|
||||
QtSupport::BaseQtVersion *version = bc->qtVersion();
|
||||
if (version && version->isValid()) {
|
||||
m_proFileOption->properties = version->versionInfo();
|
||||
if (bc->toolChain())
|
||||
m_proFileOption->sysroot = bc->qtVersion()->systemRoot();
|
||||
}
|
||||
|
||||
Utils::Environment env = bc->environment();
|
||||
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||
for (; eit != eend; ++eit)
|
||||
m_proFileOption->environment.insert(env.key(eit), env.value(eit));
|
||||
|
||||
QStringList args;
|
||||
qtVersion = bc->qtVersion();
|
||||
env = bc->environment();
|
||||
tc = bc->toolChain();
|
||||
if (QMakeStep *qs = bc->qmakeStep()) {
|
||||
args = qs->parserArguments();
|
||||
qmakeArgs = qs->parserArguments();
|
||||
m_proFileOption->qmakespec = qs->mkspec().toString();
|
||||
} else {
|
||||
args = bc->configCommandLineArguments();
|
||||
qmakeArgs = bc->configCommandLineArguments();
|
||||
}
|
||||
m_proFileOption->setCommandLineArguments(args);
|
||||
} else if (Qt4BaseTarget *target = activeTarget()) {
|
||||
if (Qt4BuildConfiguration *bc = target->activeQt4BuildConfiguration()) {
|
||||
qtVersion = bc->qtVersion();
|
||||
env = bc->environment();
|
||||
tc = bc->toolChain();
|
||||
if (QMakeStep *qs = bc->qmakeStep()) {
|
||||
qmakeArgs = qs->parserArguments();
|
||||
m_proFileOption->qmakespec = qs->mkspec().toString();
|
||||
} else {
|
||||
qmakeArgs = bc->configCommandLineArguments();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
UnConfiguredSettings ucs = qt4ProjectManager()->unconfiguredSettings();
|
||||
qtVersion = ucs.version;
|
||||
tc = ucs.toolchain;
|
||||
}
|
||||
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
m_proFileOption->properties = qtVersion->versionInfo();
|
||||
if (tc)
|
||||
m_proFileOption->sysroot = qtVersion->systemRoot();
|
||||
}
|
||||
|
||||
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||
for (; eit != eend; ++eit)
|
||||
m_proFileOption->environment.insert(env.key(eit), env.value(eit));
|
||||
|
||||
m_proFileOption->setCommandLineArguments(qmakeArgs);
|
||||
|
||||
QtSupport::ProFileCacheManager::instance()->incRefCount();
|
||||
}
|
||||
++m_proFileOptionRefCnt;
|
||||
@@ -1337,6 +1370,11 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
||||
}
|
||||
}
|
||||
|
||||
bool Qt4Project::needsConfiguration() const
|
||||
{
|
||||
return targets().isEmpty();
|
||||
}
|
||||
|
||||
/*!
|
||||
Handle special case were a subproject of the qt directory is opened, and
|
||||
qt was configured to be built as a shadow build -> also build in the sub-
|
||||
|
||||
Reference in New Issue
Block a user