Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/qcopbridge.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp index 33df6c4..e339dc7 100644 --- a/core/launcher/qcopbridge.cpp +++ b/core/launcher/qcopbridge.cpp @@ -16,58 +16,57 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qcopbridge.h" #include "transferserver.h" +/* OPIE */ +#include <opie2/odebug.h> #include <opie2/oglobal.h> - #ifdef Q_WS_QWS #include <qtopia/qcopenvelope_qws.h> #endif #include <qtopia/qpeapplication.h> - #include <qtopia/version.h> +using namespace Opie::Core; +/* QT */ #include <qtextstream.h> #include <qtimer.h> #ifdef Q_WS_QWS #include <qcopchannel_qws.h> #endif +/* STD */ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #endif #ifndef Q_OS_WIN32 #include <pwd.h> #include <unistd.h> #include <sys/types.h> #endif #if defined(_OS_LINUX_) #include <shadow.h> #endif - -//#define INSECURE - const int block_size = 51200; -using namespace Opie::Core; 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&)) ); @@ -166,23 +165,23 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data /* * Old compat mode */ void QCopBridge::sendDesktopMessageOld( 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() ) { @@ -199,17 +198,17 @@ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArra 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()) { @@ -327,30 +326,30 @@ void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& da void QCopBridgePI::send( const QString& msg ) { if ( !isOpen() ) // eg. Forbidden return; QTextStream os( this ); os << msg << endl; - //qDebug( "sending qcop message: %s", msg.latin1() ); + //odebug << "sending qcop message: " << msg << "" << oendl; } void QCopBridgePI::read() { while ( canReadLine() ) { timer->start( 300000, TRUE ); 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(); |