forked from qt-creator/qt-creator
Use only active target for guessing run environment
Change-Id: Id7f9f299a22dabd350ac1e8279500cf1054210f8 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user