Properly launch Web Browser as detached process and handle errors if ocurred

Authored by wcancino on Nov 28 2017, 1:54 PM.



This path allow to launch a webbrowser as a detached process. If the launch fails, it will display an error message and close the debug session properly (when connection exists of not).

Diff Detail

R68 KDevelop XDebug Support
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
wcancino created this revision.Nov 28 2017, 1:54 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 28 2017, 1:54 PM
wcancino requested review of this revision.Nov 28 2017, 1:54 PM
brauch requested changes to this revision.Nov 28 2017, 2:07 PM
brauch added a subscriber: brauch.
brauch added inline comments.

where do you connect to this slot ...? It seems like it is only ever called explicitly with QProcess::FailedToStart as the error, which is a bit unintuitive.


use qCWarning / qCDebug

This revision now requires changes to proceed.Nov 28 2017, 2:07 PM

To clarify my comment above, if what I said is correct, I would suggest to call the function "processFailedToStart"or so, and make it a non-slot.

Yes, anyway I use that name because is consistent with the XDebugJob class (which uses the same mehtod name). Note that this path try to solve:

  • The webbrowser launch.
  • Display error when something wrong happens.
  • Correctly (?) end the debugger even if there is not connection available (side effect of having a connection -> debug state map)

Yes, anyway I use that name because is consistent with the XDebugJob class (which uses the same mehtod name).

Yes, but the new method doesn't do the same thing as the one in the other class. Thus the consistency is confusing instead of helpful, because the same name suggests the same functionality (which it does not have). If I see a method named "processError" I assume it is connected to the "error" signal of a QProcess or similar, which is the case in XDebugJob but not here. The "if error == QProcess::FailedToStart" is not helpful either, because that suggests it could be different (which it can't be).

wcancino updated this revision to Diff 23117.Nov 29 2017, 8:26 AM
brauch accepted this revision.Nov 29 2017, 1:39 PM

Thanks! I'll submit this as well.

This revision is now accepted and ready to land.Nov 29 2017, 1:39 PM

Helping out as discussed on irc with @brauch and submitting all your commits now.

This revision was automatically updated to reflect the committed changes.