Review Request 126761: [OS X] handle LaunchServices requests to open files (i.e. from the Finder)

René J.V. Bertin rjvbertin at gmail.com
Sun Mar 6 18:38:15 UTC 2016



> On Jan. 18, 2016, 5:50 p.m., Kevin Funk wrote:
> > app/main.cpp, line 127
> > <https://git.reviewboard.kde.org/r/126761/diff/2/?file=434222#file434222line127>
> >
> >     `struct` not needed
> 
> René J.V. Bertin wrote:
>     In fact, yes it is. At least with clang:
>     
>     ```
>     app/main.cpp:127:13: error: 
>           use of undeclared identifier 'UrlInfo'
>         QVector<UrlInfo> fileOpenRequestList;
>                 ^
>     ```

So either I leave the inline struct definition, or I do as in the upcoming revision, use a forward definition. Or re-order the `UrlInfo` and `KDevelopApplication` definitions, whatever works best for you.


> On Jan. 18, 2016, 5:50 p.m., Kevin Funk wrote:
> > app/main.cpp, line 633
> > <https://git.reviewboard.kde.org/r/126761/diff/2/?file=434222#file434222line633>
> >
> >     Pass the PID here? Then you don't need all the changes around `session`?
> 
> René J.V. Bertin wrote:
>     I can have another look, but I think there are at least 1 or 2 locations where I do need the name of the session the user picked
> 
> René J.V. Bertin wrote:
>     So, it seems that there is indeed only 1 location where I *probably* need to know the name of the session the user may have picked if/when presented with a session picker after provoking one or more FileOpen events:
>     `Core::initialize(splash, Core::Default, app.session);`
>     
>     `KDevelopApplication` strikes me as a rather logical place to store something like the session name but there are of course other ways to achieve that than my current solution.
>     I don't see a (straightforward) way to obtain the session name from the pid that doesn't involve repeating a lot of stuff already being done in `getRunningSessionPid` - is there?
>     Given that most uses of `app.session` precede the call to `startHandlingFileOpenEvents` I could return to using a local `QString session` variable, and do `startHandlingFileOpenEvents(&session)` or `session = app.startHandlingFileOpenEvents()`. Whichever is preferable, and regardless of how that (new) value is determined.

I haven't heard back on this, and have thus decided to test an approach where `startHandlingFileOpenEvents()` receives a pointer to `QString session` (idem for `getRunningSessionPID`. That hides most of the changes around `session` while its value should still be changed to reflect the user's choice when it should.


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126761/#review91272
-----------------------------------------------------------


On Jan. 18, 2016, 4:46 p.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126761/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2016, 4:46 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevelop
> 
> 
> Description
> -------
> 
> This patch introduces support for file open requests from for instance the Finder, on OS X. It also makes it possible to launch KDevelop from the Finder (or the Dock) with the Command key held, in which case the session picker dialog will be presented if multiple sessions are open.
> 
> 
> Diffs
> -----
> 
>   app/Info.plist.in be256f9 
>   app/main.cpp b5f7bb9 
> 
> Diff: https://git.reviewboard.kde.org/r/126761/diff/
> 
> 
> Testing
> -------
> 
> On OS X 10.9.5 with Qt 5.5.1 and KF5 Frameworks 5.17.0 installed in /opt/local
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160306/7d00c457/attachment.html>


More information about the KDevelop-devel mailing list