-rw-r--r-- | core/tools/quicklauncher/config.in | 2 | ||||
-rw-r--r-- | core/tools/quicklauncher/dropins.h | 6 | ||||
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 3 | ||||
-rw-r--r-- | core/tools/quicklauncher/quicklauncher.pro | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/core/tools/quicklauncher/config.in b/core/tools/quicklauncher/config.in index c105e94..eacbcf6 100644 --- a/core/tools/quicklauncher/config.in +++ b/core/tools/quicklauncher/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config QUICKLAUNCHER | 1 | config QUICKLAUNCHER |
2 | boolean "The Quick Launcher Loader" | 2 | boolean "The Quick Launcher Loader" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 && LIBOPIECORE2 |
diff --git a/core/tools/quicklauncher/dropins.h b/core/tools/quicklauncher/dropins.h index 3e2b5fd..7acace9 100644 --- a/core/tools/quicklauncher/dropins.h +++ b/core/tools/quicklauncher/dropins.h | |||
@@ -1,37 +1,37 @@ | |||
1 | 1 | ||
2 | #include <qstring.h> | 2 | #include <qstring.h> |
3 | #include <qtopia/qcom.h> | 3 | #include <qtopia/qcom.h> |
4 | #include <qtopia/qlibrary.h> | 4 | #include <qtopia/qlibrary.h> |
5 | #include <qtopia/applicationinterface.h> | 5 | #include <qtopia/applicationinterface.h> |
6 | #include <qtopia/resource.h> | 6 | #include <qtopia/resource.h> |
7 | 7 | ||
8 | #include <opie/owait.h> | 8 | #include <opie2/owait.h> |
9 | 9 | ||
10 | #include <qmetaobject.h> | 10 | #include <qmetaobject.h> |
11 | #include <qmap.h> | 11 | #include <qmap.h> |
12 | 12 | ||
13 | namespace Opie { | 13 | namespace QuickPrivate { |
14 | 14 | ||
15 | struct PluginLoader { | 15 | struct PluginLoader { |
16 | PluginLoader( const char* ) { | 16 | PluginLoader( const char* ) { |
17 | } | 17 | } |
18 | 18 | ||
19 | QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); | 19 | QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); |
20 | void releaseInterface( QUnknownInterface* ); | 20 | void releaseInterface( QUnknownInterface* ); |
21 | QMap<QUnknownInterface*, QLibrary*> libs; | 21 | QMap<QUnknownInterface*, QLibrary*> libs; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We can skip installing a Translator here because Opies QPEApplication | 25 | * We can skip installing a Translator here because Opies QPEApplication |
26 | * will do that in initApp for us as well | 26 | * will do that in initApp for us as well |
27 | */ | 27 | */ |
28 | QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { | 28 | QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { |
29 | QRESULT res = QS_FALSE; | 29 | QRESULT res = QS_FALSE; |
30 | *iface = 0; | 30 | *iface = 0; |
31 | 31 | ||
32 | // This code is very platform specific.. We should find better | 32 | // This code is very platform specific.. We should find better |
33 | // solutions to handle names.. Maybe one central function would be | 33 | // solutions to handle names.. Maybe one central function would be |
34 | // better than checking this ".so" stuff all around in the sources.. | 34 | // better than checking this ".so" stuff all around in the sources.. |
35 | // (eilers) | 35 | // (eilers) |
36 | 36 | ||
37 | // Below lines from TT then mine again | 37 | // Below lines from TT then mine again |
@@ -45,26 +45,24 @@ namespace Opie { | |||
45 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib"; | 45 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib"; |
46 | #else | 46 | #else |
47 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so"; | 47 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so"; |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | QLibrary *lib = new QLibrary( path ); | 50 | QLibrary *lib = new QLibrary( path ); |
51 | if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { | 51 | if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { |
52 | libs.insert( *iface, lib ); | 52 | libs.insert( *iface, lib ); |
53 | res = QS_OK; | 53 | res = QS_OK; |
54 | } | 54 | } |
55 | 55 | ||
56 | return res; | 56 | return res; |
57 | } | 57 | } |
58 | 58 | ||
59 | void PluginLoader::releaseInterface( QUnknownInterface* iface ) { | 59 | void PluginLoader::releaseInterface( QUnknownInterface* iface ) { |
60 | if ( libs.contains( iface ) ) { | 60 | if ( libs.contains( iface ) ) { |
61 | iface->release(); | 61 | iface->release(); |
62 | delete libs[iface]; | 62 | delete libs[iface]; |
63 | libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is | 63 | libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | } | 67 | } |
68 | 68 | ||
69 | /* small hack ;) */ | ||
70 | using namespace Opie; | ||
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index 1d6774c..f3055cc 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp | |||
@@ -18,61 +18,64 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpainter.h> | 21 | #include <qpainter.h> |
22 | #include <qstrlist.h> | 22 | #include <qstrlist.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qguardedptr.h> | 24 | #include <qguardedptr.h> |
25 | #include <qcopchannel_qws.h> | 25 | #include <qcopchannel_qws.h> |
26 | #define QTOPIA_INTERNAL_INITAPP | 26 | #define QTOPIA_INTERNAL_INITAPP |
27 | 27 | ||
28 | #ifdef private | 28 | #ifdef private |
29 | # undef private | 29 | # undef private |
30 | #endif | 30 | #endif |
31 | #define private public | 31 | #define private public |
32 | #include <qtopia/qpeapplication.h> | 32 | #include <qtopia/qpeapplication.h> |
33 | #undef private | 33 | #undef private |
34 | #include <stdio.h> | 34 | #include <stdio.h> |
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | #include <sys/types.h> | 36 | #include <sys/types.h> |
37 | #include <sys/stat.h> | 37 | #include <sys/stat.h> |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | 39 | ||
40 | #include "dropins.h" | 40 | #include "dropins.h" |
41 | 41 | ||
42 | using QuickPrivate::PluginLoader; | ||
43 | |||
42 | static QPEApplication *app = 0; | 44 | static QPEApplication *app = 0; |
43 | static PluginLoader *loader = 0; | 45 | static PluginLoader *loader = 0; |
44 | static ApplicationInterface *appIface = 0; | 46 | static ApplicationInterface *appIface = 0; |
45 | static QGuardedPtr<QWidget> mainWindow; | 47 | static QGuardedPtr<QWidget> mainWindow; |
46 | 48 | ||
47 | #ifdef _OS_LINUX_ | 49 | #ifdef _OS_LINUX_ |
48 | static char **argv0 = 0; | 50 | static char **argv0 = 0; |
49 | static int argv_lth; | 51 | static int argv_lth; |
50 | extern char **environ; | 52 | extern char **environ; |
51 | #ifndef SPT_BUFSIZE | 53 | #ifndef SPT_BUFSIZE |
52 | #define SPT_BUFSIZE 2048 | 54 | #define SPT_BUFSIZE 2048 |
53 | #endif | 55 | #endif |
54 | #include <stdarg.h> | 56 | #include <stdarg.h> |
57 | using namespace Opie::Ui; | ||
55 | void setproctitle (const char *fmt,...) { | 58 | void setproctitle (const char *fmt,...) { |
56 | int i; | 59 | int i; |
57 | char buf[SPT_BUFSIZE]; | 60 | char buf[SPT_BUFSIZE]; |
58 | va_list ap; | 61 | va_list ap; |
59 | 62 | ||
60 | if (!argv0) | 63 | if (!argv0) |
61 | return; | 64 | return; |
62 | 65 | ||
63 | va_start(ap, fmt); | 66 | va_start(ap, fmt); |
64 | (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap); | 67 | (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap); |
65 | va_end(ap); | 68 | va_end(ap); |
66 | 69 | ||
67 | i = strlen (buf); | 70 | i = strlen (buf); |
68 | if (i > argv_lth - 2) { | 71 | if (i > argv_lth - 2) { |
69 | i = argv_lth - 2; | 72 | i = argv_lth - 2; |
70 | buf[i] = '\0'; | 73 | buf[i] = '\0'; |
71 | } | 74 | } |
72 | memset(argv0[0], '\0', argv_lth); /* clear the memory area */ | 75 | memset(argv0[0], '\0', argv_lth); /* clear the memory area */ |
73 | (void) strcpy (argv0[0], buf); | 76 | (void) strcpy (argv0[0], buf); |
74 | 77 | ||
75 | argv0[1] = NULL; | 78 | argv0[1] = NULL; |
76 | } | 79 | } |
77 | #endif | 80 | #endif |
78 | 81 | ||
diff --git a/core/tools/quicklauncher/quicklauncher.pro b/core/tools/quicklauncher/quicklauncher.pro index 6ab5fc8..ae390e5 100644 --- a/core/tools/quicklauncher/quicklauncher.pro +++ b/core/tools/quicklauncher/quicklauncher.pro | |||
@@ -1,15 +1,15 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qtopia warn_on release | 2 | CONFIG += qtopia warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | 4 | ||
5 | HEADERS = dropins.h | 5 | HEADERS = dropins.h |
6 | SOURCES = main.cpp | 6 | SOURCES = main.cpp |
7 | INTERFACES= | 7 | INTERFACES= |
8 | 8 | ||
9 | INCLUDEPATH+= $(OPIEDIR)/include | 9 | INCLUDEPATH+= $(OPIEDIR)/include |
10 | LIBS += -lqpe -lopie | 10 | LIBS += -lqpe -lopiecore2 -lopieui2 |
11 | 11 | ||
12 | TARGET = quicklauncher | 12 | TARGET = quicklauncher |
13 | 13 | ||
14 | 14 | ||
15 | include ( $(OPIEDIR)/include.pro ) \ No newline at end of file | 15 | include ( $(OPIEDIR)/include.pro ) \ No newline at end of file |