diff --git a/src/Pty.cpp b/src/Pty.cpp index 789c86b6..ef531f81 100644 --- a/src/Pty.cpp +++ b/src/Pty.cpp @@ -24,19 +24,13 @@ using Konsole::Pty; -Pty::Pty(int masterFd, QObject *aParent) - : KPtyProcess(masterFd, aParent) -{ - init(); -} - Pty::Pty(QObject *aParent) - : KPtyProcess(aParent) + : Pty(-1, aParent) { - init(); } -void Pty::init() +Pty::Pty(int masterFd, QObject *aParent) + : KPtyProcess(masterFd, aParent) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // Must call parent class child process modifier, as it sets file descriptors ...etc diff --git a/src/Pty.h b/src/Pty.h index 4a66e1cc..ce0ce7b6 100644 --- a/src/Pty.h +++ b/src/Pty.h @@ -150,7 +150,8 @@ Q_SIGNALS: void receivedData(const char *buffer, int length); protected: -// TODO: remove this; in Qt6 use setChildProcessModifier() in init() + // TODO: remove this; the method is removed from QProcess in Qt6 + // instead use setChildProcessModifier() in the constructor #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void setupChildProcess() override; #endif