Bug 351280

Summary: Custom protocol doesn't work with kde-open
Product: [Frameworks and Libraries] frameworks-kio Reporter: Nikola Kovacs <nx.devnull>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED WORKSFORME    
Severity: minor CC: kdelibs-bugs-null, nate
Priority: NOR Keywords: triaged
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: protocol xml file
desktop file for helper script
helper shell script

Description Nikola Kovacs 2015-08-14 10:37:56 UTC
I was trying to register a custom protocol to open a file in kate by clicking a link in konsole, but it wouldn't work with kde-open.

Reproducible: Always

Steps to Reproduce:
1. download open-in-kate.sh, kateopen.xml and kateopen.desktop
2. move open-in-kate.sh into a directory that's in path (e.g. ~/bin), and modify the path in kateopen.desktop 
3. xdg-mime install --novendor kateopen.xml
4. xdg-desktop-menu install --novendor kateopen.desktop
5. xdg-mime default kateopen.desktop x-scheme-handler/kateopen
6. update-mime-database ~/.local/share/mime   
7. update-desktop-database ~/.local/share/applications 
8. kbuildsycoca5 (may or may not be necessary)
9. try kde-open kateopen:///some/file/here:12

Actual Results:  
kioclient(3551)/kio (KRun): #### NO SUPPORT FOR READING! 

Expected Results:  
kate opens with the file

"kioclient cat kateopen:///some/file" returned an error message that made more sense:

kioclient(2820): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol 'kateopen'.
" 

gnome-open works, kde-open does not.

I opened ~/.local/share/applications/mimeapps.list. The line

x-scheme-handler/kateopen=kateopen.desktop

was missing from "[Added Associations]", it was only present in "[Default Applications]".
Copy-pasting it into "[Added Associations]" fixed the problem. I don't know why it wasn't there, another custom protocol I made a while back (when I was using kde4) was present in both sections.

When trying to reproduce, the most reliable way to get it to detect the change in mimeapps.list (i.e. removing the line from Added Associations causes it to break, adding it back fixes it) is to run

update-mime-database ~/.local/share/mime  
update-desktop-database ~/.local/share/applications 
kbuildsycoca5 (sometimes multiple times)

I'm using Kubuntu 15.04 with the backports ppa, frameworks 5.12.0.
Comment 1 Nikola Kovacs 2015-08-14 10:38:45 UTC
Created attachment 94030 [details]
protocol xml file
Comment 2 Nikola Kovacs 2015-08-14 10:39:03 UTC
Created attachment 94031 [details]
desktop file for helper script
Comment 3 Nikola Kovacs 2015-08-14 10:39:36 UTC
Created attachment 94032 [details]
helper shell script
Comment 4 Nate Graham 2018-08-22 19:50:40 UTC
Does any of this work with xdg-open?
Comment 5 Andrew Crouthamel 2018-09-28 03:36:48 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Andrew Crouthamel 2018-10-29 02:05:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!