forked from qt-creator/qt-creator
TargetSetupPage: Generalize the page
Generalize the target setup page and move it into projectexplorer Move the qmake specific code into a projectimporter class with a specialization for qmake projects in the qt4projectmanager. This change depends heavily on the BuildConfigurationFactory cleanups done earlier and completes that change in such a way that generic build configuration factories are now in theory possible. The remaining problem is how to select the best factory of several that claim to be able to handle a kit and that is left for the next patch. Change-Id: I47134cb1938c52adebcdc1ddfe8dbf26abbbbeee Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -250,6 +250,7 @@ ProjectExplorer::BuildInfo *QbsBuildConfigurationFactory::createBuildInfo(const
|
||||
info->buildDirectory = buildDirectory;
|
||||
info->kitId = k->id();
|
||||
info->type = type;
|
||||
info->supportsShadowBuild = true;
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -272,6 +273,32 @@ QList<ProjectExplorer::BuildInfo *> QbsBuildConfigurationFactory::availableBuild
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QbsBuildConfigurationFactory::canSetup(const ProjectExplorer::Kit *k, const QString &projectPath) const
|
||||
{
|
||||
return k && Core::MimeDatabase::findByFile(QFileInfo(projectPath))
|
||||
.matchesType(QLatin1String(Constants::MIME_TYPE));
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::BuildInfo *> QbsBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const
|
||||
{
|
||||
QList<ProjectExplorer::BuildInfo *> result;
|
||||
QTC_ASSERT(canSetup(k, projectPath), return result);
|
||||
|
||||
const Utils::FileName buildDirectory = QbsProject::defaultBuildDirectory(projectPath);
|
||||
|
||||
ProjectExplorer::BuildInfo *info = createBuildInfo(k, buildDirectory, ProjectExplorer::BuildConfiguration::Debug);
|
||||
//: The name of the debug build configuration created by default for a qbs project.
|
||||
info->displayName = tr("Debug");
|
||||
result << info;
|
||||
|
||||
info = createBuildInfo(k, buildDirectory, ProjectExplorer::BuildConfiguration::Release);
|
||||
//: The name of the release build configuration created by default for a qbs project.
|
||||
info->displayName = tr("Release");
|
||||
result << info;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ProjectExplorer::BuildConfiguration *QbsBuildConfigurationFactory::create(ProjectExplorer::Target *parent,
|
||||
const ProjectExplorer::BuildInfo *info) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user