From 4d194b20c055a68fb72f2f41b5a67c7afa6d51f7 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Thu, 1 Nov 2012 13:28:55 +0800 Subject: [PATCH] Revert the support for konsole -e "command arguemnts" Although that looks like a nice feature, it makes the code more complicated and causes problems when that command is an absolute path containing spaces. So for now the only supported way is: konsole -e command arguments CCBUG: 295648 This reverts commit aa75fc8fee7e55e0c78640fcbed0bf0627ba7971 --- src/Application.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index a8bbc87c0..aaaccf3b4 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -36,7 +36,6 @@ #include "ProfileManager.h" #include "MainWindow.h" #include "Session.h" -#include "ShellCommand.h" using namespace Konsole; @@ -399,24 +398,17 @@ Profile::Ptr Application::processProfileChangeArgs(KCmdLineArgs* args, Profile:: // run a custom command if (args->isSet("e")) { - QString commandExec; + QString commandExec = args->getOption("e"); QStringList commandArguments; + //commandArguments << args->getOption("e"); + commandArguments << commandExec; + // Note: KCmdLineArgs::count() return the number of arguments // that aren't options. - if (args->count() > 0) { // example: konsole -e man ls - commandExec = args->getOption("e"); + for ( int i = 0 ; i < args->count() ; i++ ) + commandArguments << args->arg(i); - commandArguments << commandExec; - for (int i = 0 ; i < args->count() ; i++) - commandArguments << args->arg(i); - - } else { // example: konsole -e "man ls" - ShellCommand shellCommand(args->getOption("e")); - - commandExec = shellCommand.command(); - commandArguments = shellCommand.arguments(); - } if (commandExec.startsWith(QLatin1String("./"))) commandExec = QDir::currentPath() + commandExec.mid(1);