diff options
author | Daniel Teske <daniel.teske@digia.com> | 2013-08-08 15:46:24 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@digia.com> | 2013-08-08 17:21:41 +0200 |
commit | b849f64bbea330d7b4ab28328fd5a3956d0beb67 (patch) | |
tree | 4c3405332747a3dd2d4d5f4e5cfd0e81a8223e1c /src/plugins/qt4projectmanager/wizards | |
parent | 70e1aad0416afd5cad6e34e131f79fff6ef47a10 (diff) | |
download | qt-creator-b849f64bbea330d7b4ab28328fd5a3956d0beb67.tar.gz |
TargetSetupPage: Prefer the default kit for the active target
Change-Id: Ia57685e7ffc5f9d45777731d24e5c8d218a4d5a5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager/wizards')
-rw-r--r-- | src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index a39b7c2413..204676bee6 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -698,12 +698,19 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project) // c) the first target ProjectExplorer::Target *activeTarget = 0; QList<ProjectExplorer::Target *> targets = project->targets(); + int activeTargetPriority = 0; foreach (ProjectExplorer::Target *t, targets) { QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(t->kit()); - if (version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)) + if (t->kit() == ProjectExplorer::KitManager::instance()->defaultKit()) { activeTarget = t; - else if (!activeTarget && version && version->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)) + activeTargetPriority = 3; + } else if (activeTargetPriority < 2 && version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)) { activeTarget = t; + activeTargetPriority = 2; + } else if (activeTargetPriority < 1 && version && version->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)) { + activeTarget = t; + activeTargetPriority = 1; + } } if (!activeTarget && !targets.isEmpty()) activeTarget = targets.first(); |