summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp17
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp5
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp2
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
@@ -282,25 +282,40 @@ bool MyPty::open() {
if (m_fd < 0)
m_fd = openPty();
start();
return true;
}
void MyPty::close() {
donePty();
m_fd = openPty();
}
void MyPty::reload( const Profile& prof) {
m_env.clear();
- m_cmd = prof.readEntry("Command", "/bin/bash");
+ m_cmd = prof.readEntry("Command", "/bin/sh");
+
+ /*
+ * Lets check if m_cmd actually
+ * exists....
+ * we try to use bin/bash and if
+ * this fails we
+ * will fallback to /bin/sh
+ * which should be there 100%
+ */
+ if ( !QFile::exists(QFile::encodeName(m_cmd) ) )
+ if (QFile::exists("/bin/bash") )
+ m_cmd = "/bin/bash";
+ else
+ m_cmd = "/bin/sh";
+
int envcount = prof.readNumEntry("EnvVars", 0);
for (int i=0; i<envcount; i++) {
QString name = prof.readEntry("Env_Name_" + QString::number(i), "");
QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
if (!(name.isEmpty() || value.isEmpty())) {
m_env.insert(name, value);
}
}
}
/*! sends len bytes through the line */
void MyPty::send(const QByteArray& ar)
{
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
@@ -55,24 +55,29 @@ void ConsoleConfigWidget::slotAdd() {
void ConsoleConfigWidget::slotRemove() {
QListViewItem *item = m_env->currentItem();
if (item) {
m_env->takeItem(item);
}
}
ConsoleConfigWidget::~ConsoleConfigWidget() {
}
void ConsoleConfigWidget::load( const Profile& prof ) {
+ /*
+ * we will use /bin/bash as default
+ * but will fallback in MyPty to /bin/sh
+ * if necessary
+ */
m_cmd->setText(prof.readEntry("Command", "/bin/bash"));
int envcount = prof.readNumEntry("EnvVars", 0);
for (int i=0; i<envcount; i++) {
QString name = prof.readEntry("Env_Name_" + QString::number(i), "");
QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
if (!(name.isEmpty() || value.isEmpty())) {
QListViewItem *item = new QListViewItem(m_env);
item->setText(0, name);
item->setText(1, value);
m_env->insertItem(item);
}
}
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
@@ -191,25 +191,25 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
delete m_con;
m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() );
if ( !m_con ) {
m_con = new NoOptions( str, m_svCon->viewport(), "name");
}
// FIXME ugly hack right. Right solution would be to look into the layer and see if it
// supports auto connect and then set it as prefered
//if ( ( )->layer()->supports()[0] == 1 ) {
- if ( m_conCmb ->currentText() == tr("local Console") ) {
+ if ( m_conCmb ->currentText() == tr("Local Console") ) {
m_autoConnect->setChecked( true );
} else {
m_autoConnect->setChecked( false );
}
m_con->load( m_prof );
m_svCon->addChild( m_con );
}
/*
* we need to switch the widget