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