Bug 393727 - QDesktopServices::openUrl() fails on KDE Plasma
Summary: QDesktopServices::openUrl() fails on KDE Plasma
Status: RESOLVED NOT A BUG
Alias: None
Product: Falkon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-01 12:31 UTC by Kayra Akman
Modified: 2018-05-02 10:03 UTC (History)
3 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 Kayra Akman 2018-05-01 12:31:20 UTC
I have filed the following bug report for Qt: https://bugreports.qt.io/browse/QTBUG-68027

It seems that Qt - Plasma integration is not working for openUrl(). I am not sure whether plasma-integration is the correct project for such an error. Please correct the Product if necessary, and close this issue if it needs to be fix in Qt.
Comment 1 Martin Flöser 2018-05-01 13:30:26 UTC
Works for me. Do you have a browser configured at all?
Comment 2 Kayra Akman 2018-05-01 13:39:44 UTC
(In reply to Martin Flöser from comment #1)
> Works for me. Do you have a browser configured at all?

I had only Falkon installed and it was the selected browser. The links in KDE documentation in KHelpCenter was working, so I assumed Falkon was OK.

I have also installed Firefox. Now openUrl() works. Regardless of which browser is selected, Firefox is always opened. So it is not a Qt bug after all.

It seems another bug report is needed for Falkon not being recognized as a valid web browser although Default Applications > Web Browser "knows" about Falkon.
Comment 3 Martin Flöser 2018-05-01 13:44:50 UTC
Moving to falkon, maybe the falkon devs have an idea.
Comment 4 The_assassin 2018-05-02 06:40:45 UTC
>I have filed the following bug report for Qt:
I'm using a GTK system and your test application works here. It just triggers gvfs-open, so i think you just have some system misconfiguration (IMO).
Comment 5 Kayra Akman 2018-05-02 08:50:24 UTC
(In reply to Moonchild from comment #4)
> >I have filed the following bug report for Qt:
> I'm using a GTK system and your test application works here. It just
> triggers gvfs-open, so i think you just have some system misconfiguration
> (IMO).

It turned out Falkon was not recognized/reported as a web browser. Please see Comment #2 by me.
Comment 6 David Rosca 2018-05-02 09:14:32 UTC
Can you test with "xdg-open", that's what QDesktopServices::openUrl() should be calling.
Comment 7 Kayra Akman 2018-05-02 09:54:23 UTC
(In reply to David Rosca from comment #6)
> Can you test with "xdg-open", that's what QDesktopServices::openUrl() should
> be calling.

xdg-open was not available on my system. After installing the xdg-utils package openUrl() successfully opened Falkon. So it was neither Qt, nor KDE Plasma/Falkon issue.

I've checked the relevant function in Qt (http://code.qt.io/cgit/qt/qtbase.git/tree/src/platformsupport/services/genericunix/qgenericunixservices.cpp?h=5.9.5#n106) If xdg-open is not available, Qt checks for kmfclient on KDE. If that check fails, it checks for well-known browsers. That last check explains why Firefox was opened although Falkon was the default browser.

Maybe Falkon should be added upstream into the "if (desktop == QByteArray("KDE"))" section.
Comment 8 David Rosca 2018-05-02 10:03:22 UTC
xdg-open is standard desktop utility, it should be installed by default with all desktop environments. If not, you should probably report bug to your distribution.