-rw-r--r-- | core/opie-login/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 8f795e3..579a93a 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp @@ -31,32 +31,33 @@ #include <time.h> #include <sys/time.h> #include <sys/resource.h> #include <unistd.h> #include <syslog.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <getopt.h> #include <string.h> #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpestyle.h> #include <qpe/power.h> +#include <qpe/config.h> #include <opie/odevice.h> #include <qwindowsystem_qws.h> #include <qmessagebox.h> #include <qlabel.h> #include <qtimer.h> #include <qfile.h> #include "loginapplication.h" #include "loginwindowimpl.h" #include "calibrate.h" using namespace Opie; int login_main ( int argc, char **argv ); @@ -151,32 +152,41 @@ int main ( int argc, char **argv ) app-> setStyle ( new QPEStyle ( )); const char *sig = ::strsignal ( killedbysig ); QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); l-> setText ( LoginWindowImpl::tr( "OPIE was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); l-> setAlignment ( Qt::AlignCenter ); l-> move ( 0, 0 ); l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); l-> show ( ); QTimer::singleShot ( 3000, app, SLOT( quit ( ))); app-> exec ( ); delete app; qApp = 0; } } else { + if ( !autolog ) { + Config cfg ( "opie-login" ); + cfg. setGroup ( "General" ); + QString user = cfg. readEntry ( "AutoLogin" ); + + if ( !user. isEmpty ( )) + autolog = ::strdup ( user. latin1 ( )); + } + if ( autolog ) { LoginApplication::setLoginAs ( autolog ); if ( LoginApplication::changeIdentity ( )) ::exit ( LoginApplication::login ( )); else ::exit ( 0 ); } else ::exit ( login_main ( argc, argv )); } } return 0; } void sigterm ( int /*sig*/ ) |