-rw-r--r-- | core/qws/qcopbridge.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/core/qws/qcopbridge.cpp b/core/qws/qcopbridge.cpp index 4fd0807..822efb7 100644 --- a/core/qws/qcopbridge.cpp +++ b/core/qws/qcopbridge.cpp | |||
@@ -20,17 +20,21 @@ | |||
20 | 20 | ||
21 | #include "qcopbridge.h" | 21 | #include "qcopbridge.h" |
22 | #include "transferserver.h" | 22 | #include "transferserver.h" |
23 | 23 | ||
24 | /* OPIE */ | ||
24 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/version.h> | 27 | #include <qpe/version.h> |
28 | #include <opie2/odebug.h> | ||
27 | 29 | ||
30 | /* QT */ | ||
28 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
29 | #ifdef QWS | 32 | #ifdef QWS |
30 | #include <qcopchannel_qws.h> | 33 | #include <qcopchannel_qws.h> |
31 | #endif | 34 | #endif |
32 | 35 | ||
36 | /* STD */ | ||
33 | #define _XOPEN_SOURCE | 37 | #define _XOPEN_SOURCE |
34 | #include <pwd.h> | 38 | #include <pwd.h> |
35 | #include <sys/types.h> | 39 | #include <sys/types.h> |
36 | #include <unistd.h> | 40 | #include <unistd.h> |
@@ -49,9 +53,9 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent , | |||
49 | desktopChannel( 0 ), | 53 | desktopChannel( 0 ), |
50 | cardChannel( 0 ) | 54 | cardChannel( 0 ) |
51 | { | 55 | { |
52 | if ( !ok() ) | 56 | if ( !ok() ) |
53 | qWarning( "Failed to bind to port %d", port ); | 57 | owarn << "Failed to bind to port " << port << "" << oendl; |
54 | else { | 58 | else { |
55 | #ifndef QT_NO_COP | 59 | #ifndef QT_NO_COP |
56 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); | 60 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); |
57 | connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 61 | connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
@@ -109,15 +113,15 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
109 | command.stripWhiteSpace(); | 113 | command.stripWhiteSpace(); |
110 | 114 | ||
111 | int paren = command.find( "(" ); | 115 | int paren = command.find( "(" ); |
112 | if ( paren <= 0 ) { | 116 | if ( paren <= 0 ) { |
113 | qDebug("DesktopMessage: bad qcop syntax"); | 117 | odebug << "DesktopMessage: bad qcop syntax" << oendl; |
114 | return; | 118 | return; |
115 | } | 119 | } |
116 | 120 | ||
117 | QString params = command.mid( paren + 1 ); | 121 | QString params = command.mid( paren + 1 ); |
118 | if ( params[params.length()-1] != ')' ) { | 122 | if ( params[params.length()-1] != ')' ) { |
119 | qDebug("DesktopMessage: bad qcop syntax"); | 123 | odebug << "DesktopMessage: bad qcop syntax" << oendl; |
120 | return; | 124 | return; |
121 | } | 125 | } |
122 | 126 | ||
123 | params.truncate( params.length()-1 ); | 127 | params.truncate( params.length()-1 ); |
@@ -142,9 +146,9 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
142 | int i; | 146 | int i; |
143 | stream >> i; | 147 | stream >> i; |
144 | str = QString::number( i ); | 148 | str = QString::number( i ); |
145 | } else { | 149 | } else { |
146 | qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() ); | 150 | odebug << " cannot route the argument type " << (*it) << " throught the qcop bridge" << oendl; |
147 | return; | 151 | return; |
148 | } | 152 | } |
149 | QString estr; | 153 | QString estr; |
150 | for (int i=0; i<(int)str.length(); i++) { | 154 | for (int i=0; i<(int)str.length(); i++) { |
@@ -234,9 +238,9 @@ QCopBridgePI::~QCopBridgePI() | |||
234 | 238 | ||
235 | void QCopBridgePI::connectionClosed() | 239 | void QCopBridgePI::connectionClosed() |
236 | { | 240 | { |
237 | emit connectionClosed( this ); | 241 | emit connectionClosed( this ); |
238 | // qDebug( "Debug: Connection closed" ); | 242 | // odebug << "Debug: Connection closed" << oendl; |
239 | delete this; | 243 | delete this; |
240 | } | 244 | } |
241 | 245 | ||
242 | void QCopBridgePI::sendDesktopMessage( const QString &msg ) | 246 | void QCopBridgePI::sendDesktopMessage( const QString &msg ) |
@@ -249,9 +253,9 @@ void QCopBridgePI::sendDesktopMessage( const QString &msg ) | |||
249 | void QCopBridgePI::send( const QString& msg ) | 253 | void QCopBridgePI::send( const QString& msg ) |
250 | { | 254 | { |
251 | QTextStream os( this ); | 255 | QTextStream os( this ); |
252 | os << msg << endl; | 256 | os << msg << endl; |
253 | //qDebug( "sending qcop message: %s", msg.latin1() ); | 257 | //odebug << "sending qcop message: " << msg << "" << oendl; |
254 | } | 258 | } |
255 | 259 | ||
256 | void QCopBridgePI::read() | 260 | void QCopBridgePI::read() |
257 | { | 261 | { |
@@ -260,9 +264,9 @@ void QCopBridgePI::read() | |||
260 | } | 264 | } |
261 | 265 | ||
262 | void QCopBridgePI::process( const QString& message ) | 266 | void QCopBridgePI::process( const QString& message ) |
263 | { | 267 | { |
264 | //qDebug( "Command: %s", message.latin1() ); | 268 | //odebug << "Command: " << message << "" << oendl; |
265 | 269 | ||
266 | // split message using "," as separator | 270 | // split message using "," as separator |
267 | QStringList msg = QStringList::split( " ", message ); | 271 | QStringList msg = QStringList::split( " ", message ); |
268 | if ( msg.isEmpty() ) return; | 272 | if ( msg.isEmpty() ) return; |