summaryrefslogtreecommitdiff
path: root/core/launcher/qcopbridge.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 9cb56ce..b45f0cc 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -1,82 +1,83 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** 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"
+#include <opie2/oglobal.h>
+
#ifdef Q_WS_QWS
#include <qtopia/qcopenvelope_qws.h>
#endif
#include <qtopia/qpeapplication.h>
-#include <qtopia/global.h>
+
#include <qtopia/version.h>
#include <qtopia/config.h>
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdatastream.h>
#include <qcstring.h>
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qregexp.h>
#include <qtimer.h>
#ifdef Q_WS_QWS
#include <qcopchannel_qws.h>
#endif
#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
-#include "launcherglobal.h"
//#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 );
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;
@@ -304,49 +305,49 @@ bool QCopBridgePI::verifyAuthorised()
}
return TRUE;
}
void QCopBridgePI::myConnectionClosed()
{
emit connectionClosed( this );
}
void QCopBridgePI::sendDesktopMessage( const QString &msg )
{
QString str = "CALL QPE/Desktop " + msg; // No tr
send ( str );
}
void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& data )
{
if ( !isOpen() ) // eg. Forbidden
return;
const char hdr[]="CALLB QPE/Desktop ";
writeBlock(hdr,sizeof(hdr)-1);
writeBlock(msg,msg.length());
writeBlock(" ",1);
- QByteArray b64 = Opie::Global::encodeBase64(data);
+ QByteArray b64 = OGlobal::encodeBase64(data);
writeBlock(b64.data(),b64.size());
writeBlock("\r\n",2);
}
void QCopBridgePI::send( const QString& msg )
{
if ( !isOpen() ) // eg. Forbidden
return;
QTextStream os( this );
os << msg << endl;
//qDebug( "sending qcop message: %s", msg.latin1() );
}
void QCopBridgePI::read()
{
while ( canReadLine() ) {
timer->start( 300000, TRUE );
process( readLine().stripWhiteSpace() );
}
}
void QCopBridgePI::process( const QString& message )