Commit b26c05f2 authored by Kåre Särs's avatar Kåre Särs Committed by Christoph Cullmann
Browse files

Fix startHostProcess() for KProcess < KF5.97

Since startHostProcess takes a QProcess and KProcess was modified to
behave more like a QProcess in 5.97, the #else needs to execute the
start() function of KProcess and not QPorcess. -> try to qobject_cast
the passed process to KProcess and use that if possible.


(cherry picked from commit 2403075c)
parent 4f58104f
Pipeline #205337 skipped
......@@ -5,6 +5,7 @@
#include <QStandardPaths>
#include <KProcess>
#include <KSandbox>
#include <kcoreaddons_version.h>
......@@ -22,7 +23,13 @@ void startHostProcess(QProcess &proc, QProcess::OpenMode mode)
#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5, 97, 0)
KSandbox::startHostProcess(proc, mode);
#else
proc.start(mode);
KProcess *kprocess = qobject_cast<KProcess *>(&proc);
if (kprocess) {
kprocess->setNextOpenMode(mode);
kprocess->start();
} else {
proc.start(mode);
}
#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