<table><tr><td style="">ngraham created this revision.<br />ngraham added reviewers: Frameworks, broulik.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />ngraham requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D17371">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Right now, when KRun is invoked to open an <tt style="background: #ebebeb; font-size: 13px;">http</tt> or <tt style="background: #ebebeb; font-size: 13px;">https</tt> link in a browser, it checks the <tt style="background: #ebebeb; font-size: 13px;">BrowserApplication</tt> key in <tt style="background: #ebebeb; font-size: 13px;">~/.config/kdeglobals</tt>. 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).</p>
<p>This patch improves the browser discovery logic by additionally looking for a default browser in <tt style="background: #ebebeb; font-size: 13px;">~/.config/mimeapps.list</tt>, 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.</p>
<p>CCBUG: 347870</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">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)</li>
<li class="remarkup-list-item">Set <tt style="background: #ebebeb; font-size: 13px;">BrowserApplication[$e]=</tt> in <tt style="background: #ebebeb; font-size: 13px;">~/.config/kdeglobals</tt></li>
<li class="remarkup-list-item">Ensure that <tt style="background: #ebebeb; font-size: 13px;">~/.config/mimeapps/list</tt> has a default browser set</li>
<li class="remarkup-list-item">Open any KDE app > Help menu > About KDE > Click on one of the links in the dialog</li>
</ul>
<p>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.</p>
<p>With this patch, the link instantly opens in the browser.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>default-browser-fallback-to-mimeapps-if-nothing-is-set-in-kdeglobals (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D17371">https://phabricator.kde.org/D17371</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/widgets/krun.cpp</div></div></div><br /><div><strong>To: </strong>ngraham, Frameworks, broulik<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>