author | zecke <zecke> | 2003-10-04 07:28:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-10-04 07:28:05 (UTC) |
commit | 23f729eb7487ad189591c3b0c9af9d3afecd3b91 (patch) (unidiff) | |
tree | 83b7efa5996ffcbf22f36b370505eb11fdece4ff | |
parent | 364d30ca7c212a531b79bb7cbceb8af7a0130f2c (diff) | |
download | opie-23f729eb7487ad189591c3b0c9af9d3afecd3b91.zip opie-23f729eb7487ad189591c3b0c9af9d3afecd3b91.tar.gz opie-23f729eb7487ad189591c3b0c9af9d3afecd3b91.tar.bz2 |
Avoid crashing on no mouse driver
-rw-r--r-- | core/apps/calibrate/main.cpp | 3 | ||||
-rw-r--r-- | core/opie-login/main.cpp | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/core/apps/calibrate/main.cpp b/core/apps/calibrate/main.cpp index 1c295eb..ec9b5ec 100644 --- a/core/apps/calibrate/main.cpp +++ b/core/apps/calibrate/main.cpp | |||
@@ -33,7 +33,8 @@ int main( int argc, char ** argv ) | |||
33 | int retval = 0; | 33 | int retval = 0; |
34 | 34 | ||
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | 36 | if ( QWSServer::mouseHandler() && |
37 | QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | ||
37 | #endif | 38 | #endif |
38 | // Make sure calibration widget starts on top. | 39 | // Make sure calibration widget starts on top. |
39 | Calibrate cal; | 40 | Calibrate cal; |
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 7dcb5f6..2103216 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -107,7 +107,7 @@ int main ( int argc, char **argv ) | |||
107 | ::setpgid ( 0, 0 ); | 107 | ::setpgid ( 0, 0 ); |
108 | ::setsid ( ); | 108 | ::setsid ( ); |
109 | 109 | ||
110 | ::signal ( SIGTERM, sigterm ); | 110 | ::signal ( SIGTERM, sigterm ); |
111 | ::signal ( SIGINT, sigterm ); | 111 | ::signal ( SIGINT, sigterm ); |
112 | 112 | ||
113 | ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); | 113 | ::openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); |
@@ -160,7 +160,7 @@ int main ( int argc, char **argv ) | |||
160 | } | 160 | } |
161 | if ( killedbysig ) { // qpe was killed by an uncaught signal | 161 | if ( killedbysig ) { // qpe was killed by an uncaught signal |
162 | qApp = 0; | 162 | qApp = 0; |
163 | 163 | ||
164 | ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); | 164 | ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); |
165 | 165 | ||
166 | QWSServer::setDesktopBackground ( QImage ( )); | 166 | QWSServer::setDesktopBackground ( QImage ( )); |
@@ -187,11 +187,11 @@ int main ( int argc, char **argv ) | |||
187 | Config cfg ( confFile, Config::File ); | 187 | Config cfg ( confFile, Config::File ); |
188 | cfg. setGroup ( "General" ); | 188 | cfg. setGroup ( "General" ); |
189 | QString user = cfg. readEntry ( "AutoLogin" ); | 189 | QString user = cfg. readEntry ( "AutoLogin" ); |
190 | 190 | ||
191 | if ( !user. isEmpty ( )) | 191 | if ( !user. isEmpty ( )) |
192 | autolog = ::strdup ( user. latin1 ( )); | 192 | autolog = ::strdup ( user. latin1 ( )); |
193 | } | 193 | } |
194 | 194 | ||
195 | if ( autolog && !userExited ) { | 195 | if ( autolog && !userExited ) { |
196 | 196 | ||
197 | QWSServer::setDesktopBackground( QImage() ); | 197 | QWSServer::setDesktopBackground( QImage() ); |
@@ -199,7 +199,7 @@ int main ( int argc, char **argv ) | |||
199 | ODevice::inst ( )-> setSoftSuspend ( false ); | 199 | ODevice::inst ( )-> setSoftSuspend ( false ); |
200 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); | 200 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); |
201 | LoginApplication::setLoginAs ( autolog ); | 201 | LoginApplication::setLoginAs ( autolog ); |
202 | 202 | ||
203 | 203 | ||
204 | if ( LoginApplication::changeIdentity ( )) | 204 | if ( LoginApplication::changeIdentity ( )) |
205 | ::exit ( LoginApplication::login ( )); | 205 | ::exit ( LoginApplication::login ( )); |
@@ -340,7 +340,8 @@ int login_main ( int argc, char **argv, pid_t ppid ) | |||
340 | 340 | ||
341 | ODevice::inst ( )-> setSoftSuspend ( true ); | 341 | ODevice::inst ( )-> setSoftSuspend ( true ); |
342 | 342 | ||
343 | if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | 343 | if ( QWSServer::mouseHandler() && |
344 | QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | ||
344 | if ( !QFile::exists ( "/etc/pointercal" )) { | 345 | if ( !QFile::exists ( "/etc/pointercal" )) { |
345 | // Make sure calibration widget starts on top. | 346 | // Make sure calibration widget starts on top. |
346 | Calibrate *cal = new Calibrate; | 347 | Calibrate *cal = new Calibrate; |