ProjectExplorer: Don't register targets that are restored to empty state

Don't accept targets that get restored to an empty state. This un-confuses
the Projects page:-) Note that DeployConfigurations are not tested:
I see no use-case where a target with only a deploy configuration makes
any sense.

This can be triggered, e.g. by opening an existing cmake project after
making sure there are no more kits with cmake tool set up.

Change-Id: Iaf14f70e4e0d4206a88a08b47b0eccc666653f76
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2018-05-17 15:50:03 +02:00
parent 1bffb72417
commit e8040081a6

View File

@@ -701,6 +701,11 @@ void Project::createTargetFromMap(const QVariantMap &map, int index)
Target *t = restoreTarget(targetMap);
if (!t)
return;
if (t->runConfigurations().isEmpty() && t->buildConfigurations().isEmpty()) {
delete t;
return;
}
addTarget(t);
}