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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/x11/libqpe-x11/qt/qcopchannel_qws.cpp b/x11/libqpe-x11/qt/qcopchannel_qws.cpp
index 706756e..a82ba4d 100644
--- a/x11/libqpe-x11/qt/qcopchannel_qws.cpp
+++ b/x11/libqpe-x11/qt/qcopchannel_qws.cpp
@@ -1,40 +1,40 @@
1 1
2#include "../../ipc/client/ocopclient.h" 2#include "../../ipc/client/ocopclient.h"
3 3
4#include <qcopchannel_qws.h> 4#include <qcopchannel_qws.h>
5 5
6QList<QCopChannel>* QCopChannel::m_list = 0; 6QList<QCopChannel>* QCopChannel::m_list = 0;
7QMap<QCString, int> QCopChannel::m_refCount; 7QMap<QCString, int> QCopChannel::m_refCount;
8 8
9QCopChannel::QCopChannel( const QCString& channel, QObject* parent, 9QCopChannel::QCopChannel( const QCString& channel, QObject* parent,
10 const char* name ) 10 const char* name )
11 : QObject( parent, name ),m_chan(channel) { 11 : QObject( parent, name ),m_chan(channel) {
12 if (!m_list ) { 12 if (!m_list ) {
13 m_list = new QList<QCopChannel>; 13 m_list = new QList<QCopChannel>;
14 /* only connect once */ 14 /* only connect once */
15 connect(OCOPClient::self(), SIGNAL(called(const QCString&, const QCString&, const QByteArray& ) ), 15 connect(OCOPClient::self(), SIGNAL(called(const QCString&,const QCString&,const QByteArray&) ),
16 this, SLOT(rev(const QCString&, const QCString&, const QByteArray&) ) ); 16 this, SLOT(rev(const QCString&,const QCString&,const QByteArray&) ) );
17 } 17 }
18 /* first registration or ref count is 0 for m_chan*/ 18 /* first registration or ref count is 0 for m_chan*/
19 if (!m_refCount.contains( m_chan ) || !m_refCount[m_chan] ) { 19 if (!m_refCount.contains( m_chan ) || !m_refCount[m_chan] ) {
20 qWarning("adding channel %s", m_chan.data() ); 20 qWarning("adding channel %s", m_chan.data() );
21 m_refCount[m_chan] = 1; 21 m_refCount[m_chan] = 1;
22 OCOPClient::self()->addChannel( m_chan ); 22 OCOPClient::self()->addChannel( m_chan );
23 }else{ 23 }else{
24 qWarning("reffing up for %s %d", m_chan.data(), m_refCount[m_chan] ); 24 qWarning("reffing up for %s %d", m_chan.data(), m_refCount[m_chan] );
25 m_refCount[m_chan]++; 25 m_refCount[m_chan]++;
26 } 26 }
27 27
28 m_list->append(this); 28 m_list->append(this);
29} 29}
30void QCopChannel::receive( const QCString& msg, const QByteArray& ar ) { 30void QCopChannel::receive( const QCString& msg, const QByteArray& ar ) {
31 emit received( msg, ar ); 31 emit received( msg, ar );
32} 32}
33QCopChannel::~QCopChannel() { 33QCopChannel::~QCopChannel() {
34 if (m_refCount[m_chan] == 1 ) { 34 if (m_refCount[m_chan] == 1 ) {
35 OCOPClient::self()->delChannel( m_chan ); 35 OCOPClient::self()->delChannel( m_chan );
36 m_refCount[m_chan] = 0; 36 m_refCount[m_chan] = 0;
37 }else 37 }else
38 m_refCount[m_chan]--; 38 m_refCount[m_chan]--;
39 39
40 40