Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp index b32b323..200e31b 100644 --- a/noncore/settings/networksettings2/main.cpp +++ b/noncore/settings/networksettings2/main.cpp | |||
@@ -42,48 +42,49 @@ int main( int argc, char * argv[] ) { | |||
42 | rmv = 0; | 42 | rmv = 0; |
43 | if( strcmp( argv[i], "--regen" ) == 0 ) { | 43 | if( strcmp( argv[i], "--regen" ) == 0 ) { |
44 | Action = ACT_REGEN; | 44 | Action = ACT_REGEN; |
45 | GuiType = QApplication::Tty; | 45 | GuiType = QApplication::Tty; |
46 | rmv = 1; | 46 | rmv = 1; |
47 | } else if( strcmp( argv[i], "--prompt" ) == 0 ) { | 47 | } else if( strcmp( argv[i], "--prompt" ) == 0 ) { |
48 | Action = ACT_PROMPT; | 48 | Action = ACT_PROMPT; |
49 | rmv = 1; | 49 | rmv = 1; |
50 | } else if( strcmp( argv[i], "--triggervpn" ) == 0 ) { | 50 | } else if( strcmp( argv[i], "--triggervpn" ) == 0 ) { |
51 | Action = ACT_VPN; | 51 | Action = ACT_VPN; |
52 | rmv = 1; | 52 | rmv = 1; |
53 | } | 53 | } |
54 | if( rmv ) { | 54 | if( rmv ) { |
55 | memmove( argv+i, argv+i+rmv, | 55 | memmove( argv+i, argv+i+rmv, |
56 | sizeof( char * ) * (argc-i-rmv) ); | 56 | sizeof( char * ) * (argc-i-rmv) ); |
57 | i --; | 57 | i --; |
58 | argc -= rmv; | 58 | argc -= rmv; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | if( strstr( argv[0], "-request" ) ) { | 62 | if( strstr( argv[0], "-request" ) ) { |
63 | // called from system to request something | 63 | // called from system to request something |
64 | GuiType = QApplication::Tty; | 64 | GuiType = QApplication::Tty; |
65 | Action = ACT_REQUEST; | 65 | Action = ACT_REQUEST; |
66 | Log(("Request : %s\n", argv[1] )); | ||
66 | } | 67 | } |
67 | 68 | ||
68 | // Start Qt | 69 | // Start Qt |
69 | #ifdef _WS_QWS_ | 70 | #ifdef _WS_QWS_ |
70 | // because QPEApplication does not handle GuiType well | 71 | // because QPEApplication does not handle GuiType well |
71 | if( GuiType == QApplication::Tty ) { | 72 | if( GuiType == QApplication::Tty ) { |
72 | // this cast is NOT correct but we do not use | 73 | // this cast is NOT correct but we do not use |
73 | // TheApp anymore ... | 74 | // TheApp anymore ... |
74 | TheApp = (QPEApplication *)new QApplication( argc, argv, GuiType ); | 75 | TheApp = (QPEApplication *)new QApplication( argc, argv, GuiType ); |
75 | } else { | 76 | } else { |
76 | TheApp = new QPEApplication( argc, argv, GuiType ); | 77 | TheApp = new QPEApplication( argc, argv, GuiType ); |
77 | } | 78 | } |
78 | #else | 79 | #else |
79 | TheApp = new QApplication( argc, argv, GuiType ); | 80 | TheApp = new QApplication( argc, argv, GuiType ); |
80 | #endif | 81 | #endif |
81 | 82 | ||
82 | // init qt with app widget | 83 | // init qt with app widget |
83 | 84 | ||
84 | switch( Action ) { | 85 | switch( Action ) { |
85 | case ACT_REQUEST : | 86 | case ACT_REQUEST : |
86 | { NetworkSettingsData NS; | 87 | { NetworkSettingsData NS; |
87 | if( NS.canStart( argv[1] ) ) { | 88 | if( NS.canStart( argv[1] ) ) { |
88 | QString S; | 89 | QString S; |
89 | S.sprintf( QPEApplication::qpeDir()+ | 90 | S.sprintf( QPEApplication::qpeDir()+ |