summaryrefslogtreecommitdiff
path: root/core
authorkorovkin <korovkin>2006-12-03 14:09:33 (UTC)
committer korovkin <korovkin>2006-12-03 14:09:33 (UTC)
commita691909050b60b94f5525093062c23d0fab11d1b (patch) (unidiff)
tree1e1d82e76d85cd75c094ae36441ec852bb5ac456 /core
parent9813113f0024205e09af9e54328287dd859fa2e8 (diff)
downloadopie-a691909050b60b94f5525093062c23d0fab11d1b.zip
opie-a691909050b60b94f5525093062c23d0fab11d1b.tar.gz
opie-a691909050b60b94f5525093062c23d0fab11d1b.tar.bz2
Made OBEX library buildable if bluetooth support is disabled.
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/btobex.h3
-rw-r--r--core/obex/obex.pro10
-rw-r--r--core/obex/obexsend.cpp45
-rw-r--r--core/obex/obexsend.h9
-rw-r--r--core/obex/receiver.cpp2
5 files changed, 62 insertions, 7 deletions
diff --git a/core/obex/btobex.h b/core/obex/btobex.h
index 7e91c06..d9bd886 100644
--- a/core/obex/btobex.h
+++ b/core/obex/btobex.h
@@ -34,2 +34,3 @@
34#define OpieBtObex_H 34#define OpieBtObex_H
35#ifdef BLUETOOTH
35 36
@@ -116,3 +117,3 @@ private slots:
116 117
117 118#endif //BLUETOOTH
118#endif 119#endif
diff --git a/core/obex/obex.pro b/core/obex/obex.pro
index 1fc6958..05118ab 100644
--- a/core/obex/obex.pro
+++ b/core/obex/obex.pro
@@ -2,4 +2,4 @@ TEMPLATE = lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 HEADERS= obex.h btobex.h obexhandler.h obexsend.h receiver.h obeximpl.h obexbase.h obexserver.h 3 HEADERS= obex.h obexhandler.h obexsend.h receiver.h obeximpl.h obexbase.h obexserver.h
4 SOURCES= obex.cpp btobex.cpp obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp obexbase.cpp obexserver.cpp 4 SOURCES= obex.cpp obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp obexbase.cpp obexserver.cpp
5 TARGET = opieobex 5 TARGET = opieobex
@@ -16,2 +16,6 @@ target.path = $$prefix/plugins/applets
16#FIXME: These parameters are used if bluetooth is used 16#FIXME: These parameters are used if bluetooth is used
17CONFTEST = $$system( echo $CONFIG_LIBOPIETOOTH )
18contains( CONFTEST, y ){
19HEADERS += btobex.h
20SOURCES += btobex.cpp
17INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib 21INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
@@ -19,2 +23,2 @@ LIBS += -lopietooth1 -lbluetooth -lopenobex
19DEFINES += BLUETOOTH 23DEFINES += BLUETOOTH
20 24}
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
index 45754e3..d58b4e9 100644
--- a/core/obex/obexsend.cpp
+++ b/core/obex/obexsend.cpp
@@ -6,6 +6,10 @@
6#include "obex.h" 6#include "obex.h"
7#ifdef BLUETOOTH
7#include "btobex.h" 8#include "btobex.h"
9#endif
8#include "obexsend.h" 10#include "obexsend.h"
9using namespace OpieObex; 11using namespace OpieObex;
12#ifdef BLUETOOTH
10using namespace OpieTooth; 13using namespace OpieTooth;
14#endif
11 15
@@ -16,4 +20,6 @@ using namespace OpieTooth;
16#include <qpe/version.h> 20#include <qpe/version.h>
21#ifdef BLUETOOTH
17#include <devicehandler.h> 22#include <devicehandler.h>
18#include "remotedevice.h" 23#include "remotedevice.h"
24#endif
19 25
@@ -54,2 +60,3 @@ void SendWidget::initUI() {
54 60
61#ifdef BLUETOOTH
55 m_btobex = new BtObex(this, "btobex"); 62 m_btobex = new BtObex(this, "btobex");
@@ -65,3 +72,3 @@ void SendWidget::initUI() {
65 this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) ); 72 this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) );
66 73#endif
67} 74}
@@ -75,3 +82,5 @@ void SendWidget::send( const QString& file, const QString& desc ) {
75 m_irDa.clear(); 82 m_irDa.clear();
83#ifdef BLUETOOTH
76 m_bt.clear(); 84 m_bt.clear();
85#endif
77 m_start = 0; 86 m_start = 0;
@@ -90,2 +99,3 @@ void SendWidget::send( const QString& file, const QString& desc ) {
90 } 99 }
100#ifdef BLUETOOTH
91 if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) 101 if ( !QCopChannel::isRegistered("QPE/Bluetooth") )
@@ -101,2 +111,3 @@ void SendWidget::send( const QString& file, const QString& desc ) {
101 read_receivers(); 111 read_receivers();
112#endif
102} 113}
@@ -136,2 +147,3 @@ void SendWidget::slotIrDaDevices( const QStringList& list) {
136void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) { 147void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
148#ifdef BLUETOOTH
137 for(QMap<QString, QString>::ConstIterator it = str.begin(); 149 for(QMap<QString, QString>::ConstIterator it = str.begin();
@@ -144,2 +156,5 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
144 156
157#else
158 (void)str;
159#endif
145} 160}
@@ -165,2 +180,3 @@ void SendWidget::slotIrError( int ) {
165void SendWidget::slotIrSent( bool b) { 180void SendWidget::slotIrSent( bool b) {
181#ifdef BLUETOOTH
166 QString text = b ? tr("Sent") : tr("Failure"); 182 QString text = b ? tr("Sent") : tr("Failure");
@@ -169,2 +185,5 @@ void SendWidget::slotIrSent( bool b) {
169 slotStartIrda(); 185 slotStartIrda();
186#else
187 (void)b;
188#endif
170} 189}
@@ -198,2 +217,3 @@ void SendWidget::slotBtError( int ) {
198void SendWidget::slotBtSent( bool b) { 217void SendWidget::slotBtSent( bool b) {
218#ifdef BLUETOOTH
199 QString text = b ? tr("Sent") : tr("Failure"); 219 QString text = b ? tr("Sent") : tr("Failure");
@@ -202,7 +222,15 @@ void SendWidget::slotBtSent( bool b) {
202 slotStartBt(); 222 slotStartBt();
223#else
224 (void)b;
225#endif
203} 226}
204void SendWidget::slotBtTry(unsigned int trI) { 227void SendWidget::slotBtTry(unsigned int trI) {
228#ifdef BLUETOOTH
205 setReceiverStatus( m_btIt.key(), tr("Try %1").arg( QString::number( trI ) ) ); 229 setReceiverStatus( m_btIt.key(), tr("Try %1").arg( QString::number( trI ) ) );
230#else
231 (void)trI;
232#endif
206} 233}
207void SendWidget::slotStartBt() { 234void SendWidget::slotStartBt() {
235#ifdef BLUETOOTH
208 // skip past unselected receivers 236 // skip past unselected receivers
@@ -220,2 +248,3 @@ void SendWidget::slotStartBt() {
220 m_btobex->send( m_file, m_btIt.data().second() ); 248 m_btobex->send( m_file, m_btIt.data().second() );
249#endif
221} 250}
@@ -223,3 +252,5 @@ void SendWidget::slotStartBt() {
223void SendWidget::send_to_receivers() { 252void SendWidget::send_to_receivers() {
253#ifdef BLUETOOTH
224 slotStartBt(); 254 slotStartBt();
255#endif
225 slotStartIrda(); 256 slotStartIrda();
@@ -227,2 +258,3 @@ void SendWidget::send_to_receivers() {
227 258
259#ifdef BLUETOOTH
228/** 260/**
@@ -255,3 +287,3 @@ void SendWidget::read_receivers()
255} 287}
256 288#endif
257 289
@@ -263,4 +295,5 @@ void SendWidget::scan_for_receivers()
263 m_irDa.clear(); 295 m_irDa.clear();
296#ifdef BLUETOOTH
264 m_bt.clear(); 297 m_bt.clear();
265 298#endif
266 if ( QCopChannel::isRegistered("QPE/IrDaApplet") ) 299 if ( QCopChannel::isRegistered("QPE/IrDaApplet") )
@@ -272,2 +305,3 @@ void SendWidget::scan_for_receivers()
272 305
306#ifdef BLUETOOTH
273 if ( QCopChannel::isRegistered("QPE/Bluetooth") ) 307 if ( QCopChannel::isRegistered("QPE/Bluetooth") )
@@ -278,2 +312,3 @@ void SendWidget::scan_for_receivers()
278 } 312 }
313#endif
279} 314}
@@ -295,4 +330,6 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
295 m_obex = NULL; 330 m_obex = NULL;
331#ifdef BLUETOOTH
296 delete m_btobex; 332 delete m_btobex;
297 m_btobex = NULL; 333 m_btobex = NULL;
334#endif
298 obexSendBase::closeEvent(evt); 335 obexSendBase::closeEvent(evt);
@@ -301,2 +338,3 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
301 } 338 }
339#ifdef BLUETOOTH
302 { 340 {
@@ -304,2 +342,3 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
304 } 342 }
343#endif
305} 344}
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h
index f9ba340..cc27354 100644
--- a/core/obex/obexsend.h
+++ b/core/obex/obexsend.h
@@ -23,3 +23,5 @@ namespace OpieObex {
23 class Obex; 23 class Obex;
24#ifdef BLUETOOTH
24 class BtObex; 25 class BtObex;
26#endif
25 27
@@ -46,3 +48,5 @@ namespace OpieObex {
46 void closeEvent( QCloseEvent* ); 48 void closeEvent( QCloseEvent* );
49#ifdef BLUETOOTH
47 void read_receivers(); 50 void read_receivers();
51#endif
48 52
@@ -65,2 +69,3 @@ namespace OpieObex {
65 void slotBTDevices( const QMap<QString, QString>& ); 69 void slotBTDevices( const QMap<QString, QString>& );
70
66 void slotSelectedDevice( int id, int dev ); 71 void slotSelectedDevice( int id, int dev );
@@ -89,4 +94,6 @@ namespace OpieObex {
89 QMap<int, QString>::Iterator m_irDaIt; 94 QMap<int, QString>::Iterator m_irDaIt;
95#ifdef BLUETOOTH
90 QMap<int, Pair > m_bt; 96 QMap<int, Pair > m_bt;
91 QMap<int, Pair>::Iterator m_btIt; 97 QMap<int, Pair>::Iterator m_btIt;
98#endif
92 QMap<int, QListViewItem *> receivers; 99 QMap<int, QListViewItem *> receivers;
@@ -94,3 +101,5 @@ namespace OpieObex {
94 Obex* m_obex; 101 Obex* m_obex;
102#ifdef BLUETOOTH
95 BtObex* m_btobex; 103 BtObex* m_btobex;
104#endif
96 }; 105 };
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp
index e153152..3190353 100644
--- a/core/obex/receiver.cpp
+++ b/core/obex/receiver.cpp
@@ -33,4 +33,6 @@ Receiver::Receiver(RecType type) {
33 m_obex = new Obex(this, "Receiver"); 33 m_obex = new Obex(this, "Receiver");
34#ifdef BLUETOOTH
34 else 35 else
35 m_obex = new BtObex(this, "Receiver"); 36 m_obex = new BtObex(this, "Receiver");
37#endif
36 connect(m_obex, SIGNAL(receivedFile(const QString&) ), 38 connect(m_obex, SIGNAL(receivedFile(const QString&) ),