Use only active target for guessing run environment

Change-Id: Id7f9f299a22dabd350ac1e8279500cf1054210f8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-04-10 13:15:34 +02:00
parent 7768f07ece
commit a1e8cc5e44

View File

@@ -411,16 +411,9 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
// if we could not figure out the run configuration
// try to use the run configuration of the parent project
if (!hasDesktopTarget && targetProject && !targetFile.isEmpty()) {
QList<ProjectExplorer::RunConfiguration *> rcs = target->runConfigurations();
foreach (ProjectExplorer::RunConfiguration *rc, rcs) {
ProjectExplorer::LocalApplicationRunConfiguration *localRunConfiguration
= qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(rc);
auto localRunConfiguration
= qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(target->activeRunConfiguration());
if (localRunConfiguration) {
if (ProjectExplorer::ProjectNode *localRootProjectNode = targetProject->rootProjectNode()) {
QList<ProjectExplorer::FileNode *> localFileNodes = localRootProjectNode->fileNodes();
if (localFileNodes.size()) {
if (localFileNodes.at(0)->path()
== targetProject->projectFilePath()) {
hasDesktopTarget = true;
workDir = Utils::FileUtils::normalizePathName(
localRunConfiguration->workingDirectory());
@@ -428,11 +421,6 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
= localRunConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>();
env = environmentAspect->environment();
guessedRunConfiguration = true;
break;
}
}
}
}
}
}
}