author | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
commit | 1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (unidiff) | |
tree | 3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/apps/opie-console/consoleconfigwidget.cpp | |
parent | e3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff) | |
download | opie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps/opie-console/consoleconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/consoleconfigwidget.cpp | 19 |
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 | |||
@@ -7,8 +7,12 @@ | |||
7 | #include <qhbox.h> | 7 | #include <qhbox.h> |
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 | ||
13 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, | 17 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, |
14 | const char* na ) | 18 | const char* na ) |
@@ -64,13 +68,20 @@ ConsoleConfigWidget::~ConsoleConfigWidget() { | |||
64 | } | 68 | } |
65 | 69 | ||
66 | void ConsoleConfigWidget::load( const Profile& prof ) { | 70 | void 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), ""); |
76 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); | 87 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); |