Diffstat (limited to 'core/tools/quicklauncher/dropins.h') (more/less context) (show whitespace changes)
-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 | |||
@@ -24,48 +24,48 @@ namespace QuickPrivate { | |||
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 | ||