Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/qcopbridge.cpp | 7 |
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 | |||
@@ -12,29 +12,31 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qcopbridge.h" | 21 | #include "qcopbridge.h" |
22 | #include "transferserver.h" | 22 | #include "transferserver.h" |
23 | 23 | ||
24 | #include <opie2/oglobal.h> | ||
25 | |||
24 | #ifdef Q_WS_QWS | 26 | #ifdef Q_WS_QWS |
25 | #include <qtopia/qcopenvelope_qws.h> | 27 | #include <qtopia/qcopenvelope_qws.h> |
26 | #endif | 28 | #endif |
27 | #include <qtopia/qpeapplication.h> | 29 | #include <qtopia/qpeapplication.h> |
28 | #include <qtopia/global.h> | 30 | |
29 | #include <qtopia/version.h> | 31 | #include <qtopia/version.h> |
30 | #include <qtopia/config.h> | 32 | #include <qtopia/config.h> |
31 | 33 | ||
32 | #include <qdir.h> | 34 | #include <qdir.h> |
33 | #include <qfile.h> | 35 | #include <qfile.h> |
34 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
35 | #include <qdatastream.h> | 37 | #include <qdatastream.h> |
36 | #include <qcstring.h> | 38 | #include <qcstring.h> |
37 | #include <qstringlist.h> | 39 | #include <qstringlist.h> |
38 | #include <qfileinfo.h> | 40 | #include <qfileinfo.h> |
39 | #include <qregexp.h> | 41 | #include <qregexp.h> |
40 | #include <qtimer.h> | 42 | #include <qtimer.h> |
@@ -46,25 +48,24 @@ | |||
46 | #define _XOPEN_SOURCE | 48 | #define _XOPEN_SOURCE |
47 | #endif | 49 | #endif |
48 | #ifndef Q_OS_WIN32 | 50 | #ifndef Q_OS_WIN32 |
49 | #include <pwd.h> | 51 | #include <pwd.h> |
50 | #include <unistd.h> | 52 | #include <unistd.h> |
51 | #include <sys/types.h> | 53 | #include <sys/types.h> |
52 | #endif | 54 | #endif |
53 | 55 | ||
54 | #if defined(_OS_LINUX_) | 56 | #if defined(_OS_LINUX_) |
55 | #include <shadow.h> | 57 | #include <shadow.h> |
56 | #endif | 58 | #endif |
57 | 59 | ||
58 | #include "launcherglobal.h" | ||
59 | 60 | ||
60 | //#define INSECURE | 61 | //#define INSECURE |
61 | 62 | ||
62 | const int block_size = 51200; | 63 | const int block_size = 51200; |
63 | 64 | ||
64 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, | 65 | QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, |
65 | const char* name ) | 66 | const char* name ) |
66 | : QServerSocket( port, 1, parent, name ), | 67 | : QServerSocket( port, 1, parent, name ), |
67 | desktopChannel( 0 ), | 68 | desktopChannel( 0 ), |
68 | cardChannel( 0 ) | 69 | cardChannel( 0 ) |
69 | { | 70 | { |
70 | if ( !ok() ) | 71 | if ( !ok() ) |
@@ -316,25 +317,25 @@ void QCopBridgePI::sendDesktopMessage( const QString &msg ) | |||
316 | send ( str ); | 317 | send ( str ); |
317 | } | 318 | } |
318 | 319 | ||
319 | void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& data ) | 320 | void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& data ) |
320 | { | 321 | { |
321 | if ( !isOpen() ) // eg. Forbidden | 322 | if ( !isOpen() ) // eg. Forbidden |
322 | return; | 323 | return; |
323 | 324 | ||
324 | const char hdr[]="CALLB QPE/Desktop "; | 325 | const char hdr[]="CALLB QPE/Desktop "; |
325 | writeBlock(hdr,sizeof(hdr)-1); | 326 | writeBlock(hdr,sizeof(hdr)-1); |
326 | writeBlock(msg,msg.length()); | 327 | writeBlock(msg,msg.length()); |
327 | writeBlock(" ",1); | 328 | writeBlock(" ",1); |
328 | QByteArray b64 = Opie::Global::encodeBase64(data); | 329 | QByteArray b64 = OGlobal::encodeBase64(data); |
329 | writeBlock(b64.data(),b64.size()); | 330 | writeBlock(b64.data(),b64.size()); |
330 | writeBlock("\r\n",2); | 331 | writeBlock("\r\n",2); |
331 | 332 | ||
332 | } | 333 | } |
333 | 334 | ||
334 | 335 | ||
335 | void QCopBridgePI::send( const QString& msg ) | 336 | void QCopBridgePI::send( const QString& msg ) |
336 | { | 337 | { |
337 | if ( !isOpen() ) // eg. Forbidden | 338 | if ( !isOpen() ) // eg. Forbidden |
338 | return; | 339 | return; |
339 | QTextStream os( this ); | 340 | QTextStream os( this ); |
340 | os << msg << endl; | 341 | os << msg << endl; |