[KRun] when asked to open link in external browser, ball back to mimeapps.list if nothing is set in kdeglobals
Needs ReviewPublic

Authored by ngraham on Wed, Dec 5, 7:51 PM.

Details

Reviewers
broulik
Group Reviewers
Frameworks
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 is slow and can cause problems with certain links (see CCBUGs 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
CCBUG: 100016

Test Plan
  1. 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)
  2. Set BrowserApplication[$e]= in ~/.config/kdeglobals
  3. Ensure that ~/.config/mimeapps/list has a default browser set
  4. 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.

Diff Detail

Repository
R241 KIO
Branch
default-browser-fallback-to-mimeapps-if-nothing-is-set-in-kdeglobals (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5729
Build 5747: arc lint + arc unit
ngraham created this revision.Wed, Dec 5, 7:51 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptWed, Dec 5, 7:51 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Wed, Dec 5, 7:51 PM
ngraham edited the summary of this revision. (Show Details)Wed, Dec 5, 7:53 PM
ngraham edited the test plan for this revision. (Show Details)