summaryrefslogtreecommitdiff
path: root/core/launcher/qcopbridge.cpp
Unidiff
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp23
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
@@ -21,21 +21,24 @@
21#include "qcopbridge.h" 21#include "qcopbridge.h"
22#include "transferserver.h" 22#include "transferserver.h"
23 23
24/* OPIE */
25#include <opie2/odebug.h>
24#include <opie2/oglobal.h> 26#include <opie2/oglobal.h>
25
26#ifdef Q_WS_QWS 27#ifdef Q_WS_QWS
27#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
28#endif 29#endif
29#include <qtopia/qpeapplication.h> 30#include <qtopia/qpeapplication.h>
30
31#include <qtopia/version.h> 31#include <qtopia/version.h>
32using namespace Opie::Core;
32 33
34/* QT */
33#include <qtextstream.h> 35#include <qtextstream.h>
34#include <qtimer.h> 36#include <qtimer.h>
35#ifdef Q_WS_QWS 37#ifdef Q_WS_QWS
36#include <qcopchannel_qws.h> 38#include <qcopchannel_qws.h>
37#endif 39#endif
38 40
41/* STD */
39#ifndef _XOPEN_SOURCE 42#ifndef _XOPEN_SOURCE
40#define _XOPEN_SOURCE 43#define _XOPEN_SOURCE
41#endif 44#endif
@@ -49,12 +52,8 @@
49#include <shadow.h> 52#include <shadow.h>
50#endif 53#endif
51 54
52
53//#define INSECURE
54
55const int block_size = 51200; 55const int block_size = 51200;
56 56
57using namespace Opie::Core;
58QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
59 const char* name ) 58 const char* name )
60 : QServerSocket( port, 1, parent, name ), 59 : QServerSocket( port, 1, parent, name ),
@@ -62,7 +61,7 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
62 cardChannel( 0 ) 61 cardChannel( 0 )
63{ 62{
64 if ( !ok() ) 63 if ( !ok() )
65 qWarning( "Failed to bind to port %d", port ); 64 owarn << "Failed to bind to port " << port << "" << oendl;
66 else { 65 else {
67#ifndef QT_NO_COP 66#ifndef QT_NO_COP
68 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 67 desktopChannel = new QCopChannel( "QPE/Desktop", this );
@@ -171,13 +170,13 @@ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArra
171 170
172 int paren = command.find( "(" ); 171 int paren = command.find( "(" );
173 if ( paren <= 0 ) { 172 if ( paren <= 0 ) {
174 qDebug("DesktopMessage: bad qcop syntax"); 173 odebug << "DesktopMessage: bad qcop syntax" << oendl;
175 return; 174 return;
176 } 175 }
177 176
178 QString params = command.mid( paren + 1 ); 177 QString params = command.mid( paren + 1 );
179 if ( params[params.length()-1] != ')' ) { 178 if ( params[params.length()-1] != ')' ) {
180 qDebug("DesktopMessage: bad qcop syntax"); 179 odebug << "DesktopMessage: bad qcop syntax" << oendl;
181 return; 180 return;
182 } 181 }
183 182
@@ -204,7 +203,7 @@ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArra
204 stream >> i; 203 stream >> i;
205 str = QString::number( i ); 204 str = QString::number( i );
206 } else { 205 } else {
207 qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() ); 206 odebug << " cannot route the argument type " << (*it) << " throught the qcop bridge" << oendl;
208 return; 207 return;
209 } 208 }
210 QString estr; 209 QString estr;
@@ -332,7 +331,7 @@ void QCopBridgePI::send( const QString& msg )
332 return; 331 return;
333 QTextStream os( this ); 332 QTextStream os( this );
334 os << msg << endl; 333 os << msg << endl;
335 //qDebug( "sending qcop message: %s", msg.latin1() ); 334 //odebug << "sending qcop message: " << msg << "" << oendl;
336} 335}
337 336
338void QCopBridgePI::read() 337void QCopBridgePI::read()
@@ -345,7 +344,7 @@ void QCopBridgePI::read()
345 344
346void QCopBridgePI::process( const QString& message ) 345void QCopBridgePI::process( const QString& message )
347{ 346{
348 //qDebug( "Command: %s", message.latin1() ); 347 //odebug << "Command: " << message << "" << oendl;
349 348
350 // split message using "," as separator 349 // split message using "," as separator
351 QStringList msg = QStringList::split( " ", message ); 350 QStringList msg = QStringList::split( " ", message );