Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
aa75fc8f
Commit
aa75fc8f
authored
Mar 10, 2012
by
Jekyll Wu
Browse files
konsole -e 'man ls' should work as expected
BUG: 295648
FIXED-IN: 4.9.0
parent
cd090f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Application.cpp
View file @
aa75fc8f
...
...
@@ -38,6 +38,7 @@
#include
"SessionManager.h"
#include
"MainWindow.h"
#include
"Session.h"
#include
"ShellCommand.h"
using
namespace
Konsole
;
...
...
@@ -375,12 +376,25 @@ Profile::Ptr Application::processProfileChangeArgs(KCmdLineArgs* args, Profile::
// run a custom command
if
(
args
->
isSet
(
"e"
)
)
{
QString
commandExec
;
QStringList
commandArguments
;
commandArguments
<<
args
->
getOption
(
"e"
);
for
(
int
i
=
0
;
i
<
args
->
count
()
;
i
++
)
commandArguments
<<
args
->
arg
(
i
);
QString
commandExec
=
args
->
getOption
(
"e"
);
// 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"
);
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
);
...
...
src/ShellCommand.h
View file @
aa75fc8f
...
...
@@ -23,6 +23,9 @@
// Qt
#include
<QtCore/QStringList>
// Konsole
#include
"konsole_export.h"
namespace
Konsole
{
...
...
@@ -47,7 +50,7 @@ namespace Konsole
* </li>
* </ul>
*/
class
ShellCommand
class
KONSOLEPRIVATE_EXPORT
ShellCommand
{
public:
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment