D29178: [dolphin] : Mac integration

René J.V. Bertin noreply at phabricator.kde.org
Sun Apr 26 23:28:21 BST 2020


rjvbb planned changes to this revision.
rjvbb added inline comments.

INLINE COMMENTS

> main.cpp:216-217
> +    QCoreApplication::processEvents();
> +    if (!openEventHandler->urls.isEmpty()) {
> +        urls.append(openEventHandler->popUrls());
> +    }

Note to self: fix this, there's need for a getter after all.

> elvisangelaccio wrote in main.cpp:228-230
> I don't get it, why do we need to move this here?

To enable normal runtime processing of QFileOpen events as soon as possible after we've handled the first events.

LaunchServices, the Mac's service that handles launching applications and handing off documents to be opened doesn't use `argc,argv` but sends ObjC messages (one per document) that Qt forwards as QFileOpenEvents. 
This is an asynchronous mechanism and there's no guarantee that the events for all documents/folders you selected for opening will have been processed after line 215 above, even if they probably have been.
The longer opening the main window is postponed, the bigger the chance that we'll need to check the event handler's URL queue for file open events that arrived after we flushed that queue.

Opening the main window a bit earlier seems like the best way to prevent this and I don't see anything suggesting I can't move the operaton as I did.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D29178

To: rjvbb, #dolphin, elvisangelaccio, feverfew
Cc: feverfew, broulik, meven, kfm-devel, #dolphin, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, fbampaloukas, alexde, Codezela, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, rdieter, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200426/d4a20f5b/attachment.htm>


More information about the kfm-devel mailing list