qa: Use QProcess::errorOccurred instead of QProcess::error if possible
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 7 Jan 2020 19:40:01 +0000 (20:40 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 8 Jan 2020 18:41:46 +0000 (19:41 +0100)
To avoid an overloaded signal name, Qt 5.6 introduced the signal
QProcess::errorOccurred() to replace QProcess::error(). The latter one
is deprecated since Qt 5.14, so avoid using it if possible.

src/client/execwrapper.cpp

index f87eb0c..b5853fe 100644 (file)
@@ -34,7 +34,11 @@ ExecWrapper::ExecWrapper(QObject* parent)
     connect(&_process, &QProcess::readyReadStandardOutput, this, &ExecWrapper::processReadStdout);
     connect(&_process, &QProcess::readyReadStandardError, this, &ExecWrapper::processReadStderr);
     connect(&_process, selectOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &ExecWrapper::processFinished);
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
     connect(&_process, selectOverload<QProcess::ProcessError>(&QProcess::error), this, &ExecWrapper::processError);
+#else
+    connect(&_process, &QProcess::errorOccurred, this, &ExecWrapper::processError);
+#endif
 
     connect(this, &ExecWrapper::output, this, &ExecWrapper::postStdout);
     connect(this, &ExecWrapper::error, this, &ExecWrapper::postStderr);