Bug 119263

Summary: Association with an executable whose name starts with "run-" does not work
Product: [Applications] systemsettings Reporter: gambas <g4mba5>
Component: kcm_filetypesAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description gambas 2005-12-30 20:29:37 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Mandriva RPMs
OS:                Linux

It seems that in KDE 3.5, running kate always creates a new instance. So I created a shell script named "run-kate" that opens the URL given in argument to the current instance of Kate with some DCOP calls.

Then I opened the control center to associate this program with the following mime types: text/x-chdr, text/x-c++hdr, text/x-csrc and text/x-c++src. I use as program name the full path "/home/benoit/bin/run-kate".

It didn't work. Only the first one was associated. 

I noticed that if a file named 'run-kate.desktop' was created, it contains only the first mime association.

Then I noticed that a 'kate.desktop' was created too, in a sub-directory named 'run'. Strange, isn't it? I think there is some strange interpretation of file names beginning with 'run-'.

Then I renamed my script from 'run-kate' to 'mykate', and everything started working.
Comment 1 David Faure 2008-03-04 13:34:10 UTC
"if a file named 'run-kate.desktop' was created, it contains only the first mime association"   -- that's because when you added the script to another mimetype, it then created a run-kate-2.desktop, it doesn't notice that it already created a desktop file for this script -- I'll have a look at that. But things should still work though.

I see what you mean about "run/kate.desktop", this was in applnk/.hidden I assume? Fixed in KDE4, it's now ~/.local/share/applications/run-kate.desktop
Comment 2 David Faure 2008-03-04 17:20:50 UTC
SVN commit 782227 by dfaure:

Don't use writePathEntry("Exec"), see -r730817 kservice.cpp. Otherwise after a few iterations I get Exec[$e]=$$$$$$$$HOME/bin/myscript...

With this fix, KPropertiesDialog finds an already-created .desktop file when typing the same script name twice.
BUG: 119263


 M  +6 -3      kopenwithdialog.cpp  
 M  +3 -3      kpropertiesdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=782227