Commit 092fd7c2 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Enable shadow building by default for Qt4 projects

Reviewed-by: dt
parent c1c155f5
......@@ -61,7 +61,7 @@ enum { debug = 0 };
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Target *target) :
BuildConfiguration(target, QLatin1String(QT4_BC_ID)),
m_shadowBuild(false),
m_shadowBuild(true),
m_qtVersionId(-1),
m_toolChainType(-1), // toolChainType() makes sure to return the default toolchainType
m_qmakeBuildConfiguration(0),
......@@ -72,7 +72,7 @@ Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Target *target) :
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Target *target, const QString &id) :
BuildConfiguration(target, id),
m_shadowBuild(false),
m_shadowBuild(true),
m_qtVersionId(-1),
m_toolChainType(-1), // toolChainType() makes sure to return the default toolchainType
m_qmakeBuildConfiguration(0),
......@@ -115,8 +115,8 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
if (!BuildConfiguration::fromMap(map))
return false;
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), false).toBool();
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY)).toString();
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), true).toBool();
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), qt4Target()->defaultBuildDirectory()).toString();
m_qtVersionId = map.value(QLatin1String(QT_VERSION_ID_KEY)).toInt();
m_toolChainType = map.value(QLatin1String(TOOLCHAIN_KEY)).toInt();
m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
......@@ -154,6 +154,10 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
void Qt4BuildConfiguration::ctor()
{
m_buildDirectory = qt4Target()->defaultBuildDirectory();
if (m_buildDirectory == target()->project()->projectDirectory())
m_shadowBuild = false;
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
this, SLOT(qtVersionsChanged(QList<int>)));
......
......@@ -781,6 +781,12 @@ bool Qt4Project::wasEvaluateCanceled()
return m_cancelEvaluate;
}
QString Qt4Project::defaultTopLevelBuildDirectory() const
{
QFileInfo info(file()->fileName());
return projectDirectory() + QChar('/') + info.baseName() + QLatin1String("-build");
}
void Qt4Project::asyncUpdate()
{
if (debug)
......
......@@ -161,6 +161,8 @@ public:
/// \internal
bool wasEvaluateCanceled();
QString defaultTopLevelBuildDirectory() const;
signals:
/// emitted after parse
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
......
......@@ -314,6 +314,29 @@ ToolChain::ToolChainType Qt4Target::preferredToolChainType(const QList<ToolChain
return preferredType;
}
QString Qt4Target::defaultBuildDirectory() const
{
if (id() == QLatin1String(Constants::S60_DEVICE_TARGET_ID)
|| id() == QLatin1String(Constants::S60_EMULATOR_TARGET_ID)
#if defined(Q_OS_WIN)
|| id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)
#endif
)
return project()->projectDirectory();
QString shortName = QLatin1String("unknown");
if (id() == QLatin1String(Constants::DESKTOP_TARGET_ID))
shortName = QLatin1String("desktop");
else if (id() == QLatin1String(Constants::S60_EMULATOR_TARGET_ID))
shortName = QLatin1String("symbian_emulator");
else if (id() == QLatin1String(Constants::S60_DEVICE_TARGET_ID))
shortName = QLatin1String("symbian");
else if (id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID))
shortName = QLatin1String("maemo");
return qt4Project()->defaultTopLevelBuildDirectory() + QChar('/') + shortName;
}
bool Qt4Target::fromMap(const QVariantMap &map)
{
if (!Target::fromMap(map))
......
......@@ -68,6 +68,8 @@ public:
QList<ProjectExplorer::ToolChain::ToolChainType> filterToolChainTypes(const QList<ProjectExplorer::ToolChain::ToolChainType> &candidates) const;
ProjectExplorer::ToolChain::ToolChainType preferredToolChainType(const QList<ProjectExplorer::ToolChain::ToolChainType> &candidates) const;
QString defaultBuildDirectory() const;
signals:
void buildDirectoryInitialized();
/// emitted if the build configuration changed in a way that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment