summaryrefslogtreecommitdiff
path: root/core/launcher/main.cpp
Unidiff
Diffstat (limited to 'core/launcher/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/main.cpp56
1 files changed, 1 insertions, 55 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index a86aca6..b119399 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -63,74 +63,25 @@ static void cleanup()
63{ 63{
64 QDir dir( "/tmp", "qcop-msg-*" ); 64 QDir dir( "/tmp", "qcop-msg-*" );
65 65
66 QStringList stale = dir.entryList(); 66 QStringList stale = dir.entryList();
67 QStringList::Iterator it; 67 QStringList::Iterator it;
68 for ( it = stale.begin(); it != stale.end(); ++it ) { 68 for ( it = stale.begin(); it != stale.end(); ++it ) {
69 dir.remove( *it ); 69 dir.remove( *it );
70 } 70 }
71} 71}
72 72
73static void refreshTimeZoneConfig() 73static void refreshTimeZoneConfig()
74{ 74{
75 /* ### FIXME timezone handling */ 75 /* ### FIXME timezone handling for qtopia */
76#if 0
77 // We need to help WorldTime in setting up its configuration for
78 // the current translation
79 // BEGIN no tr
80 const char *defaultTz[] = {
81 "America/New_York",
82 "America/Los_Angeles",
83 "Europe/Oslo",
84 "Asia/Tokyo",
85 "Asia/Hong_Kong",
86 "Australia/Brisbane",
87 0
88 };
89 // END no tr
90
91 TimeZone curZone;
92 QString zoneID;
93 int zoneIndex;
94 Config cfg = Config( "WorldTime" );
95 cfg.setGroup( "TimeZones" );
96 if (!cfg.hasKey( "Zone0" )){
97 // We have no existing timezones use the defaults which are untranslated strings
98 QString currTz = TimeZone::current().id();
99 QStringList zoneDefaults;
100 zoneDefaults.append( currTz );
101 for ( int i = 0; defaultTz[i] && zoneDefaults.count() < 6; i++ ) {
102 if ( defaultTz[i] != currTz )
103 zoneDefaults.append( defaultTz[i] );
104 }
105 zoneIndex = 0;
106 for (QStringList::Iterator it = zoneDefaults.begin(); it != zoneDefaults.end() ; ++it){
107 cfg.writeEntry( "Zone" + QString::number( zoneIndex ) , *it);
108 zoneIndex++;
109 }
110 }
111 // We have an existing list of timezones refresh the
112 // translations of TimeZone name
113 zoneIndex = 0;
114 while (cfg.hasKey( "Zone"+ QString::number( zoneIndex ))){
115 zoneID = cfg.readEntry( "Zone" + QString::number( zoneIndex ));
116 curZone = TimeZone( zoneID );
117 if ( !curZone.isValid() ){
118 odebug << "initEnvironment() Invalid TimeZone " << zoneID << "" << oendl;
119 break;
120 }
121 cfg.writeEntry( "ZoneName" + QString::number( zoneIndex ), curZone.city() );
122 zoneIndex++;
123 }
124#endif
125} 76}
126 77
127void initEnvironment() 78void initEnvironment()
128{ 79{
129#ifdef Q_OS_WIN32 80#ifdef Q_OS_WIN32
130 // Config file requires HOME dir which uses QDir which needs the winver 81 // Config file requires HOME dir which uses QDir which needs the winver
131 qt_init_winver(); 82 qt_init_winver();
132#endif 83#endif
133 Config config("locale"); 84 Config config("locale");
134 config.setGroup( "Location" ); 85 config.setGroup( "Location" );
135 QString tz = config.readEntry( "Timezone", getenv("TZ") ).stripWhiteSpace(); 86 QString tz = config.readEntry( "Timezone", getenv("TZ") ).stripWhiteSpace();
136 87
@@ -141,29 +92,24 @@ void initEnvironment()
141 setenv( "TZ", tz, 1 ); 92 setenv( "TZ", tz, 1 );
142 config.writeEntry( "Timezone", tz); 93 config.writeEntry( "Timezone", tz);
143 94
144 config.setGroup( "Language" ); 95 config.setGroup( "Language" );
145 QString lang = config.readEntry( "Language", getenv("LANG") ).stripWhiteSpace(); 96 QString lang = config.readEntry( "Language", getenv("LANG") ).stripWhiteSpace();
146 if( lang.isNull() || lang.isEmpty()) 97 if( lang.isNull() || lang.isEmpty())
147 lang = "en_US"; 98 lang = "en_US";
148 99
149 setenv( "LANG", lang, 1 ); 100 setenv( "LANG", lang, 1 );
150 config.writeEntry("Language", lang); 101 config.writeEntry("Language", lang);
151 config.write(); 102 config.write();
152 103
153#if 0
154 setenv( "QWS_SIZE", "240x320", 0 );
155#endif
156
157
158 104
159 QString env(getenv("QWS_DISPLAY")); 105 QString env(getenv("QWS_DISPLAY"));
160 if (env.contains("Transformed")) { 106 if (env.contains("Transformed")) {
161 int rot; 107 int rot;
162 // transformed driver default rotation is controlled by the hardware. 108 // transformed driver default rotation is controlled by the hardware.
163 Config config("qpe"); 109 Config config("qpe");
164 config.setGroup( "Rotation" ); 110 config.setGroup( "Rotation" );
165 if ( ( rot = config.readNumEntry( "Rot", -1 ) ) == -1 ) 111 if ( ( rot = config.readNumEntry( "Rot", -1 ) ) == -1 )
166 rot = ODevice::inst ( )-> rotation ( ) * 90; 112 rot = ODevice::inst ( )-> rotation ( ) * 90;
167 113
168 setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1); 114 setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1);
169 QPEApplication::defaultRotation ( ); /* to ensure deforient matches reality */ 115 QPEApplication::defaultRotation ( ); /* to ensure deforient matches reality */