summaryrefslogtreecommitdiff
path: root/core/launcher/qcopbridge.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 24f471d..53efba4 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -20,135 +20,135 @@
#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/version.h>
#include <qtextstream.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
//#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 &)) );
+ 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 &)) );
+ connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
#endif
}
sendSync = FALSE;
openConnections.setAutoDelete( TRUE );
authorizeConnections();
}
QCopBridge::~QCopBridge()
{
#ifndef QT_NO_COP
delete desktopChannel;
#endif
}
void QCopBridge::authorizeConnections()
{
Config cfg("Security");
cfg.setGroup("SyncMode");
m_mode = Mode(cfg.readNumEntry("Mode", Sharp ));
QListIterator<QCopBridgePI> it(openConnections);
while ( it.current() ) {
if ( !it.current()->verifyAuthorised() ) {
- disconnect ( it.current(), SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) );
+ disconnect ( it.current(), SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
openConnections.removeRef( it.current() );
} else
++it;
}
}
void QCopBridge::newConnection( int socket )
{
QCopBridgePI *pi = new QCopBridgePI( socket, this );
openConnections.append( pi );
- connect ( pi, SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) );
+ connect ( pi, SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
/* ### libqtopia merge FIXME */
#if 0
QPEApplication::setTempScreenSaverMode( QPEApplication::DisableSuspend );
#endif
#ifndef QT_NO_COP
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
#endif
if ( sendSync ) {
pi ->startSync();
sendSync = FALSE;
}
}
void QCopBridge::closed( QCopBridgePI *pi )
{
emit connectionClosed( pi->peerAddress() );
openConnections.removeRef( pi );
if ( openConnections.count() == 0 ) {
/* ### FIXME libqtopia merge */
#if 0
QPEApplication::setTempScreenSaverMode( QPEApplication::Enable );
#endif
#ifndef QT_NO_COP
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
#endif
}
}
void QCopBridge::closeOpenConnections()
{
QCopBridgePI *pi;
for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() )
pi->close();
}
void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data )
{
if ( command == "startSync()" ) {
// we need to buffer it a bit
sendSync = TRUE;
startTimer( 20000 );
}
if ( m_mode & Qtopia1_7 ) {
// send the command to all open connections