aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/deployconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-01-22 13:14:22 +0100
committerhjk <hjk@qt.io>2019-01-24 13:09:13 +0000
commit7f3de881e3d8196649e69e025c80d872fbea2e24 (patch)
tree7e3e3af98c653783bb5e039c0175fd45befc1483 /src/plugins/projectexplorer/deployconfiguration.cpp
parent197f2b5f2a8d5335040e0b8012797bf47a29f397 (diff)
ProjectExplorer: Remove some Id use from DeployConfig interface
There's a 1:1 relation between the involved types, having either the factory or the id implies having the other. So shorten interfaces that used both so far. Also canCreate() == canHandle() && id matches, so use that directly. Also drop/QTC_ASSERT former canHandle() checks that are implicit in preceding ::find() calls. Change-Id: I686ea5774c5a01b05b3b4882b3d59080a812a677 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/deployconfiguration.cpp')
-rw-r--r--src/plugins/projectexplorer/deployconfiguration.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp
index 88470828f3..90f8b103d1 100644
--- a/src/plugins/projectexplorer/deployconfiguration.cpp
+++ b/src/plugins/projectexplorer/deployconfiguration.cpp
@@ -190,19 +190,9 @@ void DeployConfigurationFactory::setConfigBaseId(Core::Id deployConfigBaseId)
m_deployConfigBaseId = deployConfigBaseId;
}
-bool DeployConfigurationFactory::canCreate(Target *parent, Core::Id id) const
+DeployConfiguration *DeployConfigurationFactory::create(Target *parent)
{
- if (!canHandle(parent))
- return false;
- if (!id.name().startsWith(m_deployConfigBaseId.name()))
- return false;
- return true;
-}
-
-DeployConfiguration *DeployConfigurationFactory::create(Target *parent, Core::Id id)
-{
- if (!canCreate(parent, id))
- return nullptr;
+ QTC_ASSERT(canHandle(parent), return nullptr);
QTC_ASSERT(m_creator, return nullptr);
DeployConfiguration *dc = m_creator(parent);
if (!dc)