summaryrefslogtreecommitdiff
path: root/core/tools/quicklauncher/main.cpp
Unidiff
Diffstat (limited to 'core/tools/quicklauncher/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/tools/quicklauncher/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp
index f3055cc..d467d6e 100644
--- a/core/tools/quicklauncher/main.cpp
+++ b/core/tools/quicklauncher/main.cpp
@@ -182,87 +182,87 @@ int main( int argc, char** argv )
182 if ( arg0 != "quicklauncher" ) { 182 if ( arg0 != "quicklauncher" ) {
183 qDebug( "QuickLauncher invoked as: %s", arg0.data() ); 183 qDebug( "QuickLauncher invoked as: %s", arg0.data() );
184 QuickLauncher::exec( argc, argv ); 184 QuickLauncher::exec( argc, argv );
185 } else { 185 } else {
186#ifdef _OS_LINUX_ 186#ifdef _OS_LINUX_
187 // Setup to change proc title 187 // Setup to change proc title
188 int i; 188 int i;
189 char **envp = environ; 189 char **envp = environ;
190 /* Move the environment so we can reuse the memory. 190 /* Move the environment so we can reuse the memory.
191 * (Code borrowed from sendmail.) */ 191 * (Code borrowed from sendmail.) */
192 for (i = 0; envp[i] != NULL; i++) 192 for (i = 0; envp[i] != NULL; i++)
193 continue; 193 continue;
194 environ = (char **) malloc(sizeof(char *) * (i + 1)); 194 environ = (char **) malloc(sizeof(char *) * (i + 1));
195 if (environ == NULL) 195 if (environ == NULL)
196 return -1; 196 return -1;
197 for (i = 0; envp[i] != NULL; i++) 197 for (i = 0; envp[i] != NULL; i++)
198 if ((environ[i] = strdup(envp[i])) == NULL) 198 if ((environ[i] = strdup(envp[i])) == NULL)
199 return -1; 199 return -1;
200 environ[i] = NULL; 200 environ[i] = NULL;
201 201
202 argv0 = argv; 202 argv0 = argv;
203 if (i > 0) 203 if (i > 0)
204 argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0]; 204 argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0];
205 else 205 else
206 argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0]; 206 argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0];
207#endif 207#endif
208 (void)new QuickLauncher(); 208 (void)new QuickLauncher();
209 qDebug( "QuickLauncher running" ); 209 qDebug( "QuickLauncher running" );
210 // Pre-load default fonts 210 // Pre-load default fonts
211 QFontMetrics fm( QApplication::font() ); 211 QFontMetrics fm( QApplication::font() );
212 fm.ascent(); // causes font load. 212 fm.ascent(); // causes font load.
213 QFont f( QApplication::font() ); 213 QFont f( QApplication::font() );
214 f.setWeight( QFont::Bold ); 214 f.setWeight( QFont::Bold );
215 QFontMetrics fmb( f ); 215 QFontMetrics fmb( f );
216 fmb.ascent(); // causes font load. 216 fmb.ascent(); // causes font load.
217 217
218 // Each of the following force internal structures/internal 218 // Each of the following force internal structures/internal
219 // initialization to be performed. This may mean allocating 219 // initialization to be performed. This may mean allocating
220 // memory that is not needed by all applications. 220 // memory that is not needed by all applications.
221#if 0 221#if 0
222 TimeZone::current().isValid(); // popuplate timezone cache 222 TimeZone::current().isValid(); // popuplate timezone cache
223 TimeString::currentDateFormat(); // create internal structures 223 TimeString::currentDateFormat(); // create internal structures
224 TimeString::currentAMPM(); 224 TimeString::currentAMPM();
225#endif 225#endif
226 Resource::loadIconSet("new"); // do internal init 226 Resource::loadIconSet("new"); // do internal init
227 227
228 /* make sure libopie gets lined in */ 228 /* make sure libopie gets lined in */
229 { 229 {
230 OWait item; 230 Opie::Ui::OWait item;
231 } 231 }
232 232
233 // Create a widget to force initialization of title bar images, etc. 233 // Create a widget to force initialization of title bar images, etc.
234 QObject::disconnect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); 234 QObject::disconnect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit()));
235 QWidget *w = new QWidget(0,0,Qt::WDestructiveClose|Qt::WStyle_ContextHelp|Qt::WStyle_Tool); 235 QWidget *w = new QWidget(0,0,Qt::WDestructiveClose|Qt::WStyle_ContextHelp|Qt::WStyle_Tool);
236 w->setGeometry( -100, -100, 10, 10 ); 236 w->setGeometry( -100, -100, 10, 10 );
237 w->show(); 237 w->show();
238 QTimer::singleShot( 0, w, SLOT(close()) ); 238 QTimer::singleShot( 0, w, SLOT(close()) );
239 239
240 app->enter_loop(); 240 app->enter_loop();
241 } 241 }
242 242
243 int rv = app->exec(); 243 int rv = app->exec();
244 244
245 if ( mainWindow ) 245 if ( mainWindow )
246 delete (QWidget*)mainWindow; 246 delete (QWidget*)mainWindow;
247 247
248 delete app; 248 delete app;
249 if ( appIface ) 249 if ( appIface )
250 loader->releaseInterface( appIface ); 250 loader->releaseInterface( appIface );
251 delete loader; 251 delete loader;
252 // Neither QLibrary nor my Dropin is a QObject and they don't depend 252 // Neither QLibrary nor my Dropin is a QObject and they don't depend
253 // on a qApp so we destroy QWidget::destroyMapper() without 253 // on a qApp so we destroy QWidget::destroyMapper() without
254 // crashing the app 254 // crashing the app
255 // 255 //
256 // The problem is there are some 'static' resources not freed 256 // The problem is there are some 'static' resources not freed
257 // in the apps and on destructing these objects are not available 257 // in the apps and on destructing these objects are not available
258 // anymore. In future fix up the apps but for now 258 // anymore. In future fix up the apps but for now
259 // we just skip deletion and hope things go well -zecke 259 // we just skip deletion and hope things go well -zecke
260// delete app; 260// delete app;
261 // hack instead -zecke 261 // hack instead -zecke
262// delete app->pidChannel; 262// delete app->pidChannel;
263// app->pidChannel = 0; 263// app->pidChannel = 0;
264 264
265 return rv; 265 return rv;
266} 266}
267 267
268#include "main.moc" 268#include "main.moc"