Commit b849f64b authored by Daniel Teske's avatar Daniel Teske

TargetSetupPage: Prefer the default kit for the active target

Change-Id: Ia57685e7ffc5f9d45777731d24e5c8d218a4d5a5
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 70e1aad0
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment