[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/konsole/konsole
From:       Kurt Hindenburg <kurt.hindenburg () kdemail ! net>
Date:       2006-04-30 23:23:33
Message-ID: 1146439413.479977.16696.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 536013 by hindenburg:

Verify that the command is executable for '-e <command>.'

CCBUG: 125977


 M  +15 -2     session.cpp  


--- trunk/KDE/kdebase/apps/konsole/konsole/session.cpp #536012:536013
@@ -7,6 +7,9 @@
 #include <knotifyclient.h>
 #include <klocale.h>
 #include <kprocio.h>
+#include <krun.h>
+#include <kshell.h>
+#include <kstandarddirs.h>
 
 #include <stdlib.h>
 #include <qfile.h>
@@ -128,8 +131,18 @@
 
 void TESession::run()
 {
-  //kDebug(1211) << "Running the session!" << pgm << "\n";
-  //pgm = "pine";
+  // Upon a KPty error, there is no description on what that error was...
+  // Check to see if the given program is executable.
+  QString exec = QFile::encodeName(pgm);
+  exec = KRun::binaryName(exec, false);
+  exec = KShell::tildeExpand(exec);
+  QString pexec = KGlobal::dirs()->findExe(exec);
+  if ( pexec.isEmpty() ) {
+    kdError()<<"can not execute "<<exec<<endl;
+    QTimer::singleShot(1, this, SLOT(done()));
+    return;
+  }
+
   QString appId=kapp->dcopClient()->appId();
 
   QString cwd_save = QDir::currentPath();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic