<table><tr><td style="">dfaure marked an inline comment as done.<br />dfaure added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29170">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D29170#inline-166674">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ahmadsamir</span> wrote in <span style="color: #4b4d51; font-weight: bold;">kprocessrunner.cpp:53</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">KProcessRunner tries finding the executable in the current dir too, so to be precise in the reported error message maybe append currentDir.absolutePath() to searchPaths?</p>

<p style="padding: 0; margin: 8px;">Also KProcessRunner only checks that the executable exists in the current dir, "!QFileInfo::exists(realExecutable)", it should also check that it's executable. So that KProcessRunner checks the "exists and is +x" and here we check "exists but not +x", if that makes sense.</p>

<p style="padding: 0; margin: 8px;">I guess you'll have the add an ifdef kludge since QString::SkipEmptyParts is deprecated in Qt 5.15 according to <a href="https://lxr.kde.org/source/frameworks/frameworkintegration/src/kpackage-install-handlers/kns/main.cpp#0068" class="remarkup-link" target="_blank" rel="noreferrer">https://lxr.kde.org/source/frameworks/frameworkintegration/src/kpackage-install-handlers/kns/main.cpp#0068</a> (I am still on 5.14).</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">In a GUI program started graphically, the notion of "current dir" means very little. You can't see it, you can't change it.<br />
Granted, when starting it from the command line it does serve a purpose for command line arguments, but IMHO not after that.</p>

<p style="padding: 0; margin: 8px;">What's more, here we're executing a KService i.e. usually a desktop file (unless it was constructed from an executable name, display name and icon).</p>

<p style="padding: 0; margin: 8px;">Hmm OK I can make a testcase for it with a special case. A copy of dolphin's desktop file with Exec=dolphin2 and a copy of dolphin called dolphin2 in the same directory, and starting dolphin from that directory. Interesting, it leads to "execvp: Permission denied", that's a new one :)<br />
(must be from QProcess).</p>

<p style="padding: 0; margin: 8px;">My next path will fix that testcase, but it remains an unexpected corner case. The same dolphin started from $HOME and then navigating to that directory, cannot start that desktop file.<br />
Maybe we want to look for executables relative to the desktop file, rather than from the hidden-to-the-user current directory... Actually I remember people asking for that to work, a VERY long time ago on the freedesktop xdg mailing-list. IIRC I even made it work back then.</p>

<p style="padding: 0; margin: 8px;">Thanks for the SkipEmptyParts information and for noticing the weird if() -- fixed.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D29170#inline-166705">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ahmadsamir</span> wrote in <span style="color: #4b4d51; font-weight: bold;">kprocessrunner.cpp:60</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Should be https://</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I was counting on the redirection :-)</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29170">https://phabricator.kde.org/D29170</a></div></div><br /><div><strong>To: </strong>dfaure, ahmadsamir<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>