summaryrefslogtreecommitdiff
path: root/x11/libqpe-x11/qt/qcopchannel_qws.cpp
Unidiff
Diffstat (limited to 'x11/libqpe-x11/qt/qcopchannel_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--x11/libqpe-x11/qt/qcopchannel_qws.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/x11/libqpe-x11/qt/qcopchannel_qws.cpp b/x11/libqpe-x11/qt/qcopchannel_qws.cpp
new file mode 100644
index 0000000..efbef3f
--- a/dev/null
+++ b/x11/libqpe-x11/qt/qcopchannel_qws.cpp
@@ -0,0 +1,46 @@
1
2#include "../ipc/client/ocopclient.h"
3
4#include <qcopchannel_qws.h>
5
6QCopChannel::QCopChannel( const QCString& channel, QObject* parent,
7 const char* name )
8 : QObject( parent, name ),m_chan(channel) {
9 init();
10}
11QCopChannel::~QCopChannel() {
12 m_client->delChannel( m_chan );
13 delete m_client;
14}
15void QCopChannel::init() {
16 m_client = new OCOPClient(QString::null, this );
17 m_client->addChannel(m_chan );
18 connect(m_client, SIGNAL(called(const QCString&, const QCString&, const QByteArray& ) ),
19 this, SLOT(rev(const QCString&, const QCString&, const QByteArray&) ) );
20}
21QCString QCopChannel::channel()const {
22 return m_chan;
23}
24bool QCopChannel::isRegistered( const QCString& chan) {
25 OCOPClient client;
26 return client.isRegistered( chan );
27}
28bool QCopChannel::send( const QCString& chan, const QCString& msg ) {
29 QByteArray ar(0);
30 return return sendLocally(chan, msg, ar );
31}
32bool QCString::send( const QCString& chan, const QCString& msg,
33 const QByteArray& ar ) {
34 return sendLocally( chan, msg, ar );
35}
36bool QCopChannel::sendLocally( const QCString& chan, const QCString& msg,
37 const QByteArray& ar ) {
38 OCOPClient client;
39 client.send( chan, msg, ar );
40
41 return true;
42}
43void QCopChannel::rev( const QCString& chan, const QCString& msg, const QByteArray& ar ) {
44 if (chan == m_chan )
45 emit received(chan, msg, ar );
46}