summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
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 @@
#define OpieBtObex_H
+#ifdef BLUETOOTH
@@ -116,3 +117,3 @@ private slots:
-
+#endif //BLUETOOTH
#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
CONFIG += qt warn_on
-HEADERS = obex.h btobex.h obexhandler.h obexsend.h receiver.h obeximpl.h obexbase.h obexserver.h
-SOURCES = obex.cpp btobex.cpp obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp obexbase.cpp obexserver.cpp
+HEADERS = obex.h obexhandler.h obexsend.h receiver.h obeximpl.h obexbase.h obexserver.h
+SOURCES = obex.cpp obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp obexbase.cpp obexserver.cpp
TARGET = opieobex
@@ -16,2 +16,6 @@ target.path = $$prefix/plugins/applets
#FIXME: These parameters are used if bluetooth is used
+CONFTEST = $$system( echo $CONFIG_LIBOPIETOOTH )
+contains( CONFTEST, y ){
+HEADERS += btobex.h
+SOURCES += btobex.cpp
INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
@@ -19,2 +23,2 @@ LIBS += -lopietooth1 -lbluetooth -lopenobex
DEFINES += BLUETOOTH
-
+}
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 @@
#include "obex.h"
+#ifdef BLUETOOTH
#include "btobex.h"
+#endif
#include "obexsend.h"
using namespace OpieObex;
+#ifdef BLUETOOTH
using namespace OpieTooth;
+#endif
@@ -16,4 +20,6 @@ using namespace OpieTooth;
#include <qpe/version.h>
+#ifdef BLUETOOTH
#include <devicehandler.h>
#include "remotedevice.h"
+#endif
@@ -54,2 +60,3 @@ void SendWidget::initUI() {
+#ifdef BLUETOOTH
m_btobex = new BtObex(this, "btobex");
@@ -65,3 +72,3 @@ void SendWidget::initUI() {
this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) );
-
+#endif
}
@@ -75,3 +82,5 @@ void SendWidget::send( const QString& file, const QString& desc ) {
m_irDa.clear();
+#ifdef BLUETOOTH
m_bt.clear();
+#endif
m_start = 0;
@@ -90,2 +99,3 @@ void SendWidget::send( const QString& file, const QString& desc ) {
}
+#ifdef BLUETOOTH
if ( !QCopChannel::isRegistered("QPE/Bluetooth") )
@@ -101,2 +111,3 @@ void SendWidget::send( const QString& file, const QString& desc ) {
read_receivers();
+#endif
}
@@ -136,2 +147,3 @@ void SendWidget::slotIrDaDevices( const QStringList& list) {
void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
+#ifdef BLUETOOTH
for(QMap<QString, QString>::ConstIterator it = str.begin();
@@ -144,2 +156,5 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
+#else
+ (void)str;
+#endif
}
@@ -165,2 +180,3 @@ void SendWidget::slotIrError( int ) {
void SendWidget::slotIrSent( bool b) {
+#ifdef BLUETOOTH
QString text = b ? tr("Sent") : tr("Failure");
@@ -169,2 +185,5 @@ void SendWidget::slotIrSent( bool b) {
slotStartIrda();
+#else
+ (void)b;
+#endif
}
@@ -198,2 +217,3 @@ void SendWidget::slotBtError( int ) {
void SendWidget::slotBtSent( bool b) {
+#ifdef BLUETOOTH
QString text = b ? tr("Sent") : tr("Failure");
@@ -202,7 +222,15 @@ void SendWidget::slotBtSent( bool b) {
slotStartBt();
+#else
+ (void)b;
+#endif
}
void SendWidget::slotBtTry(unsigned int trI) {
+#ifdef BLUETOOTH
setReceiverStatus( m_btIt.key(), tr("Try %1").arg( QString::number( trI ) ) );
+#else
+ (void)trI;
+#endif
}
void SendWidget::slotStartBt() {
+#ifdef BLUETOOTH
// skip past unselected receivers
@@ -220,2 +248,3 @@ void SendWidget::slotStartBt() {
m_btobex->send( m_file, m_btIt.data().second() );
+#endif
}
@@ -223,3 +252,5 @@ void SendWidget::slotStartBt() {
void SendWidget::send_to_receivers() {
+#ifdef BLUETOOTH
slotStartBt();
+#endif
slotStartIrda();
@@ -227,2 +258,3 @@ void SendWidget::send_to_receivers() {
+#ifdef BLUETOOTH
/**
@@ -255,3 +287,3 @@ void SendWidget::read_receivers()
}
-
+#endif
@@ -263,4 +295,5 @@ void SendWidget::scan_for_receivers()
m_irDa.clear();
+#ifdef BLUETOOTH
m_bt.clear();
-
+#endif
if ( QCopChannel::isRegistered("QPE/IrDaApplet") )
@@ -272,2 +305,3 @@ void SendWidget::scan_for_receivers()
+#ifdef BLUETOOTH
if ( QCopChannel::isRegistered("QPE/Bluetooth") )
@@ -278,2 +312,3 @@ void SendWidget::scan_for_receivers()
}
+#endif
}
@@ -295,4 +330,6 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
m_obex = NULL;
+#ifdef BLUETOOTH
delete m_btobex;
m_btobex = NULL;
+#endif
obexSendBase::closeEvent(evt);
@@ -301,2 +338,3 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
}
+#ifdef BLUETOOTH
{
@@ -304,2 +342,3 @@ void SendWidget::closeEvent( QCloseEvent* evt) {
}
+#endif
}
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 {
class Obex;
+#ifdef BLUETOOTH
class BtObex;
+#endif
@@ -46,3 +48,5 @@ namespace OpieObex {
void closeEvent( QCloseEvent* );
+#ifdef BLUETOOTH
void read_receivers();
+#endif
@@ -65,2 +69,3 @@ namespace OpieObex {
void slotBTDevices( const QMap<QString, QString>& );
+
void slotSelectedDevice( int id, int dev );
@@ -89,4 +94,6 @@ namespace OpieObex {
QMap<int, QString>::Iterator m_irDaIt;
+#ifdef BLUETOOTH
QMap<int, Pair > m_bt;
QMap<int, Pair>::Iterator m_btIt;
+#endif
QMap<int, QListViewItem *> receivers;
@@ -94,3 +101,5 @@ namespace OpieObex {
Obex* m_obex;
+#ifdef BLUETOOTH
BtObex* m_btobex;
+#endif
};
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) {
m_obex = new Obex(this, "Receiver");
+#ifdef BLUETOOTH
else
m_obex = new BtObex(this, "Receiver");
+#endif
connect(m_obex, SIGNAL(receivedFile(const QString&) ),