ngraham created this revision. ngraham added reviewers: Frameworks, broulik. Herald added a project: Frameworks. Herald added a subscriber: kde-frameworks-devel. ngraham requested review of this revision.
REVISION SUMMARY Right now, when KRun is invoked to open an `http` or `https` link in a browser, it checks the `BrowserApplication` key in `~/.config/kdeglobals`. If nothing is set there (which is the default), then it introspects the link and figures out for itself what app to open, which has a few quirks and can cause problems (see CCBUG below). This patch improves the browser discovery logic by additionally looking for a default browser in `~/.config/mimeapps.list`, which is the XDG file and it's where browsers set themselves as the default. So if there is a default browser set in there, KRun will consume that information immediately instead of doing the time-consuming and possibly error-inducing link introspection round-trip. CCBUG: 347870 TEST PLAN - Open System Settings > Applications > Default Applications > Browser and click "In an application based on the contents of the url" (which is the default setting, but you might have changed it) - Set `BrowserApplication[$e]=` in `~/.config/kdeglobals` - Ensure that `~/.config/mimeapps/list` has a default browser set - Open any KDE app > Help menu > About KDE > Click on one of the links in the dialog Without this patch, a KRun job is spawned that shows up in the notification widget and the link may take a second or two to open in your default browser. With this patch, the link instantly opens in the browser. REPOSITORY R241 KIO BRANCH default-browser-fallback-to-mimeapps-if-nothing-is-set-in-kdeglobals (branched from master) REVISION DETAIL https://phabricator.kde.org/D17371 AFFECTED FILES src/widgets/krun.cpp To: ngraham, #frameworks, broulik Cc: kde-frameworks-devel, michaelh, ngraham, bruns