Summary: | Impossible to have different applications for HTML files and URLs | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Serhiy Zahoriya <serhiy.int> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, bugseforuns, kde, kdelibs-bugs, nate |
Priority: | NOR | Keywords: | usability |
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kio/afb2f80cbbe1d4095e897d88430a3b7295bb1114 | Version Fixed In: | 5.65 |
Description
Serhiy Zahoriya
2018-09-24 14:33:05 UTC
This is an explicit special case in KRun, for whatever reason: if (!d->m_externalBrowser.isEmpty() && ( mime.inherits(QStringLiteral("text/html")) || mime.inherits(QStringLiteral("application/xhtml+xml")))) { if (d->runExecutable(d->m_externalBrowser)) { I wanted to know why it was added but it was like this since code was moved https://cgit.kde.org/kio.git/commit/src/widgets/krun.cpp?id=c8ac9fd1774ec1b58d37ccdd3a1f767456596db0 Do you know where is the prior history if this file? Probably kdelibs: https://cgit.kde.org/kdelibs.git/tree/kio/kio/krun.cpp?h=KDE/4.14 So it's https://cgit.kde.org/kdelibs.git/commit/kio/kio/krun.cpp?h=KDE/4.14&id=c230e107d213a67c0f1b5c033c00908053465c60 > Use BrowserApplication for local html files too. > Discussed as part of review 103524. https://git.reviewboard.kde.org/r/103524/ That is linked to https://bugs.kde.org/show_bug.cgi?id=182591 IMHO, there are two distinctive use cases here, opening http*:// links with a web browser (which is what the user wants most of the time); and opening local '.*html' files on the user's machine, usually with the intention to edit them; the two cases can/should be mutually exclusive. KRun shouldn't override user settings unconditionally. Removing the afro-mentioned bit of code gives the choice back to the user, as he can set his preferred app to open local .html files, be it a web browser or a text editor. Also this won't impact new user accounts because most browsers .desktop files have Mimetype entries that cover most of the .html and co. types. So it'll either be the default app already or the user can select his favourite browser from the open with list. Git commit afb2f80cbbe1d4095e897d88430a3b7295bb1114 by Nate Graham, on behalf of Ahmad Samir. Committed on 02/12/2019 at 21:34. Pushed by ngraham into branch 'master'. KRun: don't override user preferred app when opening local *.*html and co. files Summary: KRun unconditionally opened files with mimetype text/html (and co.) with the browser application set in kdeglobals, BrowserApplication=, and if it's not set, it fells back to mimeapps.list (x-scheme-handler/http*). IMHO, there are two distinctive use cases here, opening http*:// links with a web browser (which is what the user wants most of the time); and opening local '.*html' files on the user's machine, usually with the intention to edit them; the two cases can/should be mutually exclusive. This gives the choice back to the user, as he can set his preferred app to open local .html files, be it a web browser or a text editor. This won't impact new user accounts because most browsers .desktop files have Mimetype entries that cover most of the .html and co. types. So it'll either be the default app already or the user can select his favourite browser from the open-with list. Thanks to broulik for pin-pointing the location in the code that caused this behaviour first. FIXED-IN: 5.65 Test Plan: - Set some web browser as the default in the component chooser kcm - Open Dolphin and using any .html file set the default app to, say, kwrite - Try to open a local .html file, notice that it opens in the web browser you set - Apply the patch, then try again, it should be opened with kwrite Reviewers: #frameworks, dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24828 M +1 -7 src/widgets/krun.cpp https://commits.kde.org/kio/afb2f80cbbe1d4095e897d88430a3b7295bb1114 |