author | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
commit | a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (patch) (unidiff) | |
tree | 5ce78e1a5dedd31b7851d53bf9f072bd44edd1b0 /core/obex/obexhandler.cpp | |
parent | a7e015198a8c5ad3b6e144a9032b059086253e00 (diff) | |
download | opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.zip opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.gz opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | core/obex/obexhandler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/obex/obexhandler.cpp b/core/obex/obexhandler.cpp index 6509d12..5aaf63c 100644 --- a/core/obex/obexhandler.cpp +++ b/core/obex/obexhandler.cpp | |||
@@ -1,58 +1,60 @@ | |||
1 | #include <qcopchannel_qws.h> | 1 | #include <qcopchannel_qws.h> |
2 | 2 | ||
3 | #include <qpe/qcopenvelope_qws.h> | 3 | #include <qpe/qcopenvelope_qws.h> |
4 | 4 | ||
5 | #include "obexsend.h" | 5 | #include "obexsend.h" |
6 | #include "receiver.h" | 6 | #include "receiver.h" |
7 | #include "obexhandler.h" | 7 | #include "obexhandler.h" |
8 | 8 | ||
9 | using namespace OpieObex; | 9 | using namespace OpieObex; |
10 | 10 | ||
11 | /* TRANSLATOR OpieObex::ObexHandler */ | ||
12 | |||
11 | ObexHandler::ObexHandler() { | 13 | ObexHandler::ObexHandler() { |
12 | m_wasRec = false; | 14 | m_wasRec = false; |
13 | m_sender = 0l; | 15 | m_sender = 0l; |
14 | m_receiver = 0l; | 16 | m_receiver = 0l; |
15 | QCopChannel* chan = new QCopChannel("QPE/Obex"); | 17 | QCopChannel* chan = new QCopChannel("QPE/Obex"); |
16 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), | 18 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), |
17 | this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); | 19 | this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); |
18 | } | 20 | } |
19 | ObexHandler::~ObexHandler() { | 21 | ObexHandler::~ObexHandler() { |
20 | delete m_sender; | 22 | delete m_sender; |
21 | delete m_receiver; | 23 | delete m_receiver; |
22 | } | 24 | } |
23 | void ObexHandler::doSend(const QString& str, const QString& desc) { | 25 | void ObexHandler::doSend(const QString& str, const QString& desc) { |
24 | delete m_sender; | 26 | delete m_sender; |
25 | m_sender = new SendWidget; | 27 | m_sender = new SendWidget; |
26 | m_sender->raise(); | 28 | m_sender->raise(); |
27 | m_sender->showMaximized(); | 29 | m_sender->showMaximized(); |
28 | connect(m_sender, SIGNAL(done() ), | 30 | connect(m_sender, SIGNAL(done() ), |
29 | this, SLOT(slotSent() ) ); | 31 | this, SLOT(slotSent() ) ); |
30 | m_sender->send( str, desc ); | 32 | m_sender->send( str, desc ); |
31 | } | 33 | } |
32 | void ObexHandler::doReceive(bool b) { | 34 | void ObexHandler::doReceive(bool b) { |
33 | if (m_receiver && b ) return; // we should enable receiver and it is on | 35 | if (m_receiver && b ) return; // we should enable receiver and it is on |
34 | else if (!m_receiver && !b ) return; // we should disbale receiver and it is off | 36 | else if (!m_receiver && !b ) return; // we should disbale receiver and it is off |
35 | else if (m_receiver && !b ) { | 37 | else if (m_receiver && !b ) { |
36 | delete m_receiver; | 38 | delete m_receiver; |
37 | m_receiver=0; | 39 | m_receiver=0; |
38 | }else if (!m_receiver && b ) { | 40 | }else if (!m_receiver && b ) { |
39 | m_receiver= new Receiver; | 41 | m_receiver= new Receiver; |
40 | } | 42 | } |
41 | } | 43 | } |
42 | void ObexHandler::slotSent() { | 44 | void ObexHandler::slotSent() { |
43 | QString file = m_sender->file(); | 45 | QString file = m_sender->file(); |
44 | delete m_sender; | 46 | delete m_sender; |
45 | m_sender = 0; | 47 | m_sender = 0; |
46 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); | 48 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); |
47 | e << file; | 49 | e << file; |
48 | doReceive(m_wasRec ); | 50 | doReceive(m_wasRec ); |
49 | m_wasRec = false; | 51 | m_wasRec = false; |
50 | } | 52 | } |
51 | void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { | 53 | void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { |
52 | QDataStream stream( data, IO_ReadOnly ); | 54 | QDataStream stream( data, IO_ReadOnly ); |
53 | if ( msg == "send(QString,QString,QString)" ) { | 55 | if ( msg == "send(QString,QString,QString)" ) { |
54 | QString name, desc; | 56 | QString name, desc; |
55 | stream >> desc; | 57 | stream >> desc; |
56 | stream >> name; | 58 | stream >> name; |
57 | m_wasRec = (m_receiver != 0 ); | 59 | m_wasRec = (m_receiver != 0 ); |
58 | doReceive( false ); | 60 | doReceive( false ); |