author | zecke <zecke> | 2002-10-16 01:05:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-16 01:05:42 (UTC) |
commit | 3e973543b77631d053a9616b5540966dbe51ab47 (patch) (unidiff) | |
tree | 8b47c7015ec9706b2dc794ce0cf382d50f47b680 /x11 | |
parent | 65ef0e86a879332cbf8b1575886d3c36c7d2d9bd (diff) | |
download | opie-3e973543b77631d053a9616b5540966dbe51ab47.zip opie-3e973543b77631d053a9616b5540966dbe51ab47.tar.gz opie-3e973543b77631d053a9616b5540966dbe51ab47.tar.bz2 |
Make it link
-rw-r--r-- | x11/ipc/client/ocopclient.cpp | 18 | ||||
-rw-r--r-- | x11/ipc/client/ocopclient.h | 2 | ||||
-rw-r--r-- | x11/libqpe-x11/libqpe-x11.pro | 25 | ||||
-rw-r--r-- | x11/libqpe-x11/qt/qcopchannel_qws.cpp | 8 |
4 files changed, 35 insertions, 18 deletions
diff --git a/x11/ipc/client/ocopclient.cpp b/x11/ipc/client/ocopclient.cpp index 1c25271..43e426c 100644 --- a/x11/ipc/client/ocopclient.cpp +++ b/x11/ipc/client/ocopclient.cpp | |||
@@ -21,7 +21,7 @@ OCOPClient::OCOPClient( const QString& path, QObject* obj ) | |||
21 | OCOPClient::~OCOPClient() { | 21 | OCOPClient::~OCOPClient() { |
22 | close( m_socket ); | 22 | close( m_socket ); |
23 | } | 23 | } |
24 | void OCOPClient::init( const QCString& str ) { | 24 | void OCOPClient::init( const QCString& ) { |
25 | struct sockaddr_un unix_adr; | 25 | struct sockaddr_un unix_adr; |
26 | if ( (m_socket = socket(PF_UNIX, SOCK_STREAM, 0) ) < 0 ) { | 26 | if ( (m_socket = socket(PF_UNIX, SOCK_STREAM, 0) ) < 0 ) { |
27 | qWarning("could not socket"); | 27 | qWarning("could not socket"); |
@@ -62,7 +62,7 @@ void OCOPClient::newData() { | |||
62 | case OCOPPacket::Return: | 62 | case OCOPPacket::Return: |
63 | case OCOPPacket::Signal: | 63 | case OCOPPacket::Signal: |
64 | /* is Registered should be handled sync */ | 64 | /* is Registered should be handled sync */ |
65 | case OCOPPacket::isRegistered: | 65 | case OCOPPacket::IsRegistered: |
66 | break; | 66 | break; |
67 | /* emit the signal */ | 67 | /* emit the signal */ |
68 | case OCOPPacket::Call: | 68 | case OCOPPacket::Call: |
@@ -70,7 +70,7 @@ void OCOPClient::newData() { | |||
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | OCOPPacket OCOPClient::packet() { | 73 | OCOPPacket OCOPClient::packet() const{ |
74 | QCString chan; | 74 | QCString chan; |
75 | QCString func; | 75 | QCString func; |
76 | QByteArray ar; | 76 | QByteArray ar; |
@@ -82,7 +82,7 @@ OCOPPacket OCOPClient::packet() { | |||
82 | read(m_socket, func.data(), head.funclen ); | 82 | read(m_socket, func.data(), head.funclen ); |
83 | read(m_socket, ar.data(), head.datalen ); | 83 | read(m_socket, ar.data(), head.datalen ); |
84 | } | 84 | } |
85 | OCOPPacket pack(head.type, chan, func, data ); | 85 | OCOPPacket pack(head.type, chan, func, ar ); |
86 | return pack; | 86 | return pack; |
87 | } | 87 | } |
88 | /* | 88 | /* |
@@ -90,7 +90,7 @@ OCOPPacket OCOPClient::packet() { | |||
90 | * so we send and go on read | 90 | * so we send and go on read |
91 | * this will be blocked | 91 | * this will be blocked |
92 | */ | 92 | */ |
93 | bool OCOPClient::isRegistered( const QCString& chan ) { | 93 | bool OCOPClient::isRegistered( const QCString& chan ) const{ |
94 | /* should I disconnect the socket notfier? */ | 94 | /* should I disconnect the socket notfier? */ |
95 | OCOPPacket packe(OCOPPacket::IsRegistered, chan ); | 95 | OCOPPacket packe(OCOPPacket::IsRegistered, chan ); |
96 | OCOPHead head = packe.head(); | 96 | OCOPHead head = packe.head(); |
@@ -103,7 +103,7 @@ bool OCOPClient::isRegistered( const QCString& chan ) { | |||
103 | if ( pack.channel() == chan ) { | 103 | if ( pack.channel() == chan ) { |
104 | QCString func = pack.header(); | 104 | QCString func = pack.header(); |
105 | if (func[0] == 1 ) | 105 | if (func[0] == 1 ) |
106 | return; | 106 | return true; |
107 | } | 107 | } |
108 | 108 | ||
109 | return false; | 109 | return false; |
@@ -112,15 +112,15 @@ void OCOPClient::send( const QCString& chan, const QCString& fu, const QByteArra | |||
112 | OCOPPacket pack(OCOPPacket::Call, chan, fu, arr ); | 112 | OCOPPacket pack(OCOPPacket::Call, chan, fu, arr ); |
113 | call( pack ); | 113 | call( pack ); |
114 | } | 114 | } |
115 | void OCOPClient::addChannel(const QCString& channet) { | 115 | void OCOPClient::addChannel(const QCString& channel) { |
116 | OCOPPacket pack(OCOPPacket::RegisterChannel, channel ); | 116 | OCOPPacket pack(OCOPPacket::RegisterChannel, channel ); |
117 | call( pack ); | 117 | call( pack ); |
118 | } | 118 | } |
119 | void OCOPClient::delChannel(const QCString& chan ) { | 119 | void OCOPClient::delChannel(const QCString& chan ) { |
120 | OCOPPacket pack(OCOPPacket::UnregisterChannel, channel ); | 120 | OCOPPacket pack(OCOPPacket::UnregisterChannel, chan ); |
121 | call( pack ); | 121 | call( pack ); |
122 | } | 122 | } |
123 | void OCOPPacket::call( const OCOPPacket& pack ) { | 123 | void OCOPClient::call( const OCOPPacket& pack ) { |
124 | OCOPHead head = pack.head(); | 124 | OCOPHead head = pack.head(); |
125 | write(m_socket, &head, sizeof(head) ); | 125 | write(m_socket, &head, sizeof(head) ); |
126 | write(m_socket, pack.channel().data(), pack.channel().size() ); | 126 | write(m_socket, pack.channel().data(), pack.channel().size() ); |
diff --git a/x11/ipc/client/ocopclient.h b/x11/ipc/client/ocopclient.h index db04d37..e9544b9 100644 --- a/x11/ipc/client/ocopclient.h +++ b/x11/ipc/client/ocopclient.h | |||
@@ -47,7 +47,7 @@ private slots: | |||
47 | void init(const QCString& pa); | 47 | void init(const QCString& pa); |
48 | void newData(); | 48 | void newData(); |
49 | private: | 49 | private: |
50 | OCOPPacket packet(); | 50 | OCOPPacket packet()const; |
51 | void call( const OCOPPacket& ); | 51 | void call( const OCOPPacket& ); |
52 | 52 | ||
53 | QSocketNotifier* m_notify; | 53 | QSocketNotifier* m_notify; |
diff --git a/x11/libqpe-x11/libqpe-x11.pro b/x11/libqpe-x11/libqpe-x11.pro index 1d30f90..64c05fa 100644 --- a/x11/libqpe-x11/libqpe-x11.pro +++ b/x11/libqpe-x11/libqpe-x11.pro | |||
@@ -53,8 +53,12 @@ HEADERS = ../../library/calendar.h \ | |||
53 | ../../library/windowdecorationinterface.h \ | 53 | ../../library/windowdecorationinterface.h \ |
54 | ../../library/textcodecinterface.h \ | 54 | ../../library/textcodecinterface.h \ |
55 | ../../library/imagecodecinterface.h \ | 55 | ../../library/imagecodecinterface.h \ |
56 | qt/qcopchannel_qws.h \ | ||
56 | qpe/qpeapplication.h \ | 57 | qpe/qpeapplication.h \ |
57 | qpe/fontmanager.h | 58 | qpe/fontmanager.h \ |
59 | ../ipc/client/ocopclient.h \ | ||
60 | ../ipc/common/ocoppacket.h | ||
61 | |||
58 | 62 | ||
59 | SOURCES= ../../library/calendar.cpp \ | 63 | SOURCES= ../../library/calendar.cpp \ |
60 | ../../library/global.cpp \ | 64 | ../../library/global.cpp \ |
@@ -106,17 +110,30 @@ SOURCES = ../../library/calendar.cpp \ | |||
106 | ../../library/backend/vobject.cpp \ | 110 | ../../library/backend/vobject.cpp \ |
107 | ../../library/findwidget_p.cpp \ | 111 | ../../library/findwidget_p.cpp \ |
108 | ../../library/finddialog.cpp \ | 112 | ../../library/finddialog.cpp \ |
109 | ../../library/lnkproperties.cpp | 113 | ../../library/lnkproperties.cpp \ |
114 | qt/qcopchannel_qws.cpp \ | ||
115 | qpe/qpeapplication.cpp \ | ||
116 | ../ipc/client/ocopclient.cpp \ | ||
117 | ../ipc/common/ocoppacket.cpp | ||
110 | 118 | ||
111 | # Qt 3 compatibility | 119 | # Qt 3 compatibility |
112 | qt2:HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h | 120 | HEADERS += ../../library/quuid.h \ |
113 | qt2:SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp | 121 | ../../library/qcom.h \ |
122 | ../../library/qlibrary.h \ | ||
123 | ../../library/qlibrary_p.h | ||
124 | |||
125 | SOURCES += ../../library/quuid.cpp \ | ||
126 | ../../library/qlibrary.cpp \ | ||
127 | ../../library/qlibrary_unix.cpp | ||
128 | |||
114 | INCLUDEPATH += $(OPIEDIR)/include backend | 129 | INCLUDEPATH += $(OPIEDIR)/include backend |
115 | LIBS += -ldl -lcrypt -lm | 130 | LIBS += -ldl -lcrypt -lm |
131 | |||
116 | INTERFACES = ../../library/passwordbase_p.ui \ | 132 | INTERFACES = ../../library/passwordbase_p.ui \ |
117 | ../../library/categoryeditbase_p.ui \ | 133 | ../../library/categoryeditbase_p.ui \ |
118 | ../../library/findwidgetbase_p.ui \ | 134 | ../../library/findwidgetbase_p.ui \ |
119 | ../../library/lnkpropertiesbase_p.ui | 135 | ../../library/lnkpropertiesbase_p.ui |
136 | |||
120 | TARGET = qpe-x11 | 137 | TARGET = qpe-x11 |
121 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 138 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
122 | # This is set by configure$(OPIEDIR). | 139 | # This is set by configure$(OPIEDIR). |
diff --git a/x11/libqpe-x11/qt/qcopchannel_qws.cpp b/x11/libqpe-x11/qt/qcopchannel_qws.cpp index efbef3f..c315d66 100644 --- a/x11/libqpe-x11/qt/qcopchannel_qws.cpp +++ b/x11/libqpe-x11/qt/qcopchannel_qws.cpp | |||
@@ -1,5 +1,5 @@ | |||
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 | ||
@@ -27,9 +27,9 @@ bool QCopChannel::isRegistered( const QCString& chan) { | |||
27 | } | 27 | } |
28 | bool QCopChannel::send( const QCString& chan, const QCString& msg ) { | 28 | bool QCopChannel::send( const QCString& chan, const QCString& msg ) { |
29 | QByteArray ar(0); | 29 | QByteArray ar(0); |
30 | return return sendLocally(chan, msg, ar ); | 30 | return sendLocally(chan, msg, ar ); |
31 | } | 31 | } |
32 | bool QCString::send( const QCString& chan, const QCString& msg, | 32 | bool QCopChannel::send( const QCString& chan, const QCString& msg, |
33 | const QByteArray& ar ) { | 33 | const QByteArray& ar ) { |
34 | return sendLocally( chan, msg, ar ); | 34 | return sendLocally( chan, msg, ar ); |
35 | } | 35 | } |
@@ -42,5 +42,5 @@ bool QCopChannel::sendLocally( const QCString& chan, const QCString& msg, | |||
42 | } | 42 | } |
43 | void QCopChannel::rev( const QCString& chan, const QCString& msg, const QByteArray& ar ) { | 43 | void QCopChannel::rev( const QCString& chan, const QCString& msg, const QByteArray& ar ) { |
44 | if (chan == m_chan ) | 44 | if (chan == m_chan ) |
45 | emit received(chan, msg, ar ); | 45 | emit received(msg, ar ); |
46 | } | 46 | } |