| Summary: | User created sessions with "~" (like "~/somescript") in execute field or error in command doesn't appear in menu | ||
|---|---|---|---|
| Product: | [Applications] konsole | Reporter: | Dmitriy Ulupov <dima> |
| Component: | general | Assignee: | Konsole Bugs <konsole-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Dmitriy Ulupov
2005-03-31 16:23:51 UTC
And some more. If I save new session with name "123", with "~/tools/connect" in execute field and start Konsole with a command: konsole --type 123 ... everything works! It opens new session 123 and executes ~/tools/connect Yes and yes... thanks for the info. This has been fixed... Replace ~ with homeDirPath in Session's Exec entries. BUG: 102941 M +1 -1 konsole.cpp 1.526 --- kdebase/konsole/konsole/konsole.cpp #1.525:1.526 @@ -3069,4 +3068,5 @@ void Konsole::addSessionCommand(const QS } + exec = exec.replace( "~", QDir::homeDirPath() ); exec = KRun::binaryName(exec, false); QString pexec = KGlobal::dirs()->findExe(exec); Hmm... that doesn't look right. ~ alone is $HOME but ~thiago should point to thiago's HOME. In other words: $ echo ~ /home/thiago $ echo ~thiago /home/thiago but: $ echo \~ | sed "s,~,$HOME," /home/thiago $ echo \~thiago | sed "s,~,$HOME," /home/thiagothiago Well, something is wrong with using BUGS: and CCMAIL in CVS commits tonight:
CVS commit by hindenburg:
Try this again... expand ~ in Exec=~/script
Qt/KDE needs a function for this.
CCBUGS: 102941
M +13 -2 konsole.cpp 1.527
--- kdebase/konsole/konsole/konsole.cpp #1.526:1.527
@@ -3068,7 +3068,18 @@ void Konsole::addSessionCommand(const QS
}
- exec = exec.replace( "~", QDir::homeDirPath() );
exec = KRun::binaryName(exec, false);
+
+ if ( exec.startsWith( "~/" ) ) { // ~/script
+ exec = exec.remove( 0, 1 ); // ~
+ exec = exec.prepend( QDir::homeDirPath() );
+ } else if ( exec.startsWith( "~" ) ) { // ~user/script
+ // FIXME: What do when ~user != ~ ?
+ // We could check that user == current user... blah!
+ kdWarning()<<"Unable to handle Exec=~user/ (use ~/ or full path): "<<exec<<" in "<<path.latin1()<<endl;
+ return; // ignore
+ }
+
QString pexec = KGlobal::dirs()->findExe(exec);
+
if (typ.isEmpty() || txt.isEmpty() || typ != "KonsoleApplication"
|| ( !exec.isEmpty() && pexec.isEmpty() ) )
@@ -3076,6 +3087,6 @@ void Konsole::addSessionCommand(const QS
if (!path.isEmpty())
delete co;
+ kdWarning()<<"Unable to use "<<path.latin1()<<endl;
return; // ignore
-
}
test - ignore CVS commit by hindenburg:
Use KShell::tildeExpand (thanks ossi).
CCBUGS: 102941
M +2 -11 konsole.cpp 1.528
--- kdebase/konsole/konsole/konsole.cpp #1.527:1.528
@@ -109,4 +109,5 @@ Time to start a requirement list.
#include <kaction.h>
+#include <kshell.h>
#include <qlabel.h>
#include <kpopupmenu.h>
@@ -3069,15 +3070,5 @@ void Konsole::addSessionCommand(const QS
exec = KRun::binaryName(exec, false);
-
- if ( exec.startsWith( "~/" ) ) { // ~/script
- exec = exec.remove( 0, 1 ); // ~
- exec = exec.prepend( QDir::homeDirPath() );
- } else if ( exec.startsWith( "~" ) ) { // ~user/script
- // FIXME: What do when ~user != ~ ?
- // We could check that user == current user... blah!
- kdWarning()<<"Unable to handle Exec=~user/ (use ~/ or full path): "<<exec<<" in "<<path.latin1()<<endl;
- return; // ignore
- }
-
+ exec = KShell::tildeExpand(exec);
QString pexec = KGlobal::dirs()->findExe(exec);
|