ProjectExplorer/RemoteLinux: Consolidate X11ForwardingAspect handling

Change-Id: I7e74f58ab50c84c74ba65f9f64aaa4d0ea73bbb6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-06-20 09:27:47 +02:00
parent 6836caa14c
commit 691c8148a3
5 changed files with 2 additions and 17 deletions

View File

@@ -403,6 +403,8 @@ Runnable RunConfiguration::runnable() const
r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory()); r.workingDirectory = r.command.executable().withNewMappedPath(workingDirectoryAspect->workingDirectory());
if (auto environmentAspect = aspect<EnvironmentAspect>()) if (auto environmentAspect = aspect<EnvironmentAspect>())
r.environment = environmentAspect->environment(); r.environment = environmentAspect->environment();
if (auto forwardingAspect = aspect<X11ForwardingAspect>())
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
if (m_runnableModifier) if (m_runnableModifier)
m_runnableModifier(r); m_runnableModifier(r);
return r; return r;

View File

@@ -200,11 +200,6 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id)
if (HostOsInfo::isAnyUnixHost()) if (HostOsInfo::isAnyUnixHost())
addAspect<X11ForwardingAspect>(macroExpander()); addAspect<X11ForwardingAspect>(macroExpander());
setRunnableModifier([this](Runnable &r) {
if (const auto * const forwardingAspect = aspect<X11ForwardingAspect>())
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
});
setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] { setCommandLineGetter([bufferedAspect, interpreterAspect, argumentsAspect, scriptAspect] {
CommandLine cmd{interpreterAspect->currentInterpreter().command}; CommandLine cmd{interpreterAspect->currentInterpreter().command};
if (!bufferedAspect->value()) if (!bufferedAspect->value())

View File

@@ -171,8 +171,6 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
setRunnableModifier([this](Runnable &r) { setRunnableModifier([this](Runnable &r) {
const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem()); const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem());
r.workingDirectory = bs->targetDirectory(); r.workingDirectory = bs->targetDirectory();
if (const auto * const forwardingAspect = aspect<X11ForwardingAspect>())
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
}); });
setDisplayName(Tr::tr("QML Utility", "QMLRunConfiguration display name.")); setDisplayName(Tr::tr("QML Utility", "QMLRunConfiguration display name."));

View File

@@ -52,11 +52,6 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar
if (HostOsInfo::isAnyUnixHost()) if (HostOsInfo::isAnyUnixHost())
addAspect<X11ForwardingAspect>(macroExpander()); addAspect<X11ForwardingAspect>(macroExpander());
setRunnableModifier([this](Runnable &r) {
if (const auto * const forwardingAspect = aspect<X11ForwardingAspect>())
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
});
setDefaultDisplayName(runConfigDefaultDisplayName()); setDefaultDisplayName(runConfigDefaultDisplayName());
} }

View File

@@ -73,11 +73,6 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Id id)
libAspect->setEnabled(buildDevice == runDevice); libAspect->setEnabled(buildDevice == runDevice);
}); });
setRunnableModifier([this](Runnable &r) {
if (const auto * const forwardingAspect = aspect<X11ForwardingAspect>())
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
});
envAspect->addModifier([this, libAspect](Environment &env) { envAspect->addModifier([this, libAspect](Environment &env) {
BuildTargetInfo bti = buildTargetInfo(); BuildTargetInfo bti = buildTargetInfo();
if (bti.runEnvModifier) if (bti.runEnvModifier)