forked from qt-creator/qt-creator
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: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -671,6 +671,24 @@ void Target::updateDefaultRunConfigurations()
|
||||
addRunConfiguration(rc);
|
||||
foreach (RunConfiguration *rc, newUnconfigured)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user