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) (side-by-side diff)
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
@@ -12,54 +12,58 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qcopbridge.h"
#include "transferserver.h"
+/* OPIE */
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <qpe/version.h>
+#include <opie2/odebug.h>
+/* QT */
#include <qtextstream.h>
#ifdef QWS
#include <qcopchannel_qws.h>
#endif
+/* STD */
#define _XOPEN_SOURCE
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#if defined(_OS_LINUX_)
#include <shadow.h>
#endif
//#define INSECURE
const int block_size = 51200;
QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent ,
const char* name )
: QServerSocket( port, 1, parent, name ),
desktopChannel( 0 ),
cardChannel( 0 )
{
if ( !ok() )
- qWarning( "Failed to bind to port %d", port );
+ owarn << "Failed to bind to port " << port << "" << oendl;
else {
#ifndef QT_NO_COP
desktopChannel = new QCopChannel( "QPE/Desktop", this );
connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
cardChannel = new QCopChannel( "QPE/Card", this );
connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
#endif
}
sendSync = FALSE;
}
@@ -101,31 +105,31 @@ void QCopBridge::closeOpenConnections()
QCopBridgePI *pi;
for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() )
pi->close();
}
void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args )
{
command.stripWhiteSpace();
int paren = command.find( "(" );
if ( paren <= 0 ) {
- qDebug("DesktopMessage: bad qcop syntax");
+ odebug << "DesktopMessage: bad qcop syntax" << oendl;
return;
}
QString params = command.mid( paren + 1 );
if ( params[params.length()-1] != ')' ) {
- qDebug("DesktopMessage: bad qcop syntax");
+ odebug << "DesktopMessage: bad qcop syntax" << oendl;
return;
}
params.truncate( params.length()-1 );
QStringList paramList = QStringList::split( ",", params );
QString data;
if ( paramList.count() ) {
QDataStream stream( args, IO_ReadOnly );
for ( QStringList::Iterator it = paramList.begin(); it != paramList.end(); ++it ) {
QString str;
if ( *it == "QString" ) {
@@ -134,25 +138,25 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args
QCString cstr;
stream >> cstr;
str = QString::fromLocal8Bit( cstr );
} else if ( *it == "int" ) {
int i;
stream >> i;
str = QString::number( i );
} else if ( *it == "bool" ) {
int i;
stream >> i;
str = QString::number( i );
} else {
- qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() );
+ odebug << " cannot route the argument type " << (*it) << " throught the qcop bridge" << oendl;
return;
}
QString estr;
for (int i=0; i<(int)str.length(); i++) {
QChar ch = str[i];
if ( ch.row() )
goto quick;
switch (ch.cell()) {
case '&':
estr.append( "&amp;" );
break;
case ' ':
@@ -226,51 +230,51 @@ QCopBridgePI::QCopBridgePI( int socket, QObject *parent , const char* name )
}
}
QCopBridgePI::~QCopBridgePI()
{
}
void QCopBridgePI::connectionClosed()
{
emit connectionClosed( this );
- // qDebug( "Debug: Connection closed" );
+ // odebug << "Debug: Connection closed" << oendl;
delete this;
}
void QCopBridgePI::sendDesktopMessage( const QString &msg )
{
QString str = "CALL QPE/Desktop " + msg;
send ( str );
}
void QCopBridgePI::send( const QString& msg )
{
QTextStream os( this );
os << msg << endl;
- //qDebug( "sending qcop message: %s", msg.latin1() );
+ //odebug << "sending qcop message: " << msg << "" << oendl;
}
void QCopBridgePI::read()
{
while ( canReadLine() )
process( readLine().stripWhiteSpace() );
}
void QCopBridgePI::process( const QString& message )
{
- //qDebug( "Command: %s", message.latin1() );
+ //odebug << "Command: " << message << "" << oendl;
// split message using "," as separator
QStringList msg = QStringList::split( " ", message );
if ( msg.isEmpty() ) return;
// command token
QString cmd = msg[0].upper();
// argument token
QString arg;
if ( msg.count() >= 2 )
arg = msg[1];