author | llornkcor <llornkcor> | 2002-06-27 02:14:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-27 02:14:01 (UTC) |
commit | 0d681c6866a9f5148b47f236e39db07739a80277 (patch) (unidiff) | |
tree | 9064c866511de26f779c41187de722fe9e9d4b09 | |
parent | ddb50e049fad86aa83e196117a062fc67ff2fe7d (diff) | |
download | opie-0d681c6866a9f5148b47f236e39db07739a80277.zip opie-0d681c6866a9f5148b47f236e39db07739a80277.tar.gz opie-0d681c6866a9f5148b47f236e39db07739a80277.tar.bz2 |
test was sucessful, reverting to non grab'd keyboard
-rw-r--r-- | core/apps/embeddedkonsole/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/embeddedkonsole/main.cpp b/core/apps/embeddedkonsole/main.cpp index 95adab8..167b009 100644 --- a/core/apps/embeddedkonsole/main.cpp +++ b/core/apps/embeddedkonsole/main.cpp | |||
@@ -1,67 +1,67 @@ | |||
1 | /* ---------------------------------------------------------------------- */ | 1 | /* ---------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [main.C] Konsole */ | 3 | /* [main.C] Konsole */ |
4 | /* */ | 4 | /* */ |
5 | /* ---------------------------------------------------------------------- */ | 5 | /* ---------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole, an X terminal. */ | 9 | /* This file is part of Konsole, an X terminal. */ |
10 | /* */ | 10 | /* */ |
11 | /* The material contained in here more or less directly orginates from */ | 11 | /* The material contained in here more or less directly orginates from */ |
12 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ | 12 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ |
13 | /* */ | 13 | /* */ |
14 | /* ---------------------------------------------------------------------- */ | 14 | /* ---------------------------------------------------------------------- */ |
15 | /* */ | 15 | /* */ |
16 | /* Ported Konsole to Qt/Embedded */ | 16 | /* Ported Konsole to Qt/Embedded */ |
17 | /* */ | 17 | /* */ |
18 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 18 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
19 | /* */ | 19 | /* */ |
20 | /* -------------------------------------------------------------------------- */ | 20 | /* -------------------------------------------------------------------------- */ |
21 | 21 | ||
22 | #include "konsole.h" | 22 | #include "konsole.h" |
23 | 23 | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | 25 | ||
26 | #include <qfile.h> | 26 | #include <qfile.h> |
27 | 27 | ||
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | 31 | ||
32 | 32 | ||
33 | /* --| main |------------------------------------------------------ */ | 33 | /* --| main |------------------------------------------------------ */ |
34 | int main(int argc, char* argv[]) | 34 | int main(int argc, char* argv[]) |
35 | { | 35 | { |
36 | if(setuid(getuid()) !=0) qDebug("setuid failed"); | 36 | if(setuid(getuid()) !=0) qDebug("setuid failed"); |
37 | if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges | 37 | if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges |
38 | 38 | ||
39 | QPEApplication a( argc, argv ); | 39 | QPEApplication a( argc, argv ); |
40 | 40 | ||
41 | QPEApplication::grabKeyboard(); // for CTRL and ALT | 41 | // QPEApplication::grabKeyboard(); // for CTRL and ALT |
42 | 42 | ||
43 | qDebug("keyboard grabbed"); | 43 | qDebug("keyboard grabbed"); |
44 | #ifdef FAKE_CTRL_AND_ALT | 44 | #ifdef FAKE_CTRL_AND_ALT |
45 | qDebug("Fake Ctrl and Alt defined"); | 45 | qDebug("Fake Ctrl and Alt defined"); |
46 | // QPEApplication::grabKeyboard(); // for CTRL and ALT | 46 | QPEApplication::grabKeyboard(); // for CTRL and ALT |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | QStrList tmp; | 49 | QStrList tmp; |
50 | const char* shell = getenv("SHELL"); | 50 | const char* shell = getenv("SHELL"); |
51 | if (shell == NULL || *shell == '\0') | 51 | if (shell == NULL || *shell == '\0') |
52 | shell = "/bin/sh"; | 52 | shell = "/bin/sh"; |
53 | 53 | ||
54 | // sh is completely broken on familiar. Let's try to get something better | 54 | // sh is completely broken on familiar. Let's try to get something better |
55 | if ( qstrcmp( shell, "/bin/shell" ) == 0 && QFile::exists( "/bin/bash" ) ) | 55 | if ( qstrcmp( shell, "/bin/shell" ) == 0 && QFile::exists( "/bin/bash" ) ) |
56 | shell = "/bin/bash"; | 56 | shell = "/bin/bash"; |
57 | 57 | ||
58 | if( putenv((char*)"COLORTERM=") !=0) | 58 | if( putenv((char*)"COLORTERM=") !=0) |
59 | qDebug("putenv failed"); // to trigger mc's color detection | 59 | qDebug("putenv failed"); // to trigger mc's color detection |
60 | 60 | ||
61 | Konsole m( "test", shell, tmp, TRUE ); | 61 | Konsole m( "test", shell, tmp, TRUE ); |
62 | m.setCaption( Konsole::tr("Terminal") ); | 62 | m.setCaption( Konsole::tr("Terminal") ); |
63 | a.showMainWidget( &m ); | 63 | a.showMainWidget( &m ); |
64 | 64 | ||
65 | return a.exec(); | 65 | return a.exec(); |
66 | } | 66 | } |
67 | 67 | ||