-rw-r--r-- | core/tools/quicklauncher/dropins.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/tools/quicklauncher/dropins.h b/core/tools/quicklauncher/dropins.h index a9664f8..df364ce 100644 --- a/core/tools/quicklauncher/dropins.h +++ b/core/tools/quicklauncher/dropins.h | |||
@@ -1,71 +1,71 @@ | |||
1 | /* OPIE */ | 1 | /* OPIE */ |
2 | #include <opie2/owait.h> | 2 | #include <opie2/owait.h> |
3 | using namespace Opie::Ui; | 3 | using namespace Opie::Ui; |
4 | 4 | ||
5 | #include <qtopia/qcom.h> | 5 | #include <qtopia/qcom.h> |
6 | #include <qtopia/qlibrary.h> | 6 | #include <qtopia/qlibrary.h> |
7 | #include <qtopia/qpeapplication.h> | 7 | #include <qtopia/qpeapplication.h> |
8 | #include <qtopia/applicationinterface.h> | 8 | #include <qtopia/applicationinterface.h> |
9 | #include <qtopia/resource.h> | 9 | #include <qtopia/resource.h> |
10 | 10 | ||
11 | /* QT */ | 11 | /* QT */ |
12 | #include <qmetaobject.h> | 12 | #include <qmetaobject.h> |
13 | #include <qmap.h> | 13 | #include <qmap.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | 15 | ||
16 | namespace QuickPrivate { | 16 | namespace QuickPrivate { |
17 | 17 | ||
18 | struct PluginLoader { | 18 | struct PluginLoader { |
19 | PluginLoader( const char* ) { | 19 | PluginLoader( const char* ) { |
20 | } | 20 | } |
21 | 21 | ||
22 | QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); | 22 | QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); |
23 | void releaseInterface( QUnknownInterface* ); | 23 | void releaseInterface( QUnknownInterface* ); |
24 | QMap<QUnknownInterface*, QLibrary*> libs; | 24 | QMap<QUnknownInterface*, QLibrary*> libs; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * We can skip installing a Translator here because Opies QPEApplication | 28 | * We can skip installing a Translator here because Opies QPEApplication |
29 | * will do that in initApp for us as well | 29 | * will do that in initApp for us as well |
30 | */ | 30 | */ |
31 | QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { | 31 | QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { |
32 | QRESULT res = QS_FALSE; | 32 | QRESULT res = QS_FALSE; |
33 | *iface = 0; | 33 | *iface = 0; |
34 | 34 | ||
35 | // This code is very platform specific.. We should find better | 35 | // This code is very platform specific.. We should find better |
36 | // solutions to handle names.. Maybe one central function would be | 36 | // solutions to handle names.. Maybe one central function would be |
37 | // better than checking this ".so" stuff all around in the sources.. | 37 | // better than checking this ".so" stuff all around in the sources.. |
38 | // (eilers) | 38 | // (eilers) |
39 | 39 | ||
40 | // Below lines from TT then mine again | 40 | // Below lines from TT then mine again |
41 | QString name = libFile; | 41 | QString name = libFile; |
42 | if ( libFile.findRev(".so") == (int)libFile.length()-3 ) { | 42 | if ( libFile.findRev(".so") == (int)libFile.length()-3 ) { |
43 | name = libFile.left( libFile.length()-3 ); | 43 | name = libFile.left( libFile.length()-3 ); |
44 | if ( name.find( "lib" ) == 0 ) | 44 | if ( name.find( "lib" ) == 0 ) |
45 | name = name.mid( 3 ); | 45 | name = name.mid( 3 ); |
46 | } | 46 | } |
47 | #ifdef Q_OS_MACX | 47 | #ifdef Q_OS_MACX |
48 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib"; | 48 | QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".dylib"; |
49 | #else | 49 | #else |
50 | QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so"; | 50 | QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".so"; |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | QLibrary *lib = new QLibrary( path ); | 53 | QLibrary *lib = new QLibrary( path ); |
54 | if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { | 54 | if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { |
55 | libs.insert( *iface, lib ); | 55 | libs.insert( *iface, lib ); |
56 | res = QS_OK; | 56 | res = QS_OK; |
57 | } | 57 | } |
58 | 58 | ||
59 | return res; | 59 | return res; |
60 | } | 60 | } |
61 | 61 | ||
62 | void PluginLoader::releaseInterface( QUnknownInterface* iface ) { | 62 | void PluginLoader::releaseInterface( QUnknownInterface* iface ) { |
63 | if ( libs.contains( iface ) ) { | 63 | if ( libs.contains( iface ) ) { |
64 | iface->release(); | 64 | iface->release(); |
65 | delete libs[iface]; | 65 | delete libs[iface]; |
66 | libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is | 66 | libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is |
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||