author | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
commit | 0d59c780513da78033f4d9040475dee9db0256d4 (patch) (unidiff) | |
tree | 503d320b4aa3daae9982082e7b34e3e2c48bdfb7 /core/opie-login/main.cpp | |
parent | a0981652d61776d70f25980f035748b21339e946 (diff) | |
download | opie-0d59c780513da78033f4d9040475dee9db0256d4.zip opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.gz opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.bz2 |
run the optimize_connect script
the whole cvs is tagged with "before_optimize_connect" if there are problems you
can check the diff (but it had compiled and run here)
-rw-r--r-- | core/opie-login/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 7d5792e..8d0976f 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -126,97 +126,97 @@ int main ( int argc, char **argv ) | |||
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 | QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); | 168 | 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 )); | 169 | l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); |
170 | l-> setAlignment ( Qt::AlignCenter ); | 170 | l-> setAlignment ( Qt::AlignCenter ); |
171 | l-> move ( 0, 0 ); | 171 | l-> move ( 0, 0 ); |
172 | l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); | 172 | l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); |
173 | l-> show ( ); | 173 | l-> show ( ); |
174 | QTimer::singleShot ( 3000, app, SLOT( quit ( ))); | 174 | QTimer::singleShot ( 3000, app, SLOT( quit())); |
175 | app-> exec ( ); | 175 | app-> exec ( ); |
176 | delete app; | 176 | delete app; |
177 | qApp = 0; | 177 | qApp = 0; |
178 | } | 178 | } |
179 | } | 179 | } |
180 | else { | 180 | else { |
181 | if ( !autolog ) { | 181 | if ( !autolog ) { |
182 | QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 182 | QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
183 | Config cfg ( confFile, Config::File ); | 183 | Config cfg ( confFile, Config::File ); |
184 | cfg. setGroup ( "General" ); | 184 | cfg. setGroup ( "General" ); |
185 | QString user = cfg. readEntry ( "AutoLogin" ); | 185 | QString user = cfg. readEntry ( "AutoLogin" ); |
186 | 186 | ||
187 | if ( !user. isEmpty ( )) | 187 | if ( !user. isEmpty ( )) |
188 | autolog = ::strdup ( user. latin1 ( )); | 188 | autolog = ::strdup ( user. latin1 ( )); |
189 | } | 189 | } |
190 | 190 | ||
191 | if ( autolog && !userExited ) { | 191 | if ( autolog && !userExited ) { |
192 | 192 | ||
193 | QWSServer::setDesktopBackground( QImage() ); | 193 | QWSServer::setDesktopBackground( QImage() ); |
194 | ODevice::inst ( )-> setDisplayStatus ( true ); | 194 | ODevice::inst ( )-> setDisplayStatus ( true ); |
195 | ODevice::inst ( )-> setSoftSuspend ( false ); | 195 | ODevice::inst ( )-> setSoftSuspend ( false ); |
196 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); | 196 | LoginApplication *app = new LoginApplication ( argc, argv, ppid ); |
197 | LoginApplication::setLoginAs ( autolog ); | 197 | LoginApplication::setLoginAs ( autolog ); |
198 | 198 | ||
199 | 199 | ||
200 | if ( LoginApplication::changeIdentity ( )) | 200 | if ( LoginApplication::changeIdentity ( )) |
201 | ::exit ( LoginApplication::login ( )); | 201 | ::exit ( LoginApplication::login ( )); |
202 | else | 202 | else |
203 | ::exit ( 0 ); | 203 | ::exit ( 0 ); |
204 | } | 204 | } |
205 | else { | 205 | else { |
206 | ::exit ( login_main ( argc, argv, ppid )); | 206 | ::exit ( login_main ( argc, argv, ppid )); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | } | 209 | } |
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | void sigterm ( int /*sig*/ ) | 213 | void sigterm ( int /*sig*/ ) |
214 | { | 214 | { |
215 | ::exit ( 0 ); | 215 | ::exit ( 0 ); |
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | void exit_closelog ( ) | 219 | void exit_closelog ( ) |
220 | { | 220 | { |
221 | ::closelog ( ); | 221 | ::closelog ( ); |
222 | } | 222 | } |