-rw-r--r-- | core/launcher/irserver.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp index 579c78c..63f8d05 100644 --- a/core/launcher/irserver.cpp +++ b/core/launcher/irserver.cpp | |||
@@ -15,49 +15,53 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | 21 | ||
22 | #include "irserver.h" | 22 | #include "irserver.h" |
23 | 23 | ||
24 | #include <qtopia/qlibrary.h> | 24 | #include <qtopia/qlibrary.h> |
25 | #include <qtopia/qpeapplication.h> | 25 | #include <qtopia/qpeapplication.h> |
26 | 26 | ||
27 | #include <qtranslator.h> | 27 | #include <qtranslator.h> |
28 | 28 | ||
29 | #include "obexinterface.h" | 29 | #include "obexinterface.h" |
30 | 30 | ||
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | 32 | ||
33 | IrServer::IrServer( QObject *parent, const char *name ) | 33 | IrServer::IrServer( QObject *parent, const char *name ) |
34 | : QObject( parent, name ), obexIface(0) | 34 | : QObject( parent, name ), obexIface(0) |
35 | { | 35 | { |
36 | lib = 0; | 36 | lib = 0; |
37 | obexIface = 0; | 37 | obexIface = 0; |
38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; | 38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; |
39 | #ifdef Q_OS_MACX | ||
40 | QDir dir( path, "lib*.dylib" ); | ||
41 | #else | ||
39 | QDir dir( path, "lib*.so" ); | 42 | QDir dir( path, "lib*.so" ); |
43 | #endif /* Q_OS_MACX */ | ||
40 | QStringList list = dir.entryList(); | 44 | QStringList list = dir.entryList(); |
41 | QStringList::Iterator it; | 45 | QStringList::Iterator it; |
42 | for ( it = list.begin(); it != list.end(); ++it ) { | 46 | for ( it = list.begin(); it != list.end(); ++it ) { |
43 | QLibrary *trylib = new QLibrary( path + *it ); | 47 | QLibrary *trylib = new QLibrary( path + *it ); |
44 | //qDebug("trying lib %s", (path + (*it)).latin1() ); | 48 | //qDebug("trying lib %s", (path + (*it)).latin1() ); |
45 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { | 49 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { |
46 | lib = trylib; | 50 | lib = trylib; |
47 | //qDebug("found obex lib" ); | 51 | //qDebug("found obex lib" ); |
48 | QString lang = getenv( "LANG" ); | 52 | QString lang = getenv( "LANG" ); |
49 | QTranslator * trans = new QTranslator(qApp); | 53 | QTranslator * trans = new QTranslator(qApp); |
50 | QString type = (*it).left( (*it).find(".") ); | 54 | QString type = (*it).left( (*it).find(".") ); |
51 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 55 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
52 | //qDebug("tr fpr obex: %s", tfn.latin1() ); | 56 | //qDebug("tr fpr obex: %s", tfn.latin1() ); |
53 | if ( trans->load( tfn )) | 57 | if ( trans->load( tfn )) |
54 | qApp->installTranslator( trans ); | 58 | qApp->installTranslator( trans ); |
55 | else | 59 | else |
56 | delete trans; | 60 | delete trans; |
57 | 61 | ||
58 | break; | 62 | break; |
59 | } else { | 63 | } else { |
60 | delete lib; | 64 | delete lib; |
61 | } | 65 | } |
62 | } | 66 | } |
63 | if ( !lib ) | 67 | if ( !lib ) |