summaryrefslogtreecommitdiff
authoralwin <alwin>2004-03-02 19:39:28 (UTC)
committer alwin <alwin>2004-03-02 19:39:28 (UTC)
commit65497ae2d9fa41173930748dc104d00706268c41 (patch) (unidiff)
tree0f45ddf8339245f95f788885ad3378f63dc71963
parentdb1615def104b2637d9404ac0f1e3790a8d7731f (diff)
downloadopie-65497ae2d9fa41173930748dc104d00706268c41.zip
opie-65497ae2d9fa41173930748dc104d00706268c41.tar.gz
opie-65497ae2d9fa41173930748dc104d00706268c41.tar.bz2
fix so it will compile with gcc2 toolchain
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 8d0976f..6aa7287 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -1,382 +1,383 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "loginapplication.h" 28#include "loginapplication.h"
29#include "loginwindowimpl.h" 29#include "loginwindowimpl.h"
30#include "calibrate.h" 30#include "calibrate.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34#include <qpe/qpestyle.h> 34#include <qpe/qpestyle.h>
35#include <qpe/power.h> 35#include <qpe/power.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37 37
38/* QT */ 38/* QT */
39#include <qwindowsystem_qws.h> 39#include <qwindowsystem_qws.h>
40#include <qmessagebox.h> 40#include <qmessagebox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qfile.h> 43#include <qfile.h>
44 44
45/* STD */ 45/* STD */
46#include <sys/types.h> 46#include <sys/types.h>
47#include <time.h> 47#include <time.h>
48#include <sys/time.h> 48#include <sys/time.h>
49#include <sys/resource.h> 49#include <sys/resource.h>
50#include <unistd.h> 50#include <unistd.h>
51#include <syslog.h> 51#include <syslog.h>
52#include <sys/wait.h> 52#include <sys/wait.h>
53#include <stdio.h> 53#include <stdio.h>
54#include <stdlib.h> 54#include <stdlib.h>
55#include <signal.h> 55#include <signal.h>
56#include <getopt.h> 56#include <getopt.h>
57#include <string.h> 57#include <string.h>
58 58
59using namespace Opie; 59using namespace Opie;
60 60
61int login_main ( int argc, char **argv, pid_t ppid ); 61int login_main ( int argc, char **argv, pid_t ppid );
62void sigterm ( int sig ); 62void sigterm ( int sig );
63void sigint ( int sig ); 63void sigint ( int sig );
64void exit_closelog ( ); 64void exit_closelog ( );
65 65
66static struct option long_options [] = { 66static struct option long_options [] = {
67 { "autologin", 1, 0, 'a' }, 67 { "autologin", 1, 0, 'a' },
68 { 0, 0, 0, 0 } 68 { 0, 0, 0, 0 }
69}; 69};
70 70
71 71
72int main ( int argc, char **argv ) 72int main ( int argc, char **argv )
73{ 73{
74 int userExited = 0; 74 int userExited = 0;
75 pid_t ppid = ::getpid ( ); 75 pid_t ppid = ::getpid ( );
76 76
77 if ( ::geteuid ( ) != 0 ) { 77 if ( ::geteuid ( ) != 0 ) {
78 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); 78 ::fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] );
79 return 1; 79 return 1;
80 } 80 }
81 if ( ::getuid ( ) != 0 ) // qt doesn't really like SUID and 81 if ( ::getuid ( ) != 0 ) // qt doesn't really like SUID and
82 ::setuid ( 0 ); // messes up things like config files 82 ::setuid ( 0 ); // messes up things like config files
83 83
84 char *autolog = 0; 84 char *autolog = 0;
85 int c; 85 int c;
86 while (( c = ::getopt_long ( argc, argv, "a:", long_options, 0 )) != -1 ) { 86 while (( c = ::getopt_long ( argc, argv, "a:", long_options, 0 )) != -1 ) {
87 switch ( c ) { 87 switch ( c ) {
88 case 'a': 88 case 'a':
89 autolog = optarg; 89 autolog = optarg;
90 break; 90 break;
91 default: 91 default:
92 ::fprintf ( stderr, "Usage: %s [-a|--autologin=<user>]\n", argv [0] ); 92 ::fprintf ( stderr, "Usage: %s [-a|--autologin=<user>]\n", argv [0] );
93 return 2; 93 return 2;
94 } 94 }
95 } 95 }
96 96
97 //struct rlimit rl; 97 //struct rlimit rl;
98 //::getrlimit ( RLIMIT_NOFILE, &rl ); 98 //::getrlimit ( RLIMIT_NOFILE, &rl );
99 99
100 //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) 100 //for ( unsigned int i = 0; i < rl. rlim_cur; i++ )
101 // ::close ( i ); 101 // ::close ( i );
102 102
103 ::setpgid ( 0, 0 ); 103 ::setpgid ( 0, 0 );
104 ::setsid ( ); 104 ::setsid ( );
105 105
106 ::signal ( SIGTERM, sigterm ); 106 ::signal ( SIGTERM, sigterm );
107 ::signal ( SIGINT, sigterm ); 107 ::signal ( SIGINT, sigterm );
108 108
109 ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); 109 ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV );
110 ::atexit ( exit_closelog ); 110 ::atexit ( exit_closelog );
111 111
112 while ( true ) { 112 while ( true ) {
113 pid_t child = ::fork ( ); 113 pid_t child = ::fork ( );
114 114
115 if ( child < 0 ) { 115 if ( child < 0 ) {
116 ::syslog ( LOG_ERR, "Could not fork GUI process\n" ); 116 ::syslog ( LOG_ERR, "Could not fork GUI process\n" );
117 break; 117 break;
118 } 118 }
119 else if ( child > 0 ) { 119 else if ( child > 0 ) {
120 int status = 0; 120 int status = 0;
121 time_t started = ::time ( 0 ); 121 time_t started = ::time ( 0 );
122 122
123 while ( ::waitpid ( child, &status, 0 ) < 0 ) { } 123 while ( ::waitpid ( child, &status, 0 ) < 0 ) { }
124 124
125 LoginApplication::logout ( ); 125 LoginApplication::logout ( );
126 126
127 if (( ::time ( 0 ) - started ) < 3 ) { 127 if (( ::time ( 0 ) - started ) < 3 ) {
128 if ( autolog ) { 128 if ( autolog ) {
129 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" ); 129 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" );
130 autolog = 0; 130 autolog = 0;
131 } 131 }
132 else { 132 else {
133 ::syslog ( LOG_ERR, "Respawning too fast -- going down\n" ); 133 ::syslog ( LOG_ERR, "Respawning too fast -- going down\n" );
134 break; 134 break;
135 } 135 }
136 } 136 }
137 int killedbysig = 0; 137 int killedbysig = 0;
138 userExited=0; 138 userExited=0;
139 if (WIFEXITED(status)!=0 ) { 139 if (WIFEXITED(status)!=0 ) {
140 if (WEXITSTATUS(status)==137) { 140 if (WEXITSTATUS(status)==137) {
141 userExited=1; 141 userExited=1;
142 } 142 }
143 } 143 }
144 144
145 if ( WIFSIGNALED( status )) { 145 if ( WIFSIGNALED( status )) {
146 switch ( WTERMSIG( status )) { 146 switch ( WTERMSIG( status )) {
147 case SIGTERM: 147 case SIGTERM:
148 case SIGINT : 148 case SIGINT :
149 case SIGKILL: 149 case SIGKILL:
150 break; 150 break;
151 151
152 default : 152 default :
153 killedbysig = WTERMSIG( status ); 153 killedbysig = WTERMSIG( status );
154 break; 154 break;
155 } 155 }
156 } 156 }
157 if ( killedbysig ) { // qpe was killed by an uncaught signal 157 if ( killedbysig ) { // qpe was killed by an uncaught signal
158 qApp = 0; 158 qApp = 0;
159 159
160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); 160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
161 161
162 QWSServer::setDesktopBackground ( QImage ( )); 162 QWSServer::setDesktopBackground ( QImage ( ));
163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); 163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
164 app-> setFont ( QFont ( "Helvetica", 10 )); 164 app-> setFont ( QFont ( "Helvetica", 10 ));
165 app-> setStyle ( new QPEStyle ( )); 165 app-> setStyle ( new QPEStyle ( ));
166 166
167 const char *sig = ::strsignal ( killedbysig ); 167 // const char *sig = ::strsignal ( killedbysig );
168 const char *sig = ::sys_siglist[killedbysig];
168 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); 169 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
169 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); 170 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
170 l-> setAlignment ( Qt::AlignCenter ); 171 l-> setAlignment ( Qt::AlignCenter );
171 l-> move ( 0, 0 ); 172 l-> move ( 0, 0 );
172 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 173 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
173 l-> show ( ); 174 l-> show ( );
174 QTimer::singleShot ( 3000, app, SLOT( quit())); 175 QTimer::singleShot ( 3000, app, SLOT( quit()));
175 app-> exec ( ); 176 app-> exec ( );
176 delete app; 177 delete app;
177 qApp = 0; 178 qApp = 0;
178 } 179 }
179 } 180 }
180 else { 181 else {
181 if ( !autolog ) { 182 if ( !autolog ) {
182 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; 183 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
183 Config cfg ( confFile, Config::File ); 184 Config cfg ( confFile, Config::File );
184 cfg. setGroup ( "General" ); 185 cfg. setGroup ( "General" );
185 QString user = cfg. readEntry ( "AutoLogin" ); 186 QString user = cfg. readEntry ( "AutoLogin" );
186 187
187 if ( !user. isEmpty ( )) 188 if ( !user. isEmpty ( ))
188 autolog = ::strdup ( user. latin1 ( )); 189 autolog = ::strdup ( user. latin1 ( ));
189 } 190 }
190 191
191 if ( autolog && !userExited ) { 192 if ( autolog && !userExited ) {
192 193
193 QWSServer::setDesktopBackground( QImage() ); 194 QWSServer::setDesktopBackground( QImage() );
194 ODevice::inst ( )-> setDisplayStatus ( true ); 195 ODevice::inst ( )-> setDisplayStatus ( true );
195 ODevice::inst ( )-> setSoftSuspend ( false ); 196 ODevice::inst ( )-> setSoftSuspend ( false );
196 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 197 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
197 LoginApplication::setLoginAs ( autolog ); 198 LoginApplication::setLoginAs ( autolog );
198 199
199 200
200 if ( LoginApplication::changeIdentity ( )) 201 if ( LoginApplication::changeIdentity ( ))
201 ::exit ( LoginApplication::login ( )); 202 ::exit ( LoginApplication::login ( ));
202 else 203 else
203 ::exit ( 0 ); 204 ::exit ( 0 );
204 } 205 }
205 else { 206 else {
206 ::exit ( login_main ( argc, argv, ppid )); 207 ::exit ( login_main ( argc, argv, ppid ));
207 } 208 }
208 } 209 }
209 } 210 }
210 return 0; 211 return 0;
211} 212}
212 213
213void sigterm ( int /*sig*/ ) 214void sigterm ( int /*sig*/ )
214{ 215{
215 ::exit ( 0 ); 216 ::exit ( 0 );
216} 217}
217 218
218 219
219void exit_closelog ( ) 220void exit_closelog ( )
220{ 221{
221 ::closelog ( ); 222 ::closelog ( );
222} 223}
223 224
224 225
225class LoginScreenSaver : public QWSScreenSaver 226class LoginScreenSaver : public QWSScreenSaver
226{ 227{
227public: 228public:
228 LoginScreenSaver ( ) 229 LoginScreenSaver ( )
229 { 230 {
230 m_lcd_status = true; 231 m_lcd_status = true;
231 232
232 m_backlight_bright = -1; 233 m_backlight_bright = -1;
233 m_backlight_forcedoff = false; 234 m_backlight_forcedoff = false;
234 235
235 // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) 236 // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off)
236 ODevice::inst ( )-> setDisplayStatus ( true ); 237 ODevice::inst ( )-> setDisplayStatus ( true );
237 } 238 }
238 void restore() 239 void restore()
239 { 240 {
240 if ( !m_lcd_status ) // We must have turned it off 241 if ( !m_lcd_status ) // We must have turned it off
241 ODevice::inst ( ) -> setDisplayStatus ( true ); 242 ODevice::inst ( ) -> setDisplayStatus ( true );
242 243
243 setBacklight ( -3 ); 244 setBacklight ( -3 );
244 } 245 }
245 bool save( int level ) 246 bool save( int level )
246 { 247 {
247 switch ( level ) { 248 switch ( level ) {
248 case 0: 249 case 0:
249 if ( backlight() > 1 ) 250 if ( backlight() > 1 )
250 setBacklight( 1 ); // lowest non-off 251 setBacklight( 1 ); // lowest non-off
251 return true; 252 return true;
252 break; 253 break;
253 case 1: 254 case 1:
254 setBacklight( 0 ); // off 255 setBacklight( 0 ); // off
255 return true; 256 return true;
256 break; 257 break;
257 case 2: 258 case 2:
258 // We're going to suspend the whole machine 259 // We're going to suspend the whole machine
259 if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { 260 if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) {
260 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); 261 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
261 return true; 262 return true;
262 } 263 }
263 break; 264 break;
264 } 265 }
265 return false; 266 return false;
266 } 267 }
267 268
268private: 269private:
269public: 270public:
270 void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 ) 271 void setIntervals( int i1 = 30, int i2 = 20, int i3 = 60 )
271 { 272 {
272 int v [4]; 273 int v [4];
273 274
274 v [ 0 ] = QMAX( 1000 * i1, 100 ); 275 v [ 0 ] = QMAX( 1000 * i1, 100 );
275 v [ 1 ] = QMAX( 1000 * i2, 100 ); 276 v [ 1 ] = QMAX( 1000 * i2, 100 );
276 v [ 2 ] = QMAX( 1000 * i3, 100 ); 277 v [ 2 ] = QMAX( 1000 * i3, 100 );
277 v [ 3 ] = 0; 278 v [ 3 ] = 0;
278 279
279 if ( !i1 && !i2 && !i3 ) 280 if ( !i1 && !i2 && !i3 )
280 QWSServer::setScreenSaverInterval ( 0 ); 281 QWSServer::setScreenSaverInterval ( 0 );
281 else 282 else
282 QWSServer::setScreenSaverIntervals ( v ); 283 QWSServer::setScreenSaverIntervals ( v );
283 } 284 }
284 285
285 int backlight ( ) 286 int backlight ( )
286 { 287 {
287 if ( m_backlight_bright == -1 ) 288 if ( m_backlight_bright == -1 )
288 m_backlight_bright = 255; 289 m_backlight_bright = 255;
289 290
290 return m_backlight_bright; 291 return m_backlight_bright;
291 } 292 }
292 293
293 void setBacklight ( int bright ) 294 void setBacklight ( int bright )
294 { 295 {
295 if ( bright == -3 ) { 296 if ( bright == -3 ) {
296 // Forced on 297 // Forced on
297 m_backlight_forcedoff = false; 298 m_backlight_forcedoff = false;
298 bright = -1; 299 bright = -1;
299 } 300 }
300 if ( m_backlight_forcedoff && bright != -2 ) 301 if ( m_backlight_forcedoff && bright != -2 )
301 return ; 302 return ;
302 if ( bright == -2 ) { 303 if ( bright == -2 ) {
303 // Toggle between off and on 304 // Toggle between off and on
304 bright = m_backlight_bright ? 0 : -1; 305 bright = m_backlight_bright ? 0 : -1;
305 m_backlight_forcedoff = !bright; 306 m_backlight_forcedoff = !bright;
306 } 307 }
307 308
308 m_backlight_bright = bright; 309 m_backlight_bright = bright;
309 310
310 bright = backlight ( ); 311 bright = backlight ( );
311 ODevice::inst ( ) -> setDisplayBrightness ( bright ); 312 ODevice::inst ( ) -> setDisplayBrightness ( bright );
312 313
313 m_backlight_bright = bright; 314 m_backlight_bright = bright;
314 } 315 }
315 316
316private: 317private:
317 bool m_lcd_status; 318 bool m_lcd_status;
318 319
319 int m_backlight_bright; 320 int m_backlight_bright;
320 bool m_backlight_forcedoff; 321 bool m_backlight_forcedoff;
321}; 322};
322 323
323 324
324namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting 325namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting
325 326
326 327
327int login_main ( int argc, char **argv, pid_t ppid ) 328int login_main ( int argc, char **argv, pid_t ppid )
328{ 329{
329 QWSServer::setDesktopBackground( QImage() ); 330 QWSServer::setDesktopBackground( QImage() );
330 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 331 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
331 332
332 Opie::force_appearance = 0; 333 Opie::force_appearance = 0;
333 334
334 app-> setFont ( QFont ( "Helvetica", 10 )); 335 app-> setFont ( QFont ( "Helvetica", 10 ));
335 app-> setStyle ( new QPEStyle ( )); 336 app-> setStyle ( new QPEStyle ( ));
336 337
337 ODevice::inst ( )-> setSoftSuspend ( true ); 338 ODevice::inst ( )-> setSoftSuspend ( true );
338 339
339 if ( QWSServer::mouseHandler() && 340 if ( QWSServer::mouseHandler() &&
340 QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { 341 QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
341 if ( !QFile::exists ( "/etc/pointercal" )) { 342 if ( !QFile::exists ( "/etc/pointercal" )) {
342 // Make sure calibration widget starts on top. 343 // Make sure calibration widget starts on top.
343 Calibrate *cal = new Calibrate; 344 Calibrate *cal = new Calibrate;
344 cal-> exec ( ); 345 cal-> exec ( );
345 delete cal; 346 delete cal;
346 } 347 }
347 } 348 }
348 349
349 LoginScreenSaver *saver = new LoginScreenSaver; 350 LoginScreenSaver *saver = new LoginScreenSaver;
350 351
351 saver-> setIntervals ( ); 352 saver-> setIntervals ( );
352 QWSServer::setScreenSaver ( saver ); 353 QWSServer::setScreenSaver ( saver );
353 saver-> restore ( ); 354 saver-> restore ( );
354 355
355 356
356 LoginWindowImpl *lw = new LoginWindowImpl ( ); 357 LoginWindowImpl *lw = new LoginWindowImpl ( );
357 app-> setMainWidget ( lw ); 358 app-> setMainWidget ( lw );
358 lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 359 lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
359 lw-> show ( ); 360 lw-> show ( );
360 361
361 int rc = app-> exec ( ); 362 int rc = app-> exec ( );
362 363
363 ODevice::inst ( )-> setSoftSuspend ( false ); 364 ODevice::inst ( )-> setSoftSuspend ( false );
364 365
365 if ( app-> loginAs ( )) { 366 if ( app-> loginAs ( )) {
366 if ( app-> changeIdentity ( )) { 367 if ( app-> changeIdentity ( )) {
367 app-> login ( ); 368 app-> login ( );
368 369
369 // if login succeeds, it never comes back 370 // if login succeeds, it never comes back
370 371
371 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." )); 372 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." ));
372 rc = 1; 373 rc = 1;
373 } 374 }
374 else { 375 else {
375 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" )); 376 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" ));
376 rc = 2; 377 rc = 2;
377 } 378 }
378 379
379 } 380 }
380 return rc; 381 return rc;
381} 382}
382 383