Bug 291177 - XML-based files are opened with the default browser instead of the associated application
Summary: XML-based files are opened with the default browser instead of the associated...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 291287 292857 294112 295296 295665 300208 302549 303068 306085 306786 307579 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-10 15:04 UTC by Ovidiu D. Niţan
Modified: 2014-04-11 16:08 UTC (History)
30 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ovidiu D. Niţan 2012-01-10 15:04:27 UTC
Version:           unspecified (using Devel) 
OS:                Linux

It seems that setting a web browser in System Settings - Default Applications - Web browser makes KDE to open XML-based files in browser, even if there's another application associated with that file type. Dolphin, kde-open or xdg-open are affected by this bug. Surprising Konqueror isn't affected by this issue.

Reproducible: Didn't try

Steps to Reproduce:
1. Open System Settings, go to Default Applications -> Web browser, check "in the following browser:" radio button and fill the entry with a browser name.
2. Try to open with Dolphin a XML-based file (I tried with a .cbp CodeBlocks project). The web browser will be launched and will probably offer you to "download" that file. The same thing is happening if you run kde-open /path/to/file or xdg-open /path/to/file.

Actual Results:  
The file is opened in webbrowser

Expected Results:  
The file should be opened with the application defined in File Associations.
Comment 1 Christoph Feck 2012-01-10 15:53:42 UTC
Could you check if the commit for bug 290936 fixes it?
Comment 2 Ovidiu D. Niţan 2012-01-27 15:33:21 UTC
(In reply to comment #1)
> Could you check if the commit for bug 290936 fixes it?

Nope. I'm on KDE 4.8 now and this issue already exists...
Comment 3 Jekyll Wu 2012-01-31 15:42:03 UTC
*** Bug 292857 has been marked as a duplicate of this bug. ***
Comment 4 Martux 2012-02-01 21:26:19 UTC
I am also affected by this. For me it's .nzb files. Application settings are ignored and always a webbrowser is opened.
Comment 5 Mark 2012-02-02 07:31:15 UTC
(In reply to comment #4)
> I am also affected by this. For me it's .nzb files. Application settings are
> ignored and always a webbrowser is opened.

Can confirm that the above is also affecting me for .nzb files. Only started happening with KDE 4.8
Comment 6 Dawit Alemayehu 2012-02-18 08:10:05 UTC
This is because the browser you specified, which probably is Firefox, supports opening XML files and advertises as such. Only my system firefox.desktop contains the following entry:

MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;

Unfortunately, when you attempt to launch something the KDE launcher first checks to see if external browser are defined and whether or not those browsers are capable of handling the requested resource. If that is, the document is launched with the external browser. Konqueror's desktop files do not contain any text/xml in their MimeType entry and as such are not affected by this problem.

Anyhow, this issue is caused by the same code that causes another closely related bug# 182591. When that bug is addressed eventually, this one will probably get resolved as well.
Comment 7 Jekyll Wu 2012-02-18 08:36:35 UTC
*** Bug 294112 has been marked as a duplicate of this bug. ***
Comment 8 Jekyll Wu 2012-03-10 16:44:22 UTC
*** Bug 295665 has been marked as a duplicate of this bug. ***
Comment 9 H.H. 2012-03-19 08:35:00 UTC
I am also affected, for example .odt files are opened with chromium instead of libreoffice (the first choice in "open-with")
Comment 10 Jens Rutschmann 2012-03-20 23:21:22 UTC
(In reply to comment #6)
> This is because the browser you specified, which probably is Firefox,
> supports opening XML files and advertises as such. Only my system
> firefox.desktop contains the following entry:
> 
> MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.
> xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
> 
> Unfortunately, when you attempt to launch something the KDE launcher first
> checks to see if external browser are defined and whether or not those
> browsers are capable of handling the requested resource. If that is, the
> document is launched with the external browser. Konqueror's desktop files do
> not contain any text/xml in their MimeType entry and as such are not
> affected by this problem.
> 
> Anyhow, this issue is caused by the same code that causes another closely
> related bug# 182591. When that bug is addressed eventually, this one will
> probably get resolved as well.

Hi,
I'm also affected by this and modified /usr/share/applications/firefox.desktop to not contain text/xml (which by the way does not match the real mimetype "application/xml").

Unfortunately this didn't help. For now I did not specify a default browser at all - which works.

Is there a better workaround ?
Comment 11 Ovidiu D. Niţan 2012-03-20 23:24:25 UTC
Yes, I also tried by creating a script which just call my favourite browser and passes all received arguments (so no .desktop file for it). After I set it up in the System Settings as my default browser, but XML files are still opened with the web browser (in fact, with my script) instead of the associated application.
Comment 12 Jens Rutschmann 2012-03-24 12:18:48 UTC
Is there anyone looking into this? I'd be glad to test any patches / provide more info.
Unfortunately I don't have any development experience in C++/Qt and the KDE platform itself and have no idea to where to start looking into this, otherwise I'd might try it myself.

This bug is really annoying since I right now I have to decide between:
- being able to double-click XML files (which I need very often)
- being able to click on links in akregrator / skype, etc. (which I also do quite often)

Furthermore, is this really a bug in Konqueror, since this issue is associated with the "Konquerer" product.

Again, if I can do anything to help fixing this, just ask.
Comment 13 H.H. 2012-03-24 21:04:52 UTC
*** This bug has been confirmed by popular vote. ***
Comment 14 Paulo Fidalgo 2012-04-11 10:45:22 UTC
This don't happens only on Konqueror, with Dolphin I have the same behaviour.
Comment 15 Jens Rutschmann 2012-05-07 21:20:58 UTC
Apparently it even occurs in Ark, when I double-click an XML file inside a ZIP, JAR, etc.
Instead of using the kate part it uses the konqueror part for the preview which is not helpful at all.

This is driving me nuts, does anyone have an idea where to start looking for the issue ?
Comment 16 Torsten Römer 2012-05-15 09:42:35 UTC
I have a clean new installation of kubuntu 12.04 and configured KDE to open XML files with kate or kwrite, and it keeps on opening them with rekonq. When I uninstall rekonq, it complains that it is not installed and then opens the file with kwrite.
Only when I change the standard webbrowser from rekonq to "an application that is based on url contents" it finally works.
This is very confusing, because the standard browser setting mentions only http and https urls, so why does it affect XML files?
Comment 17 H.H. 2012-05-15 10:03:05 UTC
this bug seems fixed for me in dolphin kde/4.8.3
Comment 18 Ovidiu D. Niţan 2012-05-15 10:04:28 UTC
Not for me: still occurs in KDE 4.8.3 (Dolphin)
Comment 19 Jens Rutschmann 2012-05-17 10:26:25 UTC
Not fixed for me as well (Gentoo, KDE 4.8.3)
Still the same behaviour.
Comment 20 Christoph Feck 2012-05-17 21:28:05 UTC
*** Bug 300208 has been marked as a duplicate of this bug. ***
Comment 21 Anton Kropachev 2012-05-29 21:31:46 UTC
Not fixed. (Gentoo, KDE 4.8.3)
Problem with *.fb2 files.
Comment 22 bill p. (aka google01103) 2012-06-14 12:51:25 UTC
can confirm still problem in 4.9beta
Comment 23 mogliii 2012-06-14 13:03:01 UTC
Also .svg from Dolphin in Kubuntu 12.04, 4.8.3. Not using inkscape as it should.
Comment 24 Jens Rutschmann 2012-06-14 13:06:22 UTC
I'm also experiencing the following probably related issue:

When I open a ZIP / JAR file in Ark and double click an included XML file, then the Konqueror kpart seems to be used for the preview instead of the text editor kpart.

Did anyone else observe this as well ?
Comment 25 Jekyll Wu 2012-06-26 12:09:44 UTC
*** Bug 302549 has been marked as a duplicate of this bug. ***
Comment 26 Jekyll Wu 2012-07-05 15:05:27 UTC
*** Bug 303068 has been marked as a duplicate of this bug. ***
Comment 27 Jekyll Wu 2012-07-07 13:47:44 UTC
*** Bug 291287 has been marked as a duplicate of this bug. ***
Comment 28 Raphael Kubo da Costa 2012-07-07 19:35:02 UTC
I wonder if bug 201162 could also be marked as a duplicate of this one (even if it's older, the issue seems to be being tracked further here).
Comment 29 Dawit Alemayehu 2012-07-07 23:22:03 UTC
(In reply to comment #28)
> I wonder if bug 201162 could also be marked as a duplicate of this one (even
> if it's older, the issue seems to be being tracked further here).

It is not entirely the same issue. However, if the user sets their own default browser, then previewing XML files in ark does indeed get broken the same way the scenario mentioned in this bug report.

However, even with the fix proposed for this bug the issue in ark preview will remain unless the user or the distro changes the preference order of embedded parts for XML files types.
Comment 30 Dawit Alemayehu 2012-07-08 17:17:39 UTC
Git commit d4af904d455c8348d128568f87beb4f74099578e by Dawit Alemayehu.
Committed on 07/07/2012 at 21:08.
Pushed by adawit into branch 'KDE/4.9'.

Do not use the user's default browser configuration to open XML files.
FIXED-IN: 4.9.0
REVIEW: 105476

M  +3    -3    kio/kio/krun.cpp

http://commits.kde.org/kdelibs/d4af904d455c8348d128568f87beb4f74099578e
Comment 31 Jens Rutschmann 2012-07-08 21:35:25 UTC
(In reply to comment #30)
> Git commit d4af904d455c8348d128568f87beb4f74099578e by Dawit Alemayehu.
> Committed on 07/07/2012 at 21:08.
> Pushed by adawit into branch 'KDE/4.9'.
> 
> Do not use the user's default browser configuration to open XML files.
> FIXED-IN: 4.9.0
> REVIEW: 105476
> 
> M  +3    -3    kio/kio/krun.cpp
> 
> http://commits.kde.org/kdelibs/d4af904d455c8348d128568f87beb4f74099578e

I applied the patch on top of 4.8.3 and XML based files are opened correctly when double-clicked in dolphin.
But in Ark those files are still previewed with the konqueror kpart. Do I need to update some config file for that ?
Comment 32 Raphael Kubo da Costa 2012-07-08 23:55:44 UTC
(In reply to comment #31)
> I applied the patch on top of 4.8.3 and XML based files are opened correctly
> when double-clicked in dolphin.
> But in Ark those files are still previewed with the konqueror kpart. Do I
> need to update some config file for that ?

Please see Dawit's comment #29 and the comments in bug 201162 -- to open things correctly in Ark you need to go to System Settings, choose File Associations, choose the "application/xml" mimetype and put Katepart before the browser KParts in the "Embedding" tab.
Comment 33 Jens Rutschmann 2012-07-09 07:40:27 UTC
Thanks, I forgot about the embedded tab. 
FIXED :-)
Comment 34 Jekyll Wu 2012-09-02 10:57:47 UTC
*** Bug 295296 has been marked as a duplicate of this bug. ***
Comment 35 Jekyll Wu 2012-09-02 10:58:48 UTC
*** Bug 306085 has been marked as a duplicate of this bug. ***
Comment 36 Jekyll Wu 2012-09-17 08:18:12 UTC
*** Bug 306786 has been marked as a duplicate of this bug. ***
Comment 37 Jekyll Wu 2012-09-29 20:15:10 UTC
*** Bug 307579 has been marked as a duplicate of this bug. ***
Comment 38 Rael Gugelmin Cunha 2013-04-30 16:29:46 UTC
I'm using KDE 4.10.2 and my default browser (Chrome) is still trying open a lot of documents NOT configured for it (like .doc files, by example).
Comment 39 Hugo Costelha 2014-04-11 16:08:35 UTC
Opening System Settings --> Default Applications --> Web Browser (on the left) and changing "Open hhtp and https URLs" "in an application based on the contents of the URL", together with the "associations" changes solved the issue for me. This, however, seems very non intuitive.