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 | |
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
-rw-r--r-- | core/launcher/desktop.cpp | 4 | ||||
-rw-r--r-- | core/launcher/qcopbridge.cpp | 10 | ||||
-rw-r--r-- | core/launcher/transferserver.cpp | 10 |
3 files changed, 14 insertions, 10 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 43006f1..d5c16b3 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -127,26 +127,26 @@ void DesktopPowerAlerter::alert( const QString &text, int priority ) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
130 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) | 130 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) |
131 | { | 131 | { |
132 | QMessageBox::hideEvent( e ); | 132 | QMessageBox::hideEvent( e ); |
133 | alertCount = 0; | 133 | alertCount = 0; |
134 | currentPriority = INT_MAX; | 134 | currentPriority = INT_MAX; |
135 | } | 135 | } |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type t ) | 139 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) |
140 | : QPEApplication( argc, argv, t ) | 140 | : QPEApplication( argc, argv, appType ) |
141 | { | 141 | { |
142 | 142 | ||
143 | QTimer *t = new QTimer( this ); | 143 | QTimer *t = new QTimer( this ); |
144 | connect( t, SIGNAL(timeout()), this, SLOT(psTimeout()) ); | 144 | connect( t, SIGNAL(timeout()), this, SLOT(psTimeout()) ); |
145 | t->start( 10000 ); | 145 | t->start( 10000 ); |
146 | ps = new PowerStatus; | 146 | ps = new PowerStatus; |
147 | pa = new DesktopPowerAlerter( 0 ); | 147 | pa = new DesktopPowerAlerter( 0 ); |
148 | 148 | ||
149 | channel = new QCopChannel( "QPE/Desktop", this ); | 149 | channel = new QCopChannel( "QPE/Desktop", this ); |
150 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 150 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
151 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 151 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
152 | } | 152 | } |
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 |
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 87a49eb..7294f9c 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -27,35 +27,35 @@ | |||
27 | #include <shadow.h> | 27 | #include <shadow.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qdatastream.h> | 33 | #include <qdatastream.h> |
34 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <qfileinfo.h> | 36 | #include <qfileinfo.h> |
37 | #include <qregexp.h> | 37 | #include <qregexp.h> |
38 | //#include <qpe/qcopchannel_qws.h> | 38 | //#include <qpe/qcopchannel_qws.h> |
39 | #include <qpe/qprocess.h> | ||
40 | #include <qpe/process.h> | 39 | #include <qpe/process.h> |
41 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 41 | #include <qpe/qcopenvelope_qws.h> |
43 | 42 | ||
44 | #include "transferserver.h" | 43 | #include "transferserver.h" |
44 | #include "qprocess.h" | ||
45 | 45 | ||
46 | const int block_size = 51200; | 46 | const int block_size = 51200; |
47 | 47 | ||
48 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent = 0, | 48 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, |
49 | const char* name = 0) | 49 | const char* name ) |
50 | : QServerSocket( port, 1, parent, name ) | 50 | : QServerSocket( port, 1, parent, name ) |
51 | { | 51 | { |
52 | if ( !ok() ) | 52 | if ( !ok() ) |
53 | qWarning( "Failed to bind to port %d", port ); | 53 | qWarning( "Failed to bind to port %d", port ); |
54 | } | 54 | } |
55 | 55 | ||
56 | TransferServer::~TransferServer() | 56 | TransferServer::~TransferServer() |
57 | { | 57 | { |
58 | 58 | ||
59 | } | 59 | } |
60 | 60 | ||
61 | void TransferServer::newConnection( int socket ) | 61 | void TransferServer::newConnection( int socket ) |
@@ -72,25 +72,25 @@ bool accessAuthorized(QHostAddress peeraddress) | |||
72 | bool ok = (peeraddress.ip4Addr() & (((1<<auth_peer_bits)-1)<<(32-auth_peer_bits))) | 72 | bool ok = (peeraddress.ip4Addr() & (((1<<auth_peer_bits)-1)<<(32-auth_peer_bits))) |
73 | == auth_peer; | 73 | == auth_peer; |
74 | /* Allows denial-of-service attack. | 74 | /* Allows denial-of-service attack. |
75 | if ( !ok ) { | 75 | if ( !ok ) { |
76 | QMessageBox::warning(0,tr("Security"), | 76 | QMessageBox::warning(0,tr("Security"), |
77 | tr("<p>An attempt to access this device from %1 has been denied.") | 77 | tr("<p>An attempt to access this device from %1 has been denied.") |
78 | .arg(peeraddress.toString())); | 78 | .arg(peeraddress.toString())); |
79 | } | 79 | } |
80 | */ | 80 | */ |
81 | return ok; | 81 | return ok; |
82 | } | 82 | } |
83 | 83 | ||
84 | ServerPI::ServerPI( int socket, QObject *parent = 0, const char* name = 0 ) | 84 | ServerPI::ServerPI( int socket, QObject *parent, const char* name ) |
85 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) | 85 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) |
86 | { | 86 | { |
87 | state = Connected; | 87 | state = Connected; |
88 | 88 | ||
89 | setSocket( socket ); | 89 | setSocket( socket ); |
90 | 90 | ||
91 | peerport = peerPort(); | 91 | peerport = peerPort(); |
92 | peeraddress = peerAddress(); | 92 | peeraddress = peerAddress(); |
93 | 93 | ||
94 | #ifndef INSECURE | 94 | #ifndef INSECURE |
95 | if ( !accessAuthorized(peeraddress) ) { | 95 | if ( !accessAuthorized(peeraddress) ) { |
96 | state = Forbidden; | 96 | state = Forbidden; |
@@ -843,25 +843,25 @@ QString ServerPI::absFilePath( const QString& file ) | |||
843 | filepath = directory.path() + "/" + file; | 843 | filepath = directory.path() + "/" + file; |
844 | 844 | ||
845 | return filepath; | 845 | return filepath; |
846 | } | 846 | } |
847 | 847 | ||
848 | 848 | ||
849 | void ServerPI::timerEvent( QTimerEvent * ) | 849 | void ServerPI::timerEvent( QTimerEvent * ) |
850 | { | 850 | { |
851 | connectionClosed(); | 851 | connectionClosed(); |
852 | } | 852 | } |
853 | 853 | ||
854 | 854 | ||
855 | ServerDTP::ServerDTP( QObject *parent = 0, const char* name = 0) | 855 | ServerDTP::ServerDTP( QObject *parent, const char* name ) |
856 | : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ), | 856 | : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ), |
857 | retrieveTargzProc( 0 ), gzipProc( 0 ) | 857 | retrieveTargzProc( 0 ), gzipProc( 0 ) |
858 | { | 858 | { |
859 | 859 | ||
860 | connect( this, SIGNAL( connected() ), SLOT( connected() ) ); | 860 | connect( this, SIGNAL( connected() ), SLOT( connected() ) ); |
861 | connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); | 861 | connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); |
862 | connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) ); | 862 | connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) ); |
863 | connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); | 863 | connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); |
864 | 864 | ||
865 | gzipProc = new QProcess( this, "gzipProc" ); | 865 | gzipProc = new QProcess( this, "gzipProc" ); |
866 | gzipProc->setCommunication( QProcess::Stdin | QProcess::Stdout ); | 866 | gzipProc->setCommunication( QProcess::Stdin | QProcess::Stdout ); |
867 | 867 | ||