Version: (using KDE KDE 3.5.0)
Installed from: Mandriva RPMs
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.
"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
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.
M +6 -3 kopenwithdialog.cpp
M +3 -3 kpropertiesdialog.cpp
WebSVN link: http://websvn.kde.org/?view=rev&revision=782227