ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit

Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-01 14:58:00 +02:00
parent 72fe2c706e
commit 09e5c167bd
10 changed files with 41 additions and 44 deletions

View File

@@ -34,7 +34,6 @@
#include <projectexplorer/abi.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildsteplist.h>
@@ -105,9 +104,8 @@ Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString
// Load the project tree structure.
loadProjectTree();
Kit *defaultKit = KitManager::defaultKit();
if (!activeTarget() && defaultKit)
addTarget(createTarget(defaultKit));
if (!activeTarget())
addTargetForDefaultKit();
return RestoreResult::Ok;
}