Commit 38d5fa52 authored by Ahmad Samir's avatar Ahmad Samir Committed by Tomaz Canabrava
Browse files

Use delegating constructors in Pty

And move the code from init() to the constructor, and remove init(), not
needed any more.
parent 21177273
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment