Revert "Port to Qt 6's absence of QProcess::setupChildProcess"

This reverts commit 6a66ced594.

The patch that will introduce the alternative to setupChildProcess
(QProcess::setChildProcessModifier()) has not yet found its
way to qtbase and current Qt dev already identifies itself as
version 6.0.0, rendering the code here uncompilable.

Change-Id: I570b01598005070f0c17604226d245a3a381250e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-06-11 14:59:40 +02:00
parent 9e4eafccd2
commit f2e06d2764
5 changed files with 6 additions and 40 deletions

View File

@@ -89,27 +89,19 @@ static Q_LOGGING_CATEGORY(processLog, "qtc.utils.synchronousprocess", QtWarningM
// A special QProcess derivative allowing for terminal control.
class TerminalControllingProcess : public QProcess {
public:
TerminalControllingProcess()
{
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) && defined(Q_OS_UNIX)
setChildProcessModifier([this]() { maybeSetsid(); });
#endif
}
TerminalControllingProcess() = default;
unsigned flags() const { return m_flags; }
void setFlags(unsigned tc) { m_flags = tc; }
protected:
inline void maybeSetsid();
#if QT_VERSION < QT_VERSION_CHECK(6,0,0) && defined(Q_OS_UNIX)
void setupChildProcess() override { maybeSetsid(); }
#endif
void setupChildProcess() override;
private:
unsigned m_flags = 0;
};
inline void TerminalControllingProcess::maybeSetsid()
void TerminalControllingProcess::setupChildProcess()
{
#ifdef Q_OS_UNIX
// Disable terminal by becoming a session leader.