https://bugs.kde.org/show_bug.cgi?id=421374 describes how a service file specified to run in a terminal gives an error saying that it cannot find 'konsole' or the user's configured terminal program.
The problem is that KIO::DesktopExecParser::resultingArguments(), if service.terminal() is true, prepends the terminal application to the command line. If this is a relative path, as it is most likely to be (and will be in the default 'konsole' case), the "realExecutable" check in KProcessRunner::KProcessRunner() is triggered and the job aborts with an error message.
This change expands the specified terminal executable into a full path in KIO::DesktopExecParser::resultingArguments(), and returns an error immediately if it cannot be found. This is then prepended to the command line. When KProcessRunner::KProcessRunner() checks the realExecutable (the first word of the command line) it will be an absolute path and the check will not fail.
The order of the code blocks in KProcessRunner::KProcessRunner() is adjusted so that execParser.resultingArguments() is checked for being empty (an error return) before the first word of the command is accessed. This means that the "realExecutable = execParser.resultingArguments().at(0)" test will not assert if resultingArguments() is an empty list.
BUG: 421374
FIXED-IN: 5.71