summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
Unidiff
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
@@ -288,13 +288,28 @@ bool MyPty::open() {
288void MyPty::close() { 288void MyPty::close() {
289 donePty(); 289 donePty();
290 m_fd = openPty(); 290 m_fd = openPty();
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), "");
298 QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); 313 QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
299 if (!(name.isEmpty() || value.isEmpty())) { 314 if (!(name.isEmpty() || value.isEmpty())) {
300 m_env.insert(name, value); 315 m_env.insert(name, value);