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>
This commit is contained in:
hjk
2019-01-22 13:14:22 +01:00
parent 197f2b5f2a
commit 7f3de881e3
4 changed files with 7 additions and 33 deletions

View File

@@ -527,8 +527,8 @@ void Target::updateDefaultDeployConfigurations()
foreach (Core::Id id, toCreate) {
foreach (DeployConfigurationFactory *dcFactory, dcFactories) {
if (dcFactory->canCreate(this, id)) {
DeployConfiguration *dc = dcFactory->create(this, id);
if (dcFactory->creationId() == id) {
DeployConfiguration *dc = dcFactory->create(this);
if (dc) {
QTC_CHECK(dc->id() == id);
addDeployConfiguration(dc);