-rw-r--r-- | core/launcher/irserver.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp index 63f8d05..a0e9c16 100644 --- a/core/launcher/irserver.cpp +++ b/core/launcher/irserver.cpp | |||
@@ -1,77 +1,76 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
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> | ||
28 | 27 | ||
29 | #include "obexinterface.h" | 28 | #include "obexinterface.h" |
30 | 29 | ||
31 | #include <qdir.h> | 30 | #include <qdir.h> |
32 | 31 | ||
33 | IrServer::IrServer( QObject *parent, const char *name ) | 32 | IrServer::IrServer( QObject *parent, const char *name ) |
34 | : QObject( parent, name ), obexIface(0) | 33 | : QObject( parent, name ), obexIface(0) |
35 | { | 34 | { |
36 | lib = 0; | 35 | lib = 0; |
37 | obexIface = 0; | 36 | obexIface = 0; |
38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; | 37 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; |
39 | #ifdef Q_OS_MACX | 38 | #ifdef Q_OS_MACX |
40 | QDir dir( path, "lib*.dylib" ); | 39 | QDir dir( path, "lib*.dylib" ); |
41 | #else | 40 | #else |
42 | QDir dir( path, "lib*.so" ); | 41 | QDir dir( path, "lib*.so" ); |
43 | #endif /* Q_OS_MACX */ | 42 | #endif /* Q_OS_MACX */ |
44 | QStringList list = dir.entryList(); | 43 | QStringList list = dir.entryList(); |
45 | QStringList::Iterator it; | 44 | QStringList::Iterator it; |
46 | for ( it = list.begin(); it != list.end(); ++it ) { | 45 | for ( it = list.begin(); it != list.end(); ++it ) { |
47 | QLibrary *trylib = new QLibrary( path + *it ); | 46 | QLibrary *trylib = new QLibrary( path + *it ); |
48 | //qDebug("trying lib %s", (path + (*it)).latin1() ); | 47 | //qDebug("trying lib %s", (path + (*it)).latin1() ); |
49 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { | 48 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { |
50 | lib = trylib; | 49 | lib = trylib; |
51 | //qDebug("found obex lib" ); | 50 | //qDebug("found obex lib" ); |
52 | QString lang = getenv( "LANG" ); | 51 | QString lang = getenv( "LANG" ); |
53 | QTranslator * trans = new QTranslator(qApp); | 52 | QTranslator * trans = new QTranslator(qApp); |
54 | QString type = (*it).left( (*it).find(".") ); | 53 | QString type = (*it).left( (*it).find(".") ); |
55 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 54 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
56 | //qDebug("tr fpr obex: %s", tfn.latin1() ); | 55 | //qDebug("tr fpr obex: %s", tfn.latin1() ); |
57 | if ( trans->load( tfn )) | 56 | if ( trans->load( tfn )) |
58 | qApp->installTranslator( trans ); | 57 | qApp->installTranslator( trans ); |
59 | else | 58 | else |
60 | delete trans; | 59 | delete trans; |
61 | 60 | ||
62 | break; | 61 | break; |
63 | } else { | 62 | } else { |
64 | delete lib; | 63 | delete lib; |
65 | } | 64 | } |
66 | } | 65 | } |
67 | if ( !lib ) | 66 | if ( !lib ) |
68 | qDebug("could not load IR plugin" ); | 67 | qDebug("could not load IR plugin" ); |
69 | } | 68 | } |
70 | 69 | ||
71 | IrServer::~IrServer() | 70 | IrServer::~IrServer() |
72 | { | 71 | { |
73 | if ( obexIface ) | 72 | if ( obexIface ) |
74 | obexIface->release(); | 73 | obexIface->release(); |
75 | delete lib; | 74 | delete lib; |
76 | } | 75 | } |
77 | 76 | ||