diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2013-08-13 10:52:57 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2013-09-27 14:34:43 +0200 |
commit | 921f86dfa748468a8d7e6bb7787aed8fb8b53da9 (patch) | |
tree | 717cc0cd5052ff7a75f27f11e5abb9143fd35447 /src/plugins/autotoolsprojectmanager | |
parent | 95828d4691a993e552843738114507a5a30efe2a (diff) | |
download | qt-creator-921f86dfa748468a8d7e6bb7787aed8fb8b53da9.tar.gz |
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>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp | 19 | ||||
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index c0ba3d7ac3..b09a1b156f 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -104,6 +104,24 @@ QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableBuilds(const Tar return result; } +bool AutotoolsBuildConfigurationFactory::canSetup(const Kit *k, const QString &projectPath) const +{ + return k && Core::MimeDatabase::findByFile(QFileInfo(projectPath)) + .matchesType(QLatin1String(Constants::MAKEFILE_MIMETYPE)); +} + +QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const +{ + QList<BuildInfo *> result; + QTC_ASSERT(canSetup(k, projectPath), return result); + BuildInfo *info = createBuildInfo(k, + Utils::FileName::fromString(AutotoolsProject::defaultBuildDirectory(projectPath))); + //: The name of the build configuration created by default for a autotools project. + info->displayName = tr("Default"); + result << info; + return result; +} + BuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *parent, const BuildInfo *info) const { QTC_ASSERT(parent, return 0); @@ -165,6 +183,7 @@ BuildInfo *AutotoolsBuildConfigurationFactory::createBuildInfo(const ProjectExpl info->typeName = tr("Build"); info->buildDirectory = buildDir; info->kitId = k->id(); + info->supportsShadowBuild = true; // Works sometimes... return info; } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index 15a535ff68..3375cd3428 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -71,6 +71,9 @@ public: bool canCreate(const ProjectExplorer::Target *parent) const; QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const; + bool canSetup(const ProjectExplorer::Kit *k, const QString &projectPath) const; + QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k, + const QString &projectPath) const; ProjectExplorer::BuildConfiguration *create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const; |