Refine the creation of a dummy project for the debugger

If the startup project doesn't support the chosen kit, it fails.

Task-number: QTCREATORBUG-18606
Change-Id: I745768e7e9ee1740dadaae05d02dcc45f9e9ebef
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2017-07-20 12:33:08 +03:00
committed by Orgad Shaneh
parent 71c612d07d
commit e9aaeb22f8

View File

@@ -622,12 +622,8 @@ RunConfiguration *dummyRunConfigForKit(ProjectExplorer::Kit *kit)
{ {
QTC_ASSERT(kit, return nullptr); // Caller needs to look for a suitable kit. QTC_ASSERT(kit, return nullptr); // Caller needs to look for a suitable kit.
Project *project = SessionManager::startupProject(); Project *project = SessionManager::startupProject();
Target *target = nullptr; Target *target = project ? project->target(kit) : nullptr;
if (project) { if (!target) {
target = project->target(kit);
if (!target)
target = project->createTarget(kit);
} else {
project = new DummyProject; project = new DummyProject;
target = project->createTarget(kit); target = project->createTarget(kit);
} }