summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/consoleconfigwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/consoleconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp
index 3f2d154..faedc58 100644
--- a/noncore/apps/opie-console/consoleconfigwidget.cpp
+++ b/noncore/apps/opie-console/consoleconfigwidget.cpp
@@ -8,6 +8,10 @@
8#include <qregexp.h> 8#include <qregexp.h>
9#include <stdio.h> 9#include <stdio.h>
10 10
11#include <pwd.h>
12#include <sys/types.h>
13
14
11#include "consoleconfigwidget.h" 15#include "consoleconfigwidget.h"
12 16
13ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, 17ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
@@ -65,11 +69,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() {
65 69
66void ConsoleConfigWidget::load( const Profile& prof ) { 70void ConsoleConfigWidget::load( const Profile& prof ) {
67 /* 71 /*
68 * we will use /bin/bash as default 72 * default to the users default shell
69 * but will fallback in MyPty to /bin/sh
70 * if necessary
71 */ 73 */
72 m_cmd->setText(prof.readEntry("Command", "/bin/bash")); 74 struct passwd *ent = 0;
75 char *shell = "/bin/sh";
76
77 while ( (ent = getpwent()) != 0 ) {
78 if (ent->pw_shell != "") {
79 shell = ent->pw_shell;
80 }
81 }
82
83 m_cmd->setText(prof.readEntry("Command", shell ));
73 int envcount = prof.readNumEntry("EnvVars", 0); 84 int envcount = prof.readNumEntry("EnvVars", 0);
74 for (int i=0; i<envcount; i++) { 85 for (int i=0; i<envcount; i++) {
75 QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); 86 QString name = prof.readEntry("Env_Name_" + QString::number(i), "");