Bug 119263 - Association with an executable whose name starts with "run-" does not work
Summary: Association with an executable whose name starts with "run-" does not work
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-30 20:29 UTC by gambas
Modified: 2008-03-04 17:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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