summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
authorzecke <zecke>2002-10-31 16:14:20 (UTC)
committer zecke <zecke>2002-10-31 16:14:20 (UTC)
commitd2a79869efe8b18849e45b8e1beedb5108eba6ac (patch) (unidiff)
tree98b5d50f696d2d411cd287f4fe1bc7e1c0f7b7a2 /noncore/apps/opie-console/MyPty.cpp
parentc3a6f53669140cf9e3c953772c610cd91d69ab78 (diff)
downloadopie-d2a79869efe8b18849e45b8e1beedb5108eba6ac.zip
opie-d2a79869efe8b18849e45b8e1beedb5108eba6ac.tar.gz
opie-d2a79869efe8b18849e45b8e1beedb5108eba6ac.tar.bz2
Auto connect on Locale Console again!
MyPty test if cmd is available(exists) and then either use /bin/bash or /bin/sh ConsoleConfigWidget added a comment about the expected behaviour
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index b0f0275..c3c58be 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -291,7 +291,22 @@ void MyPty::close() {
291} 291}
292void MyPty::reload( const Profile& prof) { 292void MyPty::reload( const Profile& prof) {
293 m_env.clear(); 293 m_env.clear();
294 m_cmd = prof.readEntry("Command", "/bin/bash"); 294 m_cmd = prof.readEntry("Command", "/bin/sh");
295
296 /*
297 * Lets check if m_cmd actually
298 * exists....
299 * we try to use bin/bash and if
300 * this fails we
301 * will fallback to /bin/sh
302 * which should be there 100%
303 */
304 if ( !QFile::exists(QFile::encodeName(m_cmd) ) )
305 if (QFile::exists("/bin/bash") )
306 m_cmd = "/bin/bash";
307 else
308 m_cmd = "/bin/sh";
309
295 int envcount = prof.readNumEntry("EnvVars", 0); 310 int envcount = prof.readNumEntry("EnvVars", 0);
296 for (int i=0; i<envcount; i++) { 311 for (int i=0; i<envcount; i++) {
297 QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); 312 QString name = prof.readEntry("Env_Name_" + QString::number(i), "");