Bug 65085 - KHotKeys doesn't recognize command parameters
Summary: KHotKeys doesn't recognize command parameters
Status: RESOLVED FIXED
Alias: None
Product: khotkeys
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Lubos Lunak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-28 15:39 UTC by Mikko Ikola
Modified: 2006-02-23 17:43 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 Mikko Ikola 2003-09-28 15:39:55 UTC
Version:           2.0pre2 (using KDE KDE 3.1.91)
Installed from:    Debian testing/unstable Packages
OS:          Linux

If you for e.g. assign a command xterm -fg white -bg black for shortcut alt+e, xterm starts with white background and black letters. It should start with black background and white letters. It seems that KHotKeys doesn't recognize parameters.
Comment 1 Teemu Rytilahti 2003-09-28 15:42:44 UTC
And it doesn't work when using from kmenuedit, either.. 
Comment 2 Lubos Lunak 2003-09-29 13:08:15 UTC
Subject: kdebase/khotkeys/shared [POSSIBLY UNSAFE]

CVS commit by lunakl: 

Fix #65085.
CCMAIL: 65085-done@bugs.kde.org


  M +11 -6     actions.cpp   1.4 [POSSIBLY UNSAFE: KRun::runCommand]


--- kdebase/khotkeys/shared/actions.cpp  #1.3:1.4
@@ -117,12 +117,16 @@ void Command_url_action::execute()
     if( command_url().isEmpty())
         return;
-    int space_pos = command_url().find( ' ' );
     KURIFilterData uri;
     QString cmd = command_url();
-    if( command_url()[ 0 ] != '\'' && command_url()[ 0 ] != '"' && space_pos > -1
-        && command_url()[ space_pos - 1 ] != '\\' )
-        cmd = command_url().left( space_pos ); // get first 'word'
+//    int space_pos = command_url().find( ' ' );
+//    if( command_url()[ 0 ] != '\'' && command_url()[ 0 ] != '"' && space_pos > -1
+//        && command_url()[ space_pos - 1 ] != '\\' )
+//        cmd = command_url().left( space_pos ); // get first 'word'
     uri.setData( cmd );
     KURIFilter::self()->filterURI( uri );
+    if( uri.uri().isLocalFile() && !uri.uri().hasRef() )
+        cmd = uri.uri().path();
+    else
+        cmd = uri.uri().url();
     switch( uri.uriType())
         {
@@ -154,6 +158,7 @@ void Command_url_action::execute()
             if (!kapp->authorize("shell_access"))
                 return;
-            if( !KRun::runCommand( cmd,
-                cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ), uri.iconName()))
+            if( !KRun::runCommand(
+                cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ),
+                cmd, uri.iconName()))
                 // CHECKME ?
                 ;


Comment 3 Grzegorz Oledzki 2006-02-20 16:48:42 UTC
I am using KDE 3.5.1 on Ubuntu Dapper and it doesn't work. It doesn't understand passed parameters when defining a command in khotkeys.
How can I reopen the bug?
Comment 4 Lubos Lunak 2006-02-23 17:43:49 UTC
Works fine for me here. Can you attach your khotkeysrc with only the one action that doesn't work?