author | harlekin <harlekin> | 2002-06-10 09:39:23 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-10 09:39:23 (UTC) |
commit | ca3838f3aa3bbfa3aba61f7aaa285b9be67ca426 (patch) (unidiff) | |
tree | b14274bbff3cd1140b9b1a1c84c2e97b712f1828 /core/applets/obex/obeximpl.cc | |
parent | 81add8ce87168282bb56a15f0406f3fec75cf610 (diff) | |
download | opie-ca3838f3aa3bbfa3aba61f7aaa285b9be67ca426.zip opie-ca3838f3aa3bbfa3aba61f7aaa285b9be67ca426.tar.gz opie-ca3838f3aa3bbfa3aba61f7aaa285b9be67ca426.tar.bz2 |
initial try
Diffstat (limited to 'core/applets/obex/obeximpl.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/obex/obeximpl.cc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/core/applets/obex/obeximpl.cc b/core/applets/obex/obeximpl.cc new file mode 100644 index 0000000..a3004ab --- a/dev/null +++ b/core/applets/obex/obeximpl.cc | |||
@@ -0,0 +1,50 @@ | |||
1 | |||
2 | |||
3 | #include "obex.h" | ||
4 | #include "obeximpl.h" | ||
5 | |||
6 | using namespace OpieObex; | ||
7 | |||
8 | ObexImpl::ObexImpl( ) | ||
9 | : QObject { | ||
10 | // register to a channel | ||
11 | m_obex = new Obex(this, "obex"); | ||
12 | m_chan = new QCopChannel("QPE/Obex" ); | ||
13 | cconnect(m_chan, SIGNAL(received(const QCString&, const QByteArray& ) ), | ||
14 | this, SLOT(slotMessage(const QCString&, const QByteArray&) ) ); | ||
15 | } | ||
16 | ObexImpl::~ObexImpl() { | ||
17 | delete m_obex; | ||
18 | delete m_chan; | ||
19 | } | ||
20 | QRESULT ObexImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { | ||
21 | *iface = 0; | ||
22 | if( uuid == IID_QUknown ) | ||
23 | *iface = this; | ||
24 | else if( uuid == IID_ObexInterface ) | ||
25 | *iface = this; | ||
26 | |||
27 | if(*iface ) | ||
28 | (*iface)->addRef(); | ||
29 | return QS_OK; | ||
30 | |||
31 | } | ||
32 | void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) { | ||
33 | QDataStrean stream( data, IO_ReadOnly ); | ||
34 | if(msg == "send(QString,QString,QString)" ) { | ||
35 | QString desc; | ||
36 | stream >> desc; | ||
37 | QString filename; | ||
38 | stream >> filename; | ||
39 | m_obex->send(filename ); | ||
40 | QCopEnvelope e ("QPE/Obex", "done(QString)" ): | ||
41 | e << filename; | ||
42 | }else if( ) { | ||
43 | |||
44 | } | ||
45 | } | ||
46 | |||
47 | Q_EXPORT_INTERFACE() | ||
48 | { | ||
49 | Q_CREATE_INSTANCE( IrdaAppletImpl ) | ||
50 | } | ||