summaryrefslogtreecommitdiff
path: root/core/launcher/main.cpp
Unidiff
Diffstat (limited to 'core/launcher/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/main.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 1e5eb46..49b41d6 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -57,56 +57,40 @@ void initEnvironment( )
57 57
58 // if not timezone set, pick New York 58 // if not timezone set, pick New York
59 if (tz.isNull()) 59 if (tz.isNull())
60 tz = "America/New_York"; 60 tz = "America/New_York";
61 61
62 setenv( "TZ", tz, 1 ); 62 setenv( "TZ", tz, 1 );
63 config.writeEntry( "Timezone", tz); 63 config.writeEntry( "Timezone", tz);
64 64
65 config.setGroup( "Language" ); 65 config.setGroup( "Language" );
66 QString lang = config.readEntry( "Language", getenv("LANG") ); 66 QString lang = config.readEntry( "Language", getenv("LANG") );
67 if ( !lang.isNull() ) 67 if ( !lang.isNull() )
68 setenv( "LANG", lang, 1 ); 68 setenv( "LANG", lang, 1 );
69
70} 69}
71 70
72 71
73int initApplication( int argc, char ** argv ) 72int initApplication( int argc, char ** argv )
74{ 73{
75 struct ODevice *odev = ODevice::inst();
76
77 initEnvironment( ); 74 initEnvironment( );
78 75
79#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX) 76#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX)
80 setenv( "QWS_SIZE", "240x320", 0 ); 77 setenv( "QWS_SIZE", "240x320", 0 );
81#endif 78#endif
82 79
83 //Don't flicker at startup: 80 //Don't flicker at startup:
84 QWSServer::setDesktopBackground( QImage() ); 81 QWSServer::setDesktopBackground( QImage() );
85 DesktopApplication a( argc, argv, QApplication::GuiServer ); 82 DesktopApplication a( argc, argv, QApplication::GuiServer );
86 83
87 int rot; 84 ODevice::inst ( )-> setSoftSuspend ( true );
88 switch ( odev-> rotation( ) ) {
89 case None:
90 rot = 0;
91 case Rot90:
92 rot = 90;
93 case Rot180:
94 rot = 180;
95 case Rot270:
96 rot = 270;
97 }
98 a.setDefaultRotation( rot );
99
100 odev-> setSoftSuspend ( true );
101 85
102 { // init backlight 86 { // init backlight
103 QCopEnvelope e("QPE/System", "setBacklight(int)" ); 87 QCopEnvelope e("QPE/System", "setBacklight(int)" );
104 e << -3; // Forced on 88 e << -3; // Forced on
105 } 89 }
106 90
107 AlarmServer::initialize(); 91 AlarmServer::initialize();
108 92
109 Desktop *d = new Desktop(); 93 Desktop *d = new Desktop();
110 94
111 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); 95 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) );
112 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); 96 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) );
@@ -131,25 +115,25 @@ int initApplication( int argc, char ** argv )
131 115
132 if ( QDate::currentDate ( ). year ( ) < 2000 ) { 116 if ( QDate::currentDate ( ). year ( ) < 2000 ) {
133 if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::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 ) { 117 if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::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 ) {
134 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); 118 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" );
135 e << QString ( ); 119 e << QString ( );
136 } 120 }
137 } 121 }
138 122
139 int rv = a.exec(); 123 int rv = a.exec();
140 124
141 delete d; 125 delete d;
142 126
143 odev-> setSoftSuspend ( false ); 127 ODevice::inst ( )-> setSoftSuspend ( false );
144 128
145 return rv; 129 return rv;
146} 130}
147 131
148static const char *pidfile_path = "/var/run/opie.pid"; 132static const char *pidfile_path = "/var/run/opie.pid";
149 133
150void create_pidfile ( ) 134void create_pidfile ( )
151{ 135{
152 FILE *f; 136 FILE *f;
153 137
154 if (( f = ::fopen ( pidfile_path, "w" ))) { 138 if (( f = ::fopen ( pidfile_path, "w" ))) {
155 ::fprintf ( f, "%d", getpid ( )); 139 ::fprintf ( f, "%d", getpid ( ));