author | simon <simon> | 2002-04-30 14:19:15 (UTC) |
---|---|---|
committer | simon <simon> | 2002-04-30 14:19:15 (UTC) |
commit | aa2118f85ef44f5eb22babe5cc53421d7d981a94 (patch) (unidiff) | |
tree | 9bf42c8750d0ad5efb789e5fb3e1b2c43cdea25d /core/launcher/qcopbridge.cpp | |
parent | 19d341250ca5c5f21ea278ebdc7050c5400e951f (diff) | |
download | opie-aa2118f85ef44f5eb22babe5cc53421d7d981a94.zip opie-aa2118f85ef44f5eb22babe5cc53421d7d981a94.tar.gz opie-aa2118f85ef44f5eb22babe5cc53421d7d981a94.tar.bz2 |
- no default args in method impls
- don't unconditionally define _XOPEN_SOURCE (added comment about this
being wrong)
- fixed parameter shadowing problem in DesktopApplication ctor
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/qcopbridge.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp index c8af919..2d084fc 100644 --- a/core/launcher/qcopbridge.cpp +++ b/core/launcher/qcopbridge.cpp | |||
@@ -24,39 +24,43 @@ | |||
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | 26 | ||
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qfile.h> | 28 | #include <qfile.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qdatastream.h> | 30 | #include <qdatastream.h> |
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qfileinfo.h> | 32 | #include <qfileinfo.h> |
33 | #include <qregexp.h> | 33 | #include <qregexp.h> |
34 | #include <qcopchannel_qws.h> | 34 | #include <qcopchannel_qws.h> |
35 | 35 | ||
36 | // actually this is wrong, _XOPEN_SOURCE should get defined on the commandline | ||
37 | // and it should have a proper value assigned. (Simon) | ||
38 | #if !defined(_XOPEN_SOURCE) | ||
36 | #define _XOPEN_SOURCE | 39 | #define _XOPEN_SOURCE |
40 | #endif | ||
37 | #include <pwd.h> | 41 | #include <pwd.h> |
38 | #include <sys/types.h> | 42 | #include <sys/types.h> |
39 | #include <unistd.h> | 43 | #include <unistd.h> |
40 | 44 | ||
41 | #if defined(_OS_LINUX_) | 45 | #if defined(_OS_LINUX_) |
42 | #include <shadow.h> | 46 | #include <shadow.h> |
43 | #endif | 47 | #endif |
44 | 48 | ||
45 | //#define INSECURE | 49 | //#define INSECURE |
46 | 50 | ||
47 | const int block_size = 51200; | 51 | const int block_size = 51200; |
48 | 52 | ||
49 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent = 0, | 53 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, |
50 | const char* name = 0) | 54 | const char* name ) |
51 | : QServerSocket( port, 1, parent, name ), | 55 | : QServerSocket( port, 1, parent, name ), |
52 | desktopChannel( 0 ), | 56 | desktopChannel( 0 ), |
53 | cardChannel( 0 ) | 57 | cardChannel( 0 ) |
54 | { | 58 | { |
55 | if ( !ok() ) | 59 | if ( !ok() ) |
56 | qWarning( "Failed to bind to port %d", port ); | 60 | qWarning( "Failed to bind to port %d", port ); |
57 | else { | 61 | else { |
58 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); | 62 | desktopChannel = new QCopChannel( "QPE/Desktop", this ); |
59 | connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 63 | connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
60 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); | 64 | this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); |
61 | cardChannel = new QCopChannel( "QPE/Card", this ); | 65 | cardChannel = new QCopChannel( "QPE/Card", this ); |
62 | connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 66 | connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
@@ -160,25 +164,25 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
160 | for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) { | 164 | for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) { |
161 | pi->sendDesktopMessage( sendCommand ); | 165 | pi->sendDesktopMessage( sendCommand ); |
162 | } | 166 | } |
163 | } | 167 | } |
164 | 168 | ||
165 | void QCopBridge::timerEvent( QTimerEvent * ) | 169 | void QCopBridge::timerEvent( QTimerEvent * ) |
166 | { | 170 | { |
167 | sendSync = FALSE; | 171 | sendSync = FALSE; |
168 | killTimers(); | 172 | killTimers(); |
169 | } | 173 | } |
170 | 174 | ||
171 | 175 | ||
172 | QCopBridgePI::QCopBridgePI( int socket, QObject *parent = 0, const char* name = 0 ) | 176 | QCopBridgePI::QCopBridgePI( int socket, QObject *parent, const char* name ) |
173 | : QSocket( parent, name ) | 177 | : QSocket( parent, name ) |
174 | { | 178 | { |
175 | setSocket( socket ); | 179 | setSocket( socket ); |
176 | 180 | ||
177 | peerport = peerPort(); | 181 | peerport = peerPort(); |
178 | peeraddress = peerAddress(); | 182 | peeraddress = peerAddress(); |
179 | 183 | ||
180 | #ifndef INSECURE | 184 | #ifndef INSECURE |
181 | if ( !accessAuthorized(peeraddress) ) { | 185 | if ( !accessAuthorized(peeraddress) ) { |
182 | state = Forbidden; | 186 | state = Forbidden; |
183 | startTimer( 0 ); | 187 | startTimer( 0 ); |
184 | } else | 188 | } else |