summaryrefslogtreecommitdiff
path: root/core/qws/qcopbridge.cpp
authorar <ar>2004-05-02 17:11:49 (UTC)
committer ar <ar>2004-05-02 17:11:49 (UTC)
commit18759e9156c96795831120408a9da0d3b4ec71a4 (patch) (unidiff)
treebfc1a5560340b77a1918855e9915d133898ec189 /core/qws/qcopbridge.cpp
parent4d3379027557e251201b531896974a69ae4c665a (diff)
downloadopie-18759e9156c96795831120408a9da0d3b4ec71a4.zip
opie-18759e9156c96795831120408a9da0d3b4ec71a4.tar.gz
opie-18759e9156c96795831120408a9da0d3b4ec71a4.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'core/qws/qcopbridge.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/qws/qcopbridge.cpp18
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
@@ -18,21 +18,25 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
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>
37 41
38#if defined(_OS_LINUX_) 42#if defined(_OS_LINUX_)
@@ -47,13 +51,13 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent ,
47 const char* name ) 51 const char* name )
48 : QServerSocket( port, 1, parent, name ), 52 : QServerSocket( port, 1, parent, name ),
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&)),
58 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) ); 62 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
59 cardChannel = new QCopChannel( "QPE/Card", this ); 63 cardChannel = new QCopChannel( "QPE/Card", this );
@@ -107,19 +111,19 @@ void QCopBridge::closeOpenConnections()
107void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args ) 111void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args )
108{ 112{
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 );
124 128
125 QStringList paramList = QStringList::split( ",", params ); 129 QStringList paramList = QStringList::split( ",", params );
@@ -140,13 +144,13 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args
140 str = QString::number( i ); 144 str = QString::number( i );
141 } else if ( *it == "bool" ) { 145 } else if ( *it == "bool" ) {
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++) {
151 QChar ch = str[i]; 155 QChar ch = str[i];
152 if ( ch.row() ) 156 if ( ch.row() )
@@ -232,13 +236,13 @@ QCopBridgePI::~QCopBridgePI()
232 236
233} 237}
234 238
235void QCopBridgePI::connectionClosed() 239void 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
242void QCopBridgePI::sendDesktopMessage( const QString &msg ) 246void QCopBridgePI::sendDesktopMessage( const QString &msg )
243{ 247{
244 QString str = "CALL QPE/Desktop " + msg; 248 QString str = "CALL QPE/Desktop " + msg;
@@ -247,24 +251,24 @@ void QCopBridgePI::sendDesktopMessage( const QString &msg )
247 251
248 252
249void QCopBridgePI::send( const QString& msg ) 253void 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
256void QCopBridgePI::read() 260void QCopBridgePI::read()
257{ 261{
258 while ( canReadLine() ) 262 while ( canReadLine() )
259 process( readLine().stripWhiteSpace() ); 263 process( readLine().stripWhiteSpace() );
260} 264}
261 265
262void QCopBridgePI::process( const QString& message ) 266void 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;
269 273
270 // command token 274 // command token