diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2013-03-11 12:02:08 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-03-11 14:47:14 +0100 |
commit | 5977b6db20b3003fa4d4390453b7c19760db2670 (patch) | |
tree | fee9f797880bd0a42b36939c9046dfceca25d37c /src/plugins/projectexplorer/buildconfiguration.h | |
parent | 9f7a1e3d65a62616da4da82920e347fe0c332a87 (diff) | |
download | qt-creator-5977b6db20b3003fa4d4390453b7c19760db2670.tar.gz |
ProjectExplorer: Make fromMap() public in BuildConfiguration.
And also in DeployConfiguration.
Rationale: Consider this typical use case of a deploy configuration
factory that can create several deploy configurations for a specific
target.
ProjectExplorer::DeployConfiguration *MyFactory::restore(map)
{
ProjectExplorer::DeployConfiguration *dc = 0;
id = idFromMap(map)
if (id == myDcId_1())
dc = new MyDcId_1;
else if (id == myDcId_2())
dc = new MyDcId_2;
...
else if (id == myDcId_n())
dc = new MyDcId_n;
if (dc)
dc->fromMap(map);
return dc;
}
This does currently not compile, forcing us to introduce n variables and
calling fromMap() n times. In addition, we either have to make the
factory a friend of all the deploy configurations or add a public
fromMap() function into all of them, even if they don't add any
functionality, or introduce some other type of silly boiler-plate code.
All of this becomes unnecessary when fromMap() is public in the parent class.
Note also that fromMap() is public in the inheritance root
(ProjectConfiguration) as well as in RunConfiguration.
Change-Id: I4c6431bba2500e2434c487c316e30ddb259fa2b5
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/buildconfiguration.h')
-rw-r--r-- | src/plugins/projectexplorer/buildconfiguration.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index f234307922..c07c483b7d 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -75,6 +75,7 @@ public: QList<Core::Id> knownStepLists() const; BuildStepList *stepList(Core::Id id) const; + virtual bool fromMap(const QVariantMap &map); virtual QVariantMap toMap() const; Target *target() const; @@ -102,8 +103,6 @@ protected: void cloneSteps(BuildConfiguration *source); - virtual bool fromMap(const QVariantMap &map); - private slots: void handleKitUpdate(); |