<table><tr><td style="">markg added a comment.
</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/D10702" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>While this might give you the expected result, it feels like a workaround.</p>

<p>I'm assuming the fast path is there for a reason and is really substantially faster then going through the job route.<br />
If that is the case then the proper fix would be to make that code part async. That is obviously much more complex (otherwise it would've been done already).<br />
Think of using std::async and a QEventLoop. Sounds difficult, right? It is :) But I've been playing with that kind of stuff lately so i'm happy to share an example that you can use as a starting point.<br />
Here it is: <a href="https://p.sc2.nl/BygE-Oiwz" class="remarkup-link" target="_blank" rel="noreferrer">https://p.sc2.nl/BygE-Oiwz</a></p>

<p>I wanted to paste it inline, but that already got quite big so a link it is.<br />
I've added a bunch of comments in the code to explains what it's doing.<br />
Note that the example does make a "QEventLoop", you should <strong>not</strong> do that within the if statement, but rather outside the while loop and simply call exec() and quit() every time (not making a new QEventLoop for every delete)</p>

<p>Lastly, please benchmark this fast pats (as it currently is) compared to your KIO version and my async version to see if the fast path really is the fast path. As we just don't know and that kinda influences which route to choose here.</p></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/D10702" rel="noreferrer">https://phabricator.kde.org/D10702</a></div></div><br /><div><strong>To: </strong>meven, Frameworks, dfaure, ngraham, Dolphin<br /><strong>Cc: </strong>markg, ngraham, Frameworks, michaelh<br /></div>