Get rid of SshProcess (one process class less)

Introduce static SshRemoteProcess::setupSshEnvironment()
method instead.

Change-Id: I9a49bc68bd96ddf0f58234d28b92a721f7d4bb56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2022-02-18 12:31:19 +01:00
parent 6360cffc80
commit 098e3794db
12 changed files with 48 additions and 125 deletions

View File

@@ -466,21 +466,7 @@ void LinuxDevice::runProcess(QtcProcess &process) const
{
QTC_ASSERT(!process.isRunning(), return);
Utils::Environment env = process.hasEnvironment() ? process.environment()
: Utils::Environment::systemEnvironment();
const bool hasDisplay = env.hasKey("DISPLAY") && (env.value("DISPLAY") != QString(":0"));
if (SshSettings::askpassFilePath().exists()) {
env.set("SSH_ASKPASS", SshSettings::askpassFilePath().toUserOutput());
// OpenSSH only uses the askpass program if DISPLAY is set, regardless of the platform.
if (!env.hasKey("DISPLAY"))
env.set("DISPLAY", ":0");
}
process.setEnvironment(env);
// Otherwise, ssh will ignore SSH_ASKPASS and read from /dev/tty directly.
process.setDisableUnixTerminal();
const bool hasDisplay = SshRemoteProcess::setupSshEnvironment(&process);
process.setCommand(d->fullLocalCommandLine(process.commandLine(), process.terminalMode(),
hasDisplay));
process.start();