Commit 0ce0a053 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

RC: Make sure a configured RC is active after opening a project



Select the RC a bit more sensibly:
 * Try to find a RC with the same name as the project first
 * If that fails: Take the first RC in the project

Change-Id: I7bb70826259a203c383eadc8dc9c3ac07f53fd6b
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent c60b1939
...@@ -671,6 +671,24 @@ void Target::updateDefaultRunConfigurations() ...@@ -671,6 +671,24 @@ void Target::updateDefaultRunConfigurations()
addRunConfiguration(rc); addRunConfiguration(rc);
foreach (RunConfiguration *rc, newUnconfigured) foreach (RunConfiguration *rc, newUnconfigured)
addRunConfiguration(rc); addRunConfiguration(rc);
// Make sure a configured RC is active:
if (activeRunConfiguration() && !activeRunConfiguration()->isConfigured()) {
if (!existingConfigured.isEmpty() && existingConfigured.at(0)->isConfigured())
setActiveRunConfiguration(existingConfigured.at(0));
else if (!newConfigured.isEmpty()) {
RunConfiguration *selected = newConfigured.at(0);
// Try to find a runconfiguration that matches the project name. That is a good
// candidate for something to run initially.
foreach (RunConfiguration *rc, newConfigured) {
if (rc->displayName() == project()->displayName()) {
selected = rc;
break;
}
}
setActiveRunConfiguration(selected);
}
}
} }
QVariant Target::namedSettings(const QString &name) const QVariant Target::namedSettings(const QString &name) const
......
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