Bug 182591 - KFMClient/KToolInvocation::invokeBrowser() do not honor mimetype associations
Summary: KFMClient/KToolInvocation::invokeBrowser() do not honor mimetype associations
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 15:27 UTC by Valerio Pilo
Modified: 2012-01-10 20:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valerio Pilo 2009-01-31 15:27:56 UTC
Version:            (using Devel)
Compiler:          g++ (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] 
OS:                Linux
Installed from:    Compiled sources

I've set up Firefox as the default browser ("mozillafirefox" as browser in System Settings > favorite applications) and as the default association for *.htm and *.html files (Firefox is the first association for the text/html mimetype in System Settings > Advanced tab > File Associations).

Executing
kfmclient openURL http://www.kde.org/
opens Firefox as expected, while
kfmclient openURL file:///home/username/html4document.htm
always opens the file within Konqueror, while it should open it with the default association for the appropriate mimetype.

This is not just a Konqueror problem though, since calling in your code:
KToolInvocation::invokeBrowser( "file:///home/username/html4document.htm" );
runs kfmclient, which in turn opens Konqueror.
Comment 1 Martin Koller 2011-06-24 16:25:43 UTC
I can reproduce in KDE 4.6.4
Comment 2 Dawit Alemayehu 2011-12-24 04:15:58 UTC
This is reproducible in Git.
Comment 3 Dawit Alemayehu 2011-12-28 18:00:46 UTC
Git commit b7a55b94873a8731a8381f8642d60db7306503fb by Dawit Alemayehu.
Committed on 28/12/2011 at 18:55.
Pushed by adawit into branch 'KDE/4.8'.

Make kfmclient use BrowserApplication for local html files too.

NOTE: This fix requires commit c230e107 in kdelibs.
FIXED-IN: 4.8.0
REVIEW: 103524

M  +2    -1    konqueror/client/kfmclient.cpp

http://commits.kde.org/kde-baseapps/b7a55b94873a8731a8381f8642d60db7306503fb
Comment 4 Dawit Alemayehu 2011-12-28 18:20:15 UTC
Git commit fd8a97bc0865fee85ca56ca6023ae11312638809 by Dawit Alemayehu.
Committed on 28/12/2011 at 18:55.
Pushed by adawit into branch 'master'.

Make kfmclient use BrowserApplication for local html files too.

NOTE: This fix requires commit c230e107 in kdelibs.
FIXED-IN: 4.8.0
REVIEW: 103524

(cherry picked from commit b7a55b94873a8731a8381f8642d60db7306503fb)

M  +2    -1    konqueror/client/kfmclient.cpp

http://commits.kde.org/kde-baseapps/fd8a97bc0865fee85ca56ca6023ae11312638809
Comment 5 David Faure 2012-01-10 11:11:18 UTC
Git commit d882d2a5d29dd4e56603baa68f5d7f1852ecd3b1 by David Faure.
Committed on 10/01/2012 at 12:09.
Pushed by dfaure into branch 'KDE/4.8'.

Revert this one for now, it causes bug 290936.

I was wrong: we need to only call KRun for HTML files. Otherwise, when clicking
on a directory, kfmclient calls KRun which starts kfmclient which calls KRun...

It sounds like the only proper fix for this would be to have a KRun-derived
class in kfmclient, which gets notified of the found mimetype and can then
decide what to do. On the other hand we could also just associate the browser
app with text/html in the KCM, and use existing mechanisms instead of piling
more logic into kfmclient.
Related: bug 290936
FIXED-IN: 4.8.0

M  +1    -2    konqueror/client/kfmclient.cpp

http://commits.kde.org/kde-baseapps/d882d2a5d29dd4e56603baa68f5d7f1852ecd3b1
Comment 6 Dawit Alemayehu 2012-01-10 19:03:30 UTC
Due to a regression the fix for this bug has been reverted. See bug# 290936.
Comment 7 Dawit Alemayehu 2012-01-10 20:47:21 UTC
Git commit c37d81c2076cfa70c1952c49e5dd31f2034521f6 by Dawit Alemayehu, on behalf of David Faure.
Committed on 10/01/2012 at 12:09.
Pushed by adawit into branch 'master'.

Revert this one for now, it causes bug 290936.

I was wrong: we need to only call KRun for HTML files. Otherwise, when clicking
on a directory, kfmclient calls KRun which starts kfmclient which calls KRun...

It sounds like the only proper fix for this would be to have a KRun-derived
class in kfmclient, which gets notified of the found mimetype and can then
decide what to do. On the other hand we could also just associate the browser
app with text/html in the KCM, and use existing mechanisms instead of piling
more logic into kfmclient.
Related: bug 290936
FIXED-IN: 4.8.0
(cherry picked from commit d882d2a5d29dd4e56603baa68f5d7f1852ecd3b1)

M  +1    -2    konqueror/client/kfmclient.cpp

http://commits.kde.org/kde-baseapps/c37d81c2076cfa70c1952c49e5dd31f2034521f6