-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 ) OCOPClient::~OCOPClient() { close( m_socket ); } -void OCOPClient::init( const QCString& str ) { +void OCOPClient::init( const QCString& ) { struct sockaddr_un unix_adr; if ( (m_socket = socket(PF_UNIX, SOCK_STREAM, 0) ) < 0 ) { qWarning("could not socket"); @@ -62,7 +62,7 @@ void OCOPClient::newData() { case OCOPPacket::Return: case OCOPPacket::Signal: /* is Registered should be handled sync */ - case OCOPPacket::isRegistered: + case OCOPPacket::IsRegistered: break; /* emit the signal */ case OCOPPacket::Call: @@ -70,7 +70,7 @@ void OCOPClient::newData() { break; } } -OCOPPacket OCOPClient::packet() { +OCOPPacket OCOPClient::packet() const{ QCString chan; QCString func; QByteArray ar; @@ -82,7 +82,7 @@ OCOPPacket OCOPClient::packet() { read(m_socket, func.data(), head.funclen ); read(m_socket, ar.data(), head.datalen ); } - OCOPPacket pack(head.type, chan, func, data ); + OCOPPacket pack(head.type, chan, func, ar ); return pack; } /* @@ -90,7 +90,7 @@ OCOPPacket OCOPClient::packet() { * so we send and go on read * this will be blocked */ -bool OCOPClient::isRegistered( const QCString& chan ) { +bool OCOPClient::isRegistered( const QCString& chan ) const{ /* should I disconnect the socket notfier? */ OCOPPacket packe(OCOPPacket::IsRegistered, chan ); OCOPHead head = packe.head(); @@ -103,7 +103,7 @@ bool OCOPClient::isRegistered( const QCString& chan ) { if ( pack.channel() == chan ) { QCString func = pack.header(); if (func[0] == 1 ) - return; + return true; } return false; @@ -112,15 +112,15 @@ void OCOPClient::send( const QCString& chan, const QCString& fu, const QByteArra OCOPPacket pack(OCOPPacket::Call, chan, fu, arr ); call( pack ); } -void OCOPClient::addChannel(const QCString& channet) { +void OCOPClient::addChannel(const QCString& channel) { OCOPPacket pack(OCOPPacket::RegisterChannel, channel ); call( pack ); } void OCOPClient::delChannel(const QCString& chan ) { - OCOPPacket pack(OCOPPacket::UnregisterChannel, channel ); + OCOPPacket pack(OCOPPacket::UnregisterChannel, chan ); call( pack ); } -void OCOPPacket::call( const OCOPPacket& pack ) { +void OCOPClient::call( const OCOPPacket& pack ) { OCOPHead head = pack.head(); write(m_socket, &head, sizeof(head) ); 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: void init(const QCString& pa); void newData(); private: - OCOPPacket packet(); + OCOPPacket packet()const; void call( const OCOPPacket& ); 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 \ ../../library/windowdecorationinterface.h \ ../../library/textcodecinterface.h \ ../../library/imagecodecinterface.h \ + qt/qcopchannel_qws.h \ qpe/qpeapplication.h \ - qpe/fontmanager.h + qpe/fontmanager.h \ + ../ipc/client/ocopclient.h \ + ../ipc/common/ocoppacket.h + SOURCES = ../../library/calendar.cpp \ ../../library/global.cpp \ @@ -106,17 +110,30 @@ SOURCES = ../../library/calendar.cpp \ ../../library/backend/vobject.cpp \ ../../library/findwidget_p.cpp \ ../../library/finddialog.cpp \ - ../../library/lnkproperties.cpp + ../../library/lnkproperties.cpp \ + qt/qcopchannel_qws.cpp \ + qpe/qpeapplication.cpp \ + ../ipc/client/ocopclient.cpp \ + ../ipc/common/ocoppacket.cpp # Qt 3 compatibility -qt2:HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h -qt2:SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp +HEADERS += ../../library/quuid.h \ + ../../library/qcom.h \ + ../../library/qlibrary.h \ + ../../library/qlibrary_p.h + +SOURCES += ../../library/quuid.cpp \ + ../../library/qlibrary.cpp \ + ../../library/qlibrary_unix.cpp + INCLUDEPATH += $(OPIEDIR)/include backend LIBS += -ldl -lcrypt -lm + INTERFACES = ../../library/passwordbase_p.ui \ ../../library/categoryeditbase_p.ui \ ../../library/findwidgetbase_p.ui \ ../../library/lnkpropertiesbase_p.ui + TARGET = qpe-x11 DESTDIR = $(QTDIR)/lib$(PROJMAK) # 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 @@ -#include "../ipc/client/ocopclient.h" +#include "../../ipc/client/ocopclient.h" #include <qcopchannel_qws.h> @@ -27,9 +27,9 @@ bool QCopChannel::isRegistered( const QCString& chan) { } bool QCopChannel::send( const QCString& chan, const QCString& msg ) { QByteArray ar(0); - return return sendLocally(chan, msg, ar ); + return sendLocally(chan, msg, ar ); } -bool QCString::send( const QCString& chan, const QCString& msg, +bool QCopChannel::send( const QCString& chan, const QCString& msg, const QByteArray& ar ) { return sendLocally( chan, msg, ar ); } @@ -42,5 +42,5 @@ bool QCopChannel::sendLocally( const QCString& chan, const QCString& msg, } void QCopChannel::rev( const QCString& chan, const QCString& msg, const QByteArray& ar ) { if (chan == m_chan ) - emit received(chan, msg, ar ); + emit received(msg, ar ); } |