mirror of
https://github.com/KDE/konsole.git
synced 2026-05-03 04:04:18 -04:00
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 aa75fc8fee
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user