diff options
author | hjk <hjk@theqtcompany.com> | 2016-05-18 12:37:29 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-06-10 10:34:51 +0000 |
commit | 519cc8ded616758cb85857e8845fdc5847339e3a (patch) | |
tree | 04069d8c648a7169008e1a35c057349b358e2f2f /src/plugins/cmakeprojectmanager/cmakebuildstep.h | |
parent | 4ce0494284dfc3bf832e54f9315b9bf6d02a4d28 (diff) |
ProjectExplorer: De-duplicate code in IBuildStepFactory derived classes
This removes 900 lines of duplicated code, some duplicated checks at
runtime and some (minor) quadratic behavior when gathering display names.
canClone(), canRestore() and canCreate() and restore() use the same
pattern. Handle that on the core side once. Leave retore() virtual to let
the ios code unmodified (which is likely not needed, later...). Introduce
'Unclonable' and 'Uncreatable' flags to keep Android package installation
and WinRT deployment (non-)functionality unchanged.
Change-Id: I0325479aff818a4038b2f241ca733b8d8cd66f2f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildstep.h')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 8249e1f1f2..1fb677e24c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -142,15 +142,11 @@ class CMakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory public: explicit CMakeBuildStepFactory(QObject *parent = 0); - bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const override; + QList<ProjectExplorer::BuildStepInfo> + availableSteps(ProjectExplorer::BuildStepList *parent) const override; + ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id) override; - bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const override; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) override; - bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override; - ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override; - - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const override; - QString displayNameForId(Core::Id id) const override; }; } // namespace Internal |