diff options
author | Tobias Hunger <[email protected]> | 2012-04-24 15:49:09 +0200 |
---|---|---|
committer | Tobias Hunger <[email protected]> | 2012-06-21 12:08:12 +0200 |
commit | 24314562165588b56a318b3b8a846bf5deda7c41 (patch) | |
tree | b5dcf951e76d003c2623011b0e91994e06e7e061 /src/plugins/autotoolsprojectmanager/autogenstep.cpp | |
parent | 8c77b8c9d7b25d0c89003c8c4a54e8da5bfb7edd (diff) |
Profile introduction
Introduce Profiles to store sets of values that describe a system/device.
These profiles are held by a target, getting rid of much of the information
stored in the Build-/Run-/DeployConfigurations, greatly simplifying those.
This is a squash of the wip/profile branch which has been on gerrit for a
while, rebased to current master.
Change-Id: I25956c8dd4d1962b2134bfaa8a8076ae3909460f
Reviewed-by: Daniel Teske <[email protected]>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager/autogenstep.cpp')
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autogenstep.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index b3c31767843..c19f8a241ad 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -34,11 +34,11 @@ #include "autogenstep.h" #include "autotoolsproject.h" -#include "autotoolstarget.h" #include "autotoolsbuildconfiguration.h" #include "autotoolsprojectconstants.h" #include <projectexplorer/buildsteplist.h> +#include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> #include <projectexplorer/gnumakeparser.h> #include <projectexplorer/projectexplorer.h> @@ -67,9 +67,9 @@ AutogenStepFactory::AutogenStepFactory(QObject *parent) : QList<Core::Id> AutogenStepFactory::availableCreationIds(BuildStepList *parent) const { - if (parent->target()->project()->id() == Core::Id(Constants::AUTOTOOLS_PROJECT_ID)) - return QList<Core::Id>() << Core::Id(AUTOGEN_STEP_ID); - return QList<Core::Id>(); + if (!canHandle(parent)) + return QList<Core::Id>(); + return QList<Core::Id>() << Core::Id(AUTOGEN_STEP_ID); } QString AutogenStepFactory::displayNameForId(const Core::Id id) const @@ -81,13 +81,7 @@ QString AutogenStepFactory::displayNameForId(const Core::Id id) const bool AutogenStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const { - if (parent->target()->project()->id() != Core::Id(Constants::AUTOTOOLS_PROJECT_ID)) - return false; - - if (parent->id() != Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)) - return false; - - return Core::Id(AUTOGEN_STEP_ID) == id; + return canHandle(parent) && Core::Id(AUTOGEN_STEP_ID) == id; } BuildStep *AutogenStepFactory::create(BuildStepList *parent, const Core::Id id) @@ -125,6 +119,13 @@ BuildStep *AutogenStepFactory::restore(BuildStepList *parent, const QVariantMap return 0; } +bool AutogenStepFactory::canHandle(BuildStepList *parent) const +{ + if (parent->target()->project()->id() != Core::Id(Constants::AUTOTOOLS_PROJECT_ID)) + return false; + return parent->id() == Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD); +} + //////////////////////// // AutogenStep class //////////////////////// |