summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/main.cpp7
-rw-r--r--core/opie-login/main.cpp7
2 files changed, 1 insertions, 13 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 734d072..5bbed59 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -137,89 +137,82 @@ static bool firstUse()
FirstUse *fu = new FirstUse();
fu->exec();
bool rs = fu->restartNeeded();
delete fu;
return rs;
}
int initApplication( int argc, char ** argv )
{
cleanup();
initEnvironment();
#ifdef QWS
QWSServer::setDesktopBackground( QImage() );
#endif
ServerApplication a( argc, argv, QApplication::GuiServer );
initKeyboard();
if ( firstUse() )
{
a.restart();
return 0;
}
-#ifndef Q_OS_MACX
- ODevice::inst()->setSoftSuspend( true );
-#endif
{
QCopEnvelope e("QPE/System", "setBacklight(int)" );
e << -3; // Forced on
}
AlarmServer::initialize();
Server *s = new Server();
new SysFileMonitor(s);
#ifdef QWS
Network::createServer(s);
#endif
s->show();
#if 0
if ( QDate::currentDate().year() < 2005 )
{
if ( QMessageBox::information ( 0, ServerApplication::tr( "Information" ),
ServerApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" )
.arg( TimeString::dateString( QDate::currentDate())), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" );
e << QString ( );
}
}
#endif
create_pidfile();
odebug << "--> mainloop in" << oendl;
int rv = a.exec();
odebug << "<-- mainloop out" << oendl;
remove_pidfile();
odebug << "removing server object..." << oendl;
delete s;
-#ifndef Q_OS_MACX
- ODevice::inst()->setSoftSuspend( false );
-#endif
-
odebug << "returning from qpe/initapplication..." << oendl;
return rv;
}
static const char *pidfile_path = "/var/run/opie.pid";
void create_pidfile()
{
FILE *f;
if (( f = ::fopen( pidfile_path, "w" ))) {
::fprintf( f, "%d", getpid ( ));
::fclose( f );
}
else
{
odebug << "couldn't create pidfile: " << strerror( errno ) << oendl;
}
}
void remove_pidfile()
{
::unlink( pidfile_path );
}
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 0699d0a..2de0180 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -171,50 +171,49 @@ int main ( int argc, char **argv )
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 ) {
QString confFile=QPEApplication::qpeDir() + "etc/opie-login.conf";
Config cfg ( confFile, Config::File );
cfg. setGroup ( "General" );
QString user = cfg. readEntry ( "AutoLogin" );
if ( !user. isEmpty ( ))
autolog = ::strdup ( user. latin1 ( ));
}
if ( autolog && !userExited ) {
QWSServer::setDesktopBackground( QImage() );
- ODevice::inst ( )-> setDisplayStatus ( true );
- ODevice::inst ( )-> setSoftSuspend ( false );
+ ODevice::inst()->setDisplayStatus( true );
LoginApplication *app = new LoginApplication ( argc, argv, ppid );
LoginApplication::setLoginAs ( autolog );
if ( LoginApplication::changeIdentity ( ))
::exit ( LoginApplication::login ( ));
else
::exit ( 0 );
}
else {
::exit ( login_main ( argc, argv, ppid ));
}
}
}
return 0;
}
void sigterm ( int /*sig*/ )
{
::exit ( 0 );
}
void exit_closelog ( )
@@ -314,70 +313,66 @@ public:
m_backlight_bright = bright;
}
private:
bool m_lcd_status;
int m_backlight_bright;
bool m_backlight_forcedoff;
};
namespace Opie { extern int force_appearance; } // HACK to get around the force-style setting
int login_main ( int argc, char **argv, pid_t ppid )
{
QWSServer::setDesktopBackground( QImage() );
LoginApplication *app = new LoginApplication ( argc, argv, ppid );
Opie::force_appearance = 0;
app-> setFont ( QFont ( "Helvetica", 10 ));
app-> setStyle ( new QPEStyle ( ));
- ODevice::inst ( )-> setSoftSuspend ( true );
-
if ( QWSServer::mouseHandler() &&
QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
if ( !QFile::exists ( "/etc/pointercal" )) {
// Make sure calibration widget starts on top.
Calibrate *cal = new Calibrate;
cal-> exec ( );
delete cal;
}
}
LoginScreenSaver *saver = new LoginScreenSaver;
saver-> setIntervals ( );
QWSServer::setScreenSaver ( saver );
saver-> restore ( );
LoginWindowImpl *lw = new LoginWindowImpl ( );
app-> setMainWidget ( lw );
lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
lw-> show ( );
int rc = app-> exec ( );
- ODevice::inst ( )-> setSoftSuspend ( false );
-
if ( app-> loginAs ( )) {
if ( app-> changeIdentity ( )) {
app-> login ( );
// if login succeeds, it never comes back
QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." ));
rc = 1;
}
else {
QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" ));
rc = 2;
}
}
return rc;
}