Bug 56211

Summary: Scripting in Actions uses paramater when it shouldn't
Product: quanta Reporter: Roland Seuhs <r>
Component: generalAssignee: András Manţia <amantia>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.1.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Roland Seuhs 2003-03-21 18:44:27 UTC
Version:           3.1.1 (using KDE 3.1.1)
Installed from:    compiled sources
Compiler:          gcc version 3.2
OS:          Linux (i686) release 2.4.19-4GB

When you select a script for an action and select "none" for imput, Quanta should run

/path/script.sh

(without parameter)
but instead it seems to run

/path/script.sh ""

(it inserts an empty parameter which screws up some scripts or programs)
Comment 1 András Manţia 2003-03-25 20:17:51 UTC
Subject: QUANTA_3_1_BRANCH: quanta

CVS commit by amantia: 

Fix starting of script actions which does not have parameters.

CCMAIL: 56211-done@bugs.kde.org


  M +1 -0      ChangeLog   1.90.2.47
  M +5 -2      quanta/toolbar/tagaction.cpp   1.20.2.7


--- quanta/ChangeLog  #1.90.2.46:1.90.2.47
@@ -5,4 +5,5 @@
     - fix ocassional crash when pressing Ctrl-H while viewing the documentation
     - fix user toolbar handling
+    - fix execution of script actions which does not have any argument [#56211]
     - fix shortcut for Color dialog [#56235]
     - store the upload options in the project file [#56237]

--- quanta/quanta/toolbar/tagaction.cpp  #1.20.2.6:1.20.2.7
@@ -170,5 +170,8 @@ void TagAction::insertTag()
       command = command.left(pos);
     }
-    *proc << command << args;
+    *proc << command.stripWhiteSpace();
+    args = args.stripWhiteSpace();
+    if (!args.isEmpty())
+      *proc << args;
     firstOutput = true;
     firstError  = true;