forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user