forked from qt-creator/qt-creator
Qt4Project: Take control of target creation
Do the same thing as the targetsetupwidget would have done by default. The Qt4BuildconfigurationFactory is only responsible for bcs that the user creates on the projects page. Task-number: QTCREATORBUG-8069 Change-Id: I708aace5055fcf2ad69d305347274d2e7d6dfbb6 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -397,6 +397,32 @@ void Qt4Project::updateFileList()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Qt4Project::setupTarget(ProjectExplorer::Target *t)
|
||||||
|
{
|
||||||
|
QList<BuildConfigurationInfo> infoList
|
||||||
|
= Qt4BuildConfigurationFactory::availableBuildConfigurations(t->kit(), m_fileInfo->fileName());
|
||||||
|
setupTarget(t, infoList);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4Project::setupTarget(ProjectExplorer::Target *t, const QList<BuildConfigurationInfo> &infoList)
|
||||||
|
{
|
||||||
|
// Build Configurations:
|
||||||
|
foreach (const BuildConfigurationInfo &info, infoList) {
|
||||||
|
QString name = info.buildConfig & QtSupport::BaseQtVersion::DebugBuild
|
||||||
|
? tr("Debug") : tr("Release");
|
||||||
|
Qt4BuildConfiguration *bc
|
||||||
|
= Qt4BuildConfiguration::setup(t, name, name,
|
||||||
|
info.buildConfig, info.additionalArguments,
|
||||||
|
info.directory, info.importing);
|
||||||
|
t->addBuildConfiguration(bc);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deploy Configurations:
|
||||||
|
t->updateDefaultDeployConfigurations();
|
||||||
|
// Do not create Run Configurations: Those will be generated later anyway.
|
||||||
|
}
|
||||||
|
|
||||||
bool Qt4Project::fromMap(const QVariantMap &map)
|
bool Qt4Project::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
if (!Project::fromMap(map))
|
if (!Project::fromMap(map))
|
||||||
@@ -1422,22 +1448,7 @@ Target *Qt4Project::createTarget(Kit *k, const QList<BuildConfigurationInfo> &in
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Target *t = new Target(this, k);
|
Target *t = new Target(this, k);
|
||||||
|
setupTarget(t, infoList);
|
||||||
// Build Configurations:
|
|
||||||
foreach (const BuildConfigurationInfo &info, infoList) {
|
|
||||||
QString name = info.buildConfig & QtSupport::BaseQtVersion::DebugBuild
|
|
||||||
? tr("Debug") : tr("Release");
|
|
||||||
Qt4BuildConfiguration *bc
|
|
||||||
= Qt4BuildConfiguration::setup(t, name, name,
|
|
||||||
info.buildConfig, info.additionalArguments,
|
|
||||||
info.directory, info.importing);
|
|
||||||
t->addBuildConfiguration(bc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deploy Configurations:
|
|
||||||
t->updateDefaultDeployConfigurations();
|
|
||||||
// Do not create Run Configurations: Those will be generated later anyway.
|
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -155,6 +155,8 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
|
bool setupTarget(ProjectExplorer::Target *t);
|
||||||
|
void setupTarget(ProjectExplorer::Target *t, const QList<BuildConfigurationInfo> &infoList);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void asyncUpdate();
|
void asyncUpdate();
|
||||||
|
Reference in New Issue
Block a user