author | mickeyl <mickeyl> | 2003-11-06 09:50:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-11-06 09:50:40 (UTC) |
commit | 2f974fea9a432e9dd7b7a8ad235a4e6bc2ef51fe (patch) (side-by-side diff) | |
tree | ab2089d9282c53146cd0e03b96345a34d74d156e | |
parent | 26ae86ca1e42b61bd0f0031b437ed90a640aa82b (diff) | |
download | opie-2f974fea9a432e9dd7b7a8ad235a4e6bc2ef51fe.zip opie-2f974fea9a432e9dd7b7a8ad235a4e6bc2ef51fe.tar.gz opie-2f974fea9a432e9dd7b7a8ad235a4e6bc2ef51fe.tar.bz2 |
merge core/tools/*
-rw-r--r-- | core/tools/quicklauncher/config.in | 4 | ||||
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 22 | ||||
-rw-r--r-- | core/tools/quicklauncher/opie-quicklauncher.control | 10 |
3 files changed, 34 insertions, 2 deletions
diff --git a/core/tools/quicklauncher/config.in b/core/tools/quicklauncher/config.in new file mode 100644 index 0000000..c105e94 --- a/dev/null +++ b/core/tools/quicklauncher/config.in @@ -0,0 +1,4 @@ + config QUICKLAUNCHER + boolean "The Quick Launcher Loader" + default "y" + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index 7d368ab..cc411fd 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp @@ -1,75 +1,81 @@ /********************************************************************** ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpainter.h> #include <qstrlist.h> #include <qtimer.h> #include <qguardedptr.h> #include <qcopchannel_qws.h> #define QTOPIA_INTERNAL_INITAPP + +#ifdef private +# undef private +#endif +#define private public #include <qtopia/qpeapplication.h> +#undef private #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "dropins.h" static QPEApplication *app = 0; static PluginLoader *loader = 0; static ApplicationInterface *appIface = 0; static QGuardedPtr<QWidget> mainWindow; #ifdef _OS_LINUX_ static char **argv0 = 0; static int argv_lth; extern char **environ; #ifndef SPT_BUFSIZE #define SPT_BUFSIZE 2048 #endif #include <stdarg.h> void setproctitle (const char *fmt,...) { int i; char buf[SPT_BUFSIZE]; va_list ap; if (!argv0) return; va_start(ap, fmt); (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap); va_end(ap); i = strlen (buf); if (i > argv_lth - 2) { i = argv_lth - 2; buf[i] = '\0'; } memset(argv0[0], '\0', argv_lth); /* clear the memory area */ (void) strcpy (argv0[0], buf); argv0[1] = NULL; } #endif class QuickLauncher : public QObject { @@ -190,58 +196,70 @@ int main( int argc, char** argv ) return -1; environ[i] = NULL; argv0 = argv; if (i > 0) argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0]; else argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0]; #endif (void)new QuickLauncher(); qDebug( "QuickLauncher running" ); // Pre-load default fonts QFontMetrics fm( QApplication::font() ); fm.ascent(); // causes font load. QFont f( QApplication::font() ); f.setWeight( QFont::Bold ); QFontMetrics fmb( f ); fmb.ascent(); // causes font load. // Each of the following force internal structures/internal // initialization to be performed. This may mean allocating // memory that is not needed by all applications. #if 0 TimeZone::current().isValid(); // popuplate timezone cache TimeString::currentDateFormat(); // create internal structures TimeString::currentAMPM(); #endif Resource::loadIconSet("new"); // do internal init /* make sure libopie gets lined in */ { OWait item; } // Create a widget to force initialization of title bar images, etc. QObject::disconnect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); QWidget *w = new QWidget(0,0,Qt::WDestructiveClose|Qt::WStyle_ContextHelp|Qt::WStyle_Tool); w->setGeometry( -100, -100, 10, 10 ); w->show(); QTimer::singleShot( 0, w, SLOT(close()) ); app->enter_loop(); } int rv = app->exec(); if ( mainWindow ) delete (QWidget*)mainWindow; + + delete app; if ( appIface ) loader->releaseInterface( appIface ); delete loader; - - delete app; + // Neither QLibrary nor my Dropin is a QObject and they don't depend + // on a qApp so we destroy QWidget::destroyMapper() without + // crashing the app + // + // The problem is there are some 'static' resources not freed + // in the apps and on destructing these objects are not available + // anymore. In future fix up the apps but for now + // we just skip deletion and hope things go well -zecke +// delete app; + // hack instead -zecke +// delete app->pidChannel; +// app->pidChannel = 0; return rv; } #include "main.moc" diff --git a/core/tools/quicklauncher/opie-quicklauncher.control b/core/tools/quicklauncher/opie-quicklauncher.control new file mode 100644 index 0000000..79b9493 --- a/dev/null +++ b/core/tools/quicklauncher/opie-quicklauncher.control @@ -0,0 +1,10 @@ +Package: opie-quicklauncher +Files: bin/quicklauncher +Priority: required +Section: opie/system +Maintainer: Trolltech (www.trolltech.com) +Architecture: arm +Version: $QPE_VERSION$EXTRAVERSION +Depends: +Description: Quick launcher stub + Launcher stub for quick launch enabled applications. |