author | zecke <zecke> | 2002-10-31 16:14:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-31 16:14:20 (UTC) |
commit | d2a79869efe8b18849e45b8e1beedb5108eba6ac (patch) (unidiff) | |
tree | 98b5d50f696d2d411cd287f4fe1bc7e1c0f7b7a2 | |
parent | c3a6f53669140cf9e3c953772c610cd91d69ab78 (diff) | |
download | opie-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
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/opie-console/consoleconfigwidget.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 2 |
3 files changed, 22 insertions, 2 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 | } |
292 | void MyPty::reload( const Profile& prof) { | 292 | void 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), ""); |
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp index 70e2e78..3f2d154 100644 --- a/noncore/apps/opie-console/consoleconfigwidget.cpp +++ b/noncore/apps/opie-console/consoleconfigwidget.cpp | |||
@@ -64,6 +64,11 @@ ConsoleConfigWidget::~ConsoleConfigWidget() { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | void ConsoleConfigWidget::load( const Profile& prof ) { | 66 | void ConsoleConfigWidget::load( const Profile& prof ) { |
67 | /* | ||
68 | * we will use /bin/bash as default | ||
69 | * but will fallback in MyPty to /bin/sh | ||
70 | * if necessary | ||
71 | */ | ||
67 | m_cmd->setText(prof.readEntry("Command", "/bin/bash")); | 72 | m_cmd->setText(prof.readEntry("Command", "/bin/bash")); |
68 | int envcount = prof.readNumEntry("EnvVars", 0); | 73 | int envcount = prof.readNumEntry("EnvVars", 0); |
69 | for (int i=0; i<envcount; i++) { | 74 | for (int i=0; i<envcount; i++) { |
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index fd04b6b..6b607df 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -200,7 +200,7 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) { | |||
200 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it | 200 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it |
201 | // supports auto connect and then set it as prefered | 201 | // supports auto connect and then set it as prefered |
202 | //if ( ( )->layer()->supports()[0] == 1 ) { | 202 | //if ( ( )->layer()->supports()[0] == 1 ) { |
203 | if ( m_conCmb ->currentText() == tr("local Console") ) { | 203 | if ( m_conCmb ->currentText() == tr("Local Console") ) { |
204 | m_autoConnect->setChecked( true ); | 204 | m_autoConnect->setChecked( true ); |
205 | } else { | 205 | } else { |
206 | m_autoConnect->setChecked( false ); | 206 | m_autoConnect->setChecked( false ); |