Bug 318509

Summary: Remove superfluous .protocol files from source tree once we depend on kdelibs 4.9.3+
Product: [Applications] konversation Reporter: Bernhard Scheirle <bernhard+kde>
Component: generalAssignee: Konversation Developers <konversation-devel>
Status: RESOLVED FIXED    
Severity: minor CC: argonel, faure, hein
Priority: LO    
Version: 1.5-rc1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
URL: irc://freenode.net/SomeChannel
Latest Commit: Version Fixed In: 1.7
Sentry Crash Report:

Description Bernhard Scheirle 2013-04-17 16:02:41 UTC
Clicking on a link like: 
irc://freenode.net/SomeChannel 
or
ircs://freenode.net/SomeChannel (Generated via Konversations own bookmark service)
has no effect.

Reproducible: Always

Steps to Reproduce:
1. Enter "irc://freenode.net/SomeChannel" in your Browser address line. 
2. Press Enter
Actual Results:  
Now Konversation becomes active. But it won't connect to the given server nor joins the channel if you are already connected.

Expected Results:  
Connect to the server and join the channel.
Comment 1 Eike Hein 2013-04-18 04:41:37 UTC
Can you see what happens when you run "konversation irc://freenode.net/SomeChannel" in a terminal? To cut the browser out of the loop as a possible error source.
Comment 2 Bernhard Scheirle 2013-04-18 04:59:20 UTC
Ok, with the direct command it works. So this is a rekonq/konqueror bug?
Comment 3 Eike Hein 2013-04-18 06:29:40 UTC
I'm not sure what's causing it so far, but I can reproduce it here. The *.protocol files Konversation installs to register itself for irc:// and other URL protocols haven't changed in many years however, and still look correct to me. I'm not sure why it's no longer working.
Comment 4 Eike Hein 2013-04-18 06:31:02 UTC
Adding David Faure to the CC list, who is the expert for all things Konqueror and associations in general.
Comment 5 David Faure 2013-04-18 07:25:45 UTC
Sounds like a missing %u in the Exec line of the .protocol or .desktop file, then.

Note: installing irc.protocol is the old way (which should still work, but not if some apps use the new way).

Does konversation's desktop have the mimetype x-scheme-handler/irc ? That's the new way.
(freedesktop-compatible)
Comment 6 Eike Hein 2013-04-18 07:28:19 UTC
The .protocol does "exec=konversation %u", yep.

And the .desktop file contains "MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;".

And yet "konversation <url>" in the terminal works, but the same URL from the Konqueror address bar, or an embedded Link in KHTML, only raises the window ..
Comment 7 David Faure 2013-04-18 11:07:08 UTC
Yes but you missed the important bit: konversation.desktop doesn't have %u on its Exec line.

So kdelibs thinks this app doesn't support urls, and tries to download the url to a local file before calling the app.
Add %u to konversation.desktop's exec line, and the bug will go away.

It's not a problem for the case where the app is launched without a URL: the %u will simply be expanded to nothing.

Also note that you can probably get rid of the .protocol file nowadays (depends on which old kdelibs you want to support).
Comment 8 Bernhard Scheirle 2013-04-18 15:31:06 UTC
I can confirm that after adding "%u" to the desktop file, irc links behave as expected.
Comment 9 Eike Hein 2013-04-18 17:02:04 UTC
And I guess the reason it used to work before is because it used to use the .protocol files instead.

David, what's the lowest version of kdelibs supporting the new scheme?
Comment 10 Eike Hein 2013-04-18 17:40:24 UTC
Git commit 8d69441eca6ea3e0818634af51c75a39658e16a2 by Eike Hein.
Committed on 18/04/2013 at 19:37.
Pushed by hein into branch '1.4'.

Let kdelibs know we support URLs.

M  +1    -1    data/konversation.desktop

http://commits.kde.org/konversation/8d69441eca6ea3e0818634af51c75a39658e16a2
Comment 11 David Faure 2013-04-19 06:58:29 UTC
I should have guessed the question would come up rather than lazily hoping it wouldn't :)

a8c6a38c4a6b78a9d78ba014b2a5e8a03f6387e7 is in KDE 4.5 and following.
Comment 12 David Faure 2013-04-19 06:59:46 UTC
Ah, but until 4.9.3, a .protocol file from another irc app would have precedence over a .desktop file x-scheme-handler. I fixed that in 7404764264e7dbe5a69afcbc2cc2a26d43cd3a7f
Comment 13 Eike Hein 2013-04-20 00:06:52 UTC
OK, then I'll think we'll keep the .protocol files around until we depend on 4.9. Thanks David.
Comment 14 Christoph Feck 2015-05-17 11:44:12 UTC
Eike, what is the status of comment #13?
Comment 15 Eike Hein 2015-05-17 23:41:30 UTC
Thanks for the reminder, I'll take care of removing them.
Comment 16 Eike Hein 2015-05-17 23:43:21 UTC
Git commit c2d50532ab328340a797475403e37b66ca562987 by Eike Hein.
Committed on 17/05/2015 at 23:42.
Pushed by hein into branch 'master'.

Remove .protocol files.

KF5 always gives precedence to x-scheme-handler.

D  +0    -11   data/konvirc.protocol
D  +0    -11   data/konvirc6.protocol
D  +0    -11   data/konvircs.protocol

http://commits.kde.org/konversation/c2d50532ab328340a797475403e37b66ca562987