Bug 259426 - KToolInvocation::invokeBrowser open Konqueror when no default browser is set
Summary: KToolInvocation::invokeBrowser open Konqueror when no default browser is set
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: SVN
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 262328 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-10 11:08 UTC by Thomas Tanghus
Modified: 2011-01-07 09:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.6


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Tanghus 2010-12-10 11:08:29 UTC
Version:           0.9.92 (1.0 Beta4)
OS:                Linux

My setting in System Settings/Default Applications/Web Browser is "in an application based on the contents of the URL" and in File Associations txt/html and application/xhtml+xml is set to use rekonq.
KMail for instance properly opens links in rekonq but choqok still opens links in Konqueror.



Reproducible: Always

Steps to Reproduce:
Click on a link in choqok

Actual Results:  
The link opens in Konqueror

Expected Results:  
The link should open in rekonq

OS: Linux (i686) release 2.6.35-23-generic
Compiler: cc

The version is actually:
Version 0.9.98 (1.0 RC1)
Using KDE Development Platform 4.5.4 (KDE 4.5.4)
from 0.9.98git-0.1SNAPSHOT+20101206~adilson~maverick.1
Comment 1 Pino Toscano 2010-12-10 11:43:05 UTC
(In reply to comment #0)
> My setting in System Settings/Default Applications/Web Browser is "in an
> application based on the contents of the URL" and in File Associations txt/html
> and application/xhtml+xml is set to use rekonq.

Which is not correct: if you want to set the KDE browser, then you need to set it in the "default applications" module.
Comment 2 Thomas Tanghus 2010-12-10 12:02:08 UTC
How is this wrong? It is what KMail uses to to effect that when I clicked on the link from the b.k.o mail rekonq opened. If I clicked on a link to an image gwenview would open. That must how it is designed otherwise there wouldn't (shouldn't) be a choice between "in an application based on the contents of the URL" and "in the following browser"?
Comment 3 Pino Toscano 2010-12-10 12:47:33 UTC
This works for kmail because it not asking for "the kde default browser", but "determine whatever the link is, and then open it in the associated application". kmail does not know what the type is, so it uses such generic path.
On the other hand, choqok is explicitly requesting a web browser, with no need to eventually download a bit of the file to determine what it is, but just open straight whatever is configured as "default web browser", and then letting it open the link.

To be more precise: setting rekonq as handler for text/html is not wrong, but just partial: if you want to set a default web browser for kde, use the "default application" module as well.
Comment 4 Thomas Tanghus 2010-12-10 13:10:19 UTC
Well I haven't seen the code for Choqok so I have to ask how is the browser invoked (is that proper english?)? Does it use KToolInvocation::invokeBrowser?
Before I wanted to change my settings I ran "xdg-settings get default-web-browser" and it returned "rekonq.desktop" so somewhere in the chain somethings wrong, or..?
I haven't explicitly set rekonq to be default but maybe upgrading to Kubuntu 10.10 did it. Anyways whether it's Choqok or kdelibs somewhere the desktop standards aren't being followed.
I know I'm splittings hairs over i minor annoyance ;-)
Comment 5 Pino Toscano 2010-12-10 13:19:00 UTC
(In reply to comment #4)
> Well I haven't seen the code for Choqok so I have to ask how is the browser
> invoked (is that proper english?)? Does it use KToolInvocation::invokeBrowser?

Yes.

> Before I wanted to change my settings I ran "xdg-settings get
> default-web-browser" and it returned "rekonq.desktop" so somewhere in the chain
> somethings wrong, or..?

Nope.

> I haven't explicitly set rekonq to be default but maybe upgrading to Kubuntu
> 10.10 did it.

Yes.

> Anyways whether it's Choqok or kdelibs somewhere the desktop standards aren't
> being followed.

When running within a KDE session, web browser set in "default applications" take precedence over anything else, including xdg-open.
There's nothing wrong in either kdelibs or choqok.
Comment 6 Thomas Tanghus 2010-12-10 13:37:35 UTC
(In reply to comment #5)
> When running within a KDE session, web browser set in "default applications"
> take precedence over anything else, including xdg-open.
> There's nothing wrong in either kdelibs or choqok.

Then there's something wrong in the wording:

In "System Settings"/"Default Applications"/"Web Browser"

"Here you can configure your default web browser. All KDE applications in which you can select hyperlinks should honor this setting."

The choices are: "in an application based on the contents of the
URL" or "in the following browser". I have never explicitly set Konqueror to be the default web browser yet Choqok opens links in Konqueror. And to be clear: I haven't selected a custom browser in Choqok either.

BTW: I just checked in Akregator and it also defaults to Konqueror.

So I would say that there is IMHO an error in the way kdelibs opens URLs. IMO it should check if a default browser has been set in "Default Applications" and if not use xdg-open. Now if defaults (hardcoded?) to Konqueror.

So this is not Choqok related. Do you have "The Power of Authorities" to change the product for this bug to kdelibs or should I file a new bug? (Because I still think it's a bug)
Comment 7 David Faure 2010-12-10 14:45:06 UTC
Right, this is a problem in invokeBrowser.

The "default webbrowser set in the settings" solution (called "BrowserApplication" in the code), is only good for non-KIO browsers like firefox, since it means indeed giving them -all- http urls, including urls to images. Not good for proper integration into KDE.

So without such a setting, the current logic is:
invokeBrowser calls kfmclient, which talks to konqueror.

When BrowserApplication is set, kfmclient calls KRun; maybe we could make it do the same when the default application for text/html is not konqueror...

Alternatively we could have this logic in invokeBrowser instead, replacing the hardcoded kfmclient with just "using the default app for text/html". Hmm, probably a better idea.
Comment 8 David Faure 2010-12-22 20:40:12 UTC
SVN commit 1208671 by dfaure:

Replace hardcoded "kfmclient openURL" with "ask KMimeTypeTrader for the preferred app for text/html".
It hurts me to allow people to move away from konqueror -- but it's the right thing to do in this layer :)
BUG: 259426
FIXED-IN: 4.6


 M  +15 -5     ktoolinvocation_x11.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1208671
Comment 9 Thomas Tanghus 2010-12-22 21:58:34 UTC
> It hurts me to allow people to move away from konqueror -- but it's the right
> thing to do in this layer :)

I'm certainly not moving away from Konqueror. Kubuntu introduced rekonq as the new default and I thought I'd give it a test run and report bugs/wishes. While doing so I stumbled over this small inconsistency.
What I would like to see in the different apps (KMail, Akregator, Choqok etc) was a context menu offering Default-App-for-mimetype/Other-apps-for-mimetype/Other... Like the context menu in Konqueror and Dolphin. But thats a completely different story ;-)

Thanks for fixing this.
Comment 10 Mehrdad Momeny 2011-01-07 09:08:04 UTC
*** Bug 262328 has been marked as a duplicate of this bug. ***