forked from qt-creator/qt-creator
Port to Qt 6's absence of QProcess::setupChildProcess
Change-Id: I9709abb1c3734e10a7defffd1607e5b3fd46af0e Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -47,6 +47,12 @@ SshProcess::SshProcess()
|
||||
env.set("DISPLAY", ":0");
|
||||
}
|
||||
setProcessEnvironment(env.toProcessEnvironment());
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) && defined(Q_OS_UNIX)
|
||||
setChildProcessModifier([]() {
|
||||
setsid(); // Otherwise, ssh will ignore SSH_ASKPASS and read from /dev/tty directly.
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
SshProcess::~SshProcess()
|
||||
@@ -62,11 +68,13 @@ SshProcess::~SshProcess()
|
||||
waitForFinished(1000);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
void SshProcess::setupChildProcess()
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
setsid(); // Otherwise, ssh will ignore SSH_ASKPASS and read from /dev/tty directly.
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace QSsh
|
||||
|
||||
Reference in New Issue
Block a user