Use delegating constructors in Pty

And move the code from init() to the constructor, and remove init(), not
needed any more.
wilder
Ahmad Samir 4 years ago committed by Tomaz Canabrava
parent 2117727305
commit 38d5fa529f
  1. 12
      src/Pty.cpp
  2. 3
      src/Pty.h

@ -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

@ -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

Loading…
Cancel
Save