Commit 9488b7e6 authored by Christian Kandeler's avatar Christian Kandeler

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: default avatarGeorger Araujo <georger_br@yahoo.com.br>
Reviewed-by: Jake Petroules's avatarJake Petroules <jake.petroules@qt.io>
parent 173ed5b6
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment