diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-11-28 16:31:13 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-11-30 09:23:38 +0000 |
commit | 9488b7e604d081552a97f66fe08bbdd38be38e6b (patch) | |
tree | fb95f4ae6233eb416c4379b006646323698bd25d | |
parent | 173ed5b6fd4ba92d7a33b82606c427fc112d1749 (diff) | |
download | qt-creator-9488b7e604d081552a97f66fe08bbdd38be38e6b.tar.gz |
QbsProjectManager: Set the default working directory in the run config
... rather than in the run config widget. Otherwise merely opening the
run settings can change the behavior of applications.
Task-number: QTCREATORBUG-19374
Change-Id: Ib227ab07d09b7a8ce34909ae0b08b6b222bcee14
Reviewed-by: Georger Araujo <georger_br@yahoo.com.br>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp index 12d7549b9a..e69089bbde 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp @@ -131,8 +131,14 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target) }); connect(BuildManager::instance(), &BuildManager::buildStateChanged, this, [this, project](Project *p) { - if (p == project && !BuildManager::isBuilding(p)) + if (p == project && !BuildManager::isBuilding(p)) { + const QString defaultWorkingDir = baseWorkingDirectory(); + if (!defaultWorkingDir.isEmpty()) { + extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory( + Utils::FileName::fromString(defaultWorkingDir)); + } emit enabledChanged(); + } } ); @@ -334,7 +340,6 @@ void QbsRunConfigurationWidget::targetInformationHasChanged() setExecutableLineText(m_rc->executable()); WorkingDirectoryAspect *aspect = m_rc->extraAspect<WorkingDirectoryAspect>(); - aspect->setDefaultWorkingDirectory(Utils::FileName::fromString(m_rc->baseWorkingDirectory())); aspect->pathChooser()->setBaseFileName(m_rc->target()->project()->projectDirectory()); m_ignoreChange = false; } |