diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-04-10 13:15:34 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-04-14 08:28:48 +0300 |
commit | a1e8cc5e44b8ab4bb5e78ec4a6fe08615038c0ae (patch) | |
tree | 23d5c18ee741daaccfc55e62eec389ad2c33acee | |
parent | 7768f07ece949d17e552a29f2199db14dce273ea (diff) | |
download | qt-creator-a1e8cc5e44b8ab4bb5e78ec4a6fe08615038c0ae.tar.gz |
Use only active target for guessing run environment
Change-Id: Id7f9f299a22dabd350ac1e8279500cf1054210f8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
-rw-r--r-- | plugins/autotest/testtreemodel.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp index 0040b4d903..732b229534 100644 --- a/plugins/autotest/testtreemodel.cpp +++ b/plugins/autotest/testtreemodel.cpp @@ -411,28 +411,16 @@ 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); - 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()); - ProjectExplorer::EnvironmentAspect *environmentAspect - = localRunConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>(); - env = environmentAspect->environment(); - guessedRunConfiguration = true; - break; - } - } - } - } + auto localRunConfiguration + = qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(target->activeRunConfiguration()); + if (localRunConfiguration) { + hasDesktopTarget = true; + workDir = Utils::FileUtils::normalizePathName( + localRunConfiguration->workingDirectory()); + ProjectExplorer::EnvironmentAspect *environmentAspect + = localRunConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>(); + env = environmentAspect->environment(); + guessedRunConfiguration = true; } } } |