summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-14 23:33:00 (UTC)
committer sandman <sandman>2002-10-14 23:33:00 (UTC)
commitb3ad9188f40cf6e3c170cc48be3ed180d509036f (patch) (side-by-side diff)
tree04978e0fb1bd258244a6578a27ab09e3c6843d75
parentc7aed90e02d06502dff04043103c5db0883cc011 (diff)
downloadopie-b3ad9188f40cf6e3c170cc48be3ed180d509036f.zip
opie-b3ad9188f40cf6e3c170cc48be3ed180d509036f.tar.gz
opie-b3ad9188f40cf6e3c170cc48be3ed180d509036f.tar.bz2
autologin feature can now (also) be configured by:
~/Settings/opie-login.conf: [General] AutoLogin=<user> command line options override config file settings !
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp12
1 files changed, 11 insertions, 1 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
@@ -41,12 +41,13 @@
#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>
@@ -161,21 +162,30 @@ int main ( int argc, char **argv )
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
+ else
::exit ( login_main ( argc, argv ));
}
}
return 0;
}