summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/irserver.cpp37
-rw-r--r--core/launcher/irserver.h25
2 files changed, 52 insertions, 10 deletions
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp
index 625cb60..579c78c 100644
--- a/core/launcher/irserver.cpp
+++ b/core/launcher/irserver.cpp
@@ -1,20 +1,40 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21
1#include "irserver.h" 22#include "irserver.h"
2 23
3#include <qpe/qlibrary.h> 24#include <qtopia/qlibrary.h>
4#include <qpe/qpeapplication.h> 25#include <qtopia/qpeapplication.h>
5 26
6#include <qtranslator.h> 27#include <qtranslator.h>
7#include <stdlib.h>
8 28
9#include "obexinterface.h" 29#include "obexinterface.h"
10 30
11#include <qdir.h> 31#include <qdir.h>
12 32
13IrServer::IrServer( QObject *parent, const char *name ) 33IrServer::IrServer( QObject *parent, const char *name )
14 : QObject( parent, name ) 34 : QObject( parent, name ), obexIface(0)
15{ 35{
16 lib = 0; 36 lib = 0;
17 iface = 0; 37 obexIface = 0;
18 QString path = QPEApplication::qpeDir() + "/plugins/obex/"; 38 QString path = QPEApplication::qpeDir() + "/plugins/obex/";
19 QDir dir( path, "lib*.so" ); 39 QDir dir( path, "lib*.so" );
20 QStringList list = dir.entryList(); 40 QStringList list = dir.entryList();
@@ -22,7 +42,7 @@ IrServer::IrServer( QObject *parent, const char *name )
22 for ( it = list.begin(); it != list.end(); ++it ) { 42 for ( it = list.begin(); it != list.end(); ++it ) {
23 QLibrary *trylib = new QLibrary( path + *it ); 43 QLibrary *trylib = new QLibrary( path + *it );
24 //qDebug("trying lib %s", (path + (*it)).latin1() ); 44 //qDebug("trying lib %s", (path + (*it)).latin1() );
25 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 45 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) {
26 lib = trylib; 46 lib = trylib;
27 //qDebug("found obex lib" ); 47 //qDebug("found obex lib" );
28 QString lang = getenv( "LANG" ); 48 QString lang = getenv( "LANG" );
@@ -46,7 +66,8 @@ IrServer::IrServer( QObject *parent, const char *name )
46 66
47IrServer::~IrServer() 67IrServer::~IrServer()
48{ 68{
49 if ( iface ) 69 if ( obexIface )
50 iface->release(); 70 obexIface->release();
51 delete lib; 71 delete lib;
52} 72}
73
diff --git a/core/launcher/irserver.h b/core/launcher/irserver.h
index b3434dd..a20f5e9 100644
--- a/core/launcher/irserver.h
+++ b/core/launcher/irserver.h
@@ -1,11 +1,32 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
1#ifndef IRSERVER_H 21#ifndef IRSERVER_H
2#define IRSERVER_H 22#define IRSERVER_H
3 23
24#include <qtopia/global.h>
4#include <qobject.h> 25#include <qobject.h>
5 26
6class QCopChannel; 27class QCopChannel;
7class QLibrary;
8struct ObexInterface; 28struct ObexInterface;
29class QLibrary;
9 30
10class IrServer : public QObject 31class IrServer : public QObject
11{ 32{
@@ -16,7 +37,7 @@ public:
16 37
17private: 38private:
18 QLibrary *lib; 39 QLibrary *lib;
19 ObexInterface *iface; 40 ObexInterface *obexIface;
20}; 41};
21 42
22#endif 43#endif