author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/comm/keypebble | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/comm/keypebble/config.in | 2 | ||||
-rw-r--r-- | noncore/comm/keypebble/keypebble.pro | 5 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbbuffer.cpp | 24 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbcanvas.cpp | 8 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbconnection.cpp | 31 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbdecoder.cpp | 63 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfblogin.cpp | 41 | ||||
-rw-r--r-- | noncore/comm/keypebble/kvncbookmarkdlg.cpp | 12 |
8 files changed, 110 insertions, 76 deletions
diff --git a/noncore/comm/keypebble/config.in b/noncore/comm/keypebble/config.in index 20384aa..8a800b9 100644 --- a/noncore/comm/keypebble/config.in +++ b/noncore/comm/keypebble/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config KEYPEBBLE | 1 | config KEYPEBBLE |
2 | boolean "opie-keypebble (Virtual Network Computing VNC viewer)" | 2 | boolean "opie-keypebble (Virtual Network Computing VNC viewer)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/comm/keypebble/keypebble.pro b/noncore/comm/keypebble/keypebble.pro index 3515016..7631e4e 100644 --- a/noncore/comm/keypebble/keypebble.pro +++ b/noncore/comm/keypebble/keypebble.pro | |||
@@ -23,12 +23,11 @@ SOURCES = d3des.c \ | |||
23 | kvncconndlg.cpp \ | 23 | kvncconndlg.cpp \ |
24 | kvncbookmarkdlg.cpp \ | 24 | kvncbookmarkdlg.cpp \ |
25 | main.cpp | 25 | main.cpp |
26 | INTERFACES= kvncconndlgbase.ui \ | 26 | INTERFACES= kvncconndlgbase.ui kvncbookmarkdlgbase.ui |
27 | kvncbookmarkdlgbase.ui | ||
28 | 27 | ||
29 | INCLUDEPATH += $(OPIEDIR)/include | 28 | INCLUDEPATH += $(OPIEDIR)/include |
30 | DEPENDPATH += $(OPIEDIR)/include | 29 | DEPENDPATH += $(OPIEDIR)/include |
31 | LIBS += -lqpe | 30 | LIBS += -lqpe -lopiecore2 |
32 | 31 | ||
33 | TARGET = keypebble | 32 | TARGET = keypebble |
34 | 33 | ||
diff --git a/noncore/comm/keypebble/krfbbuffer.cpp b/noncore/comm/keypebble/krfbbuffer.cpp index 4cec0c2..4b29612 100644 --- a/noncore/comm/keypebble/krfbbuffer.cpp +++ b/noncore/comm/keypebble/krfbbuffer.cpp | |||
@@ -1,16 +1,24 @@ | |||
1 | #include <assert.h> | ||
2 | #include <qimage.h> | ||
3 | #include <qpainter.h> | ||
4 | #include <qapplication.h> | ||
5 | #include "krfbdecoder.h" | 1 | #include "krfbdecoder.h" |
6 | #include "krfbbuffer.h" | 2 | #include "krfbbuffer.h" |
7 | #include "krfbconnection.h" | 3 | #include "krfbconnection.h" |
8 | #include "krfbserverinfo.h" | 4 | #include "krfbserverinfo.h" |
9 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
10 | /* QT */ | ||
11 | #include <qimage.h> | ||
12 | #include <qpainter.h> | ||
13 | #include <qapplication.h> | ||
14 | |||
15 | /* STD */ | ||
16 | #include <assert.h> | ||
17 | |||
10 | // | 18 | // |
11 | // Endian stuff | 19 | // Endian stuff |
12 | // | 20 | // |
13 | #ifndef KDE_USE_FINAL | 21 | #ifndef OPIE_NO_DEBUG |
14 | const int endianTest = 1; | 22 | const int endianTest = 1; |
15 | #endif | 23 | #endif |
16 | 24 | ||
@@ -39,7 +47,7 @@ KRFBBuffer::~KRFBBuffer() | |||
39 | 47 | ||
40 | void KRFBBuffer::resize( int w, int h ) | 48 | void KRFBBuffer::resize( int w, int h ) |
41 | { | 49 | { |
42 | qWarning( "Resizing buffer" ); | 50 | owarn << "Resizing buffer" << oendl; |
43 | 51 | ||
44 | pix->resize( w, h ); | 52 | pix->resize( w, h ); |
45 | 53 | ||
@@ -61,7 +69,7 @@ void KRFBBuffer::mouseEvent( QMouseEvent *e ) | |||
61 | 69 | ||
62 | void KRFBBuffer::keyPressEvent( QKeyEvent *e ) | 70 | void KRFBBuffer::keyPressEvent( QKeyEvent *e ) |
63 | { | 71 | { |
64 | qWarning( "Buffer got a key" ); | 72 | owarn << "Buffer got a key" << oendl; |
65 | 73 | ||
66 | decoder->sendKeyPressEvent( e ); | 74 | decoder->sendKeyPressEvent( e ); |
67 | } | 75 | } |
@@ -74,7 +82,7 @@ void KRFBBuffer::keyReleaseEvent( QKeyEvent *e ) | |||
74 | void KRFBBuffer::copyRect( int srcX, int srcY, | 82 | void KRFBBuffer::copyRect( int srcX, int srcY, |
75 | int destX, int destY, int w, int h ) | 83 | int destX, int destY, int w, int h ) |
76 | { | 84 | { |
77 | // qWarning( "Got copy rect" ); | 85 | // owarn << "Got copy rect" << oendl; |
78 | bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP ); | 86 | bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP ); |
79 | 87 | ||
80 | emit updated( destX, destY, w, h ); | 88 | emit updated( destX, destY, w, h ); |
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp index cd1fda0..b3525df 100644 --- a/noncore/comm/keypebble/krfbcanvas.cpp +++ b/noncore/comm/keypebble/krfbcanvas.cpp | |||
@@ -2,8 +2,12 @@ | |||
2 | #include "krfbcanvas.h" | 2 | #include "krfbcanvas.h" |
3 | #include "krfbbuffer.h" | 3 | #include "krfbbuffer.h" |
4 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
5 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | using namespace Opie::Core; | ||
6 | 9 | ||
10 | /* QT */ | ||
7 | #include <qclipboard.h> | 11 | #include <qclipboard.h> |
8 | 12 | ||
9 | KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) | 13 | KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) |
@@ -42,7 +46,7 @@ void KRFBCanvas::openConnection(KRFBServer server) | |||
42 | void KRFBCanvas::openURL( const QUrl &url ) | 46 | void KRFBCanvas::openURL( const QUrl &url ) |
43 | { | 47 | { |
44 | if ( loggedIn_ ) { | 48 | if ( loggedIn_ ) { |
45 | qWarning( "openURL invoked when logged in\n" ); | 49 | owarn << "openURL invoked when logged in\n" << oendl; |
46 | return; | 50 | return; |
47 | } | 51 | } |
48 | 52 | ||
@@ -74,7 +78,7 @@ void KRFBCanvas::bell() | |||
74 | 78 | ||
75 | void KRFBCanvas::loggedIn() | 79 | void KRFBCanvas::loggedIn() |
76 | { | 80 | { |
77 | qWarning( "Ok, we're logged in" ); | 81 | owarn << "Ok, we're logged in" << oendl; |
78 | 82 | ||
79 | // | 83 | // |
80 | // Get ready for action | 84 | // Get ready for action |
diff --git a/noncore/comm/keypebble/krfbconnection.cpp b/noncore/comm/keypebble/krfbconnection.cpp index b447046..33e0563 100644 --- a/noncore/comm/keypebble/krfbconnection.cpp +++ b/noncore/comm/keypebble/krfbconnection.cpp | |||
@@ -1,13 +1,20 @@ | |||
1 | #include <assert.h> | ||
2 | #include <qsocket.h> | ||
3 | #include <qtimer.h> | ||
4 | #include <string.h> | ||
5 | |||
6 | #include "krfbconnection.h" | 1 | #include "krfbconnection.h" |
7 | #include "krfblogin.h" | 2 | #include "krfblogin.h" |
8 | #include "krfbdecoder.h" | 3 | #include "krfbdecoder.h" |
9 | #include "krfbbuffer.h" | 4 | #include "krfbbuffer.h" |
10 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
10 | /* QT */ | ||
11 | #include <qsocket.h> | ||
12 | #include <qtimer.h> | ||
13 | |||
14 | /* STD */ | ||
15 | #include <assert.h> | ||
16 | #include <string.h> | ||
17 | |||
11 | KRFBConnection::KRFBConnection( QObject *parent ) | 18 | KRFBConnection::KRFBConnection( QObject *parent ) |
12 | : QObject( parent, "KRFBConnection" ) | 19 | : QObject( parent, "KRFBConnection" ) |
13 | { | 20 | { |
@@ -43,7 +50,7 @@ void KRFBConnection::connectTo( KRFBServer server) | |||
43 | connect( sock, SIGNAL( error(int) ), SLOT( gotSocketError(int) ) ); | 50 | connect( sock, SIGNAL( error(int) ), SLOT( gotSocketError(int) ) ); |
44 | connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); | 51 | connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); |
45 | 52 | ||
46 | qWarning( "Connecting..." ); | 53 | owarn << "Connecting..." << oendl; |
47 | 54 | ||
48 | currentState_ = Connecting; | 55 | currentState_ = Connecting; |
49 | sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display ); | 56 | sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display ); |
@@ -51,7 +58,7 @@ void KRFBConnection::connectTo( KRFBServer server) | |||
51 | 58 | ||
52 | void KRFBConnection::disconnect() | 59 | void KRFBConnection::disconnect() |
53 | { | 60 | { |
54 | qWarning( "Disconnecting from server" ); | 61 | owarn << "Disconnecting from server" << oendl; |
55 | 62 | ||
56 | if ( ( currentState_ != Disconnected ) | 63 | if ( ( currentState_ != Disconnected ) |
57 | && ( currentState_ != Disconnecting ) | 64 | && ( currentState_ != Disconnecting ) |
@@ -82,7 +89,7 @@ void KRFBConnection::gotSocketConnection() | |||
82 | { | 89 | { |
83 | currentState_ = LoggingIn; | 90 | currentState_ = LoggingIn; |
84 | 91 | ||
85 | qWarning( "Connected, logging in..." ); | 92 | owarn << "Connected, logging in..." << oendl; |
86 | 93 | ||
87 | static QString statusMsg = tr( "Connected" ); | 94 | static QString statusMsg = tr( "Connected" ); |
88 | emit statusChanged( statusMsg ); | 95 | emit statusChanged( statusMsg ); |
@@ -93,7 +100,7 @@ void KRFBConnection::gotSocketConnection() | |||
93 | 100 | ||
94 | void KRFBConnection::gotRFBConnection() | 101 | void KRFBConnection::gotRFBConnection() |
95 | { | 102 | { |
96 | qWarning( "Logged into server" ); | 103 | owarn << "Logged into server" << oendl; |
97 | 104 | ||
98 | currentState_ = Connected; | 105 | currentState_ = Connected; |
99 | emit connected(); | 106 | emit connected(); |
@@ -122,7 +129,7 @@ void KRFBConnection::gotSocketError( int err ) | |||
122 | currentState_ = Error; | 129 | currentState_ = Error; |
123 | 130 | ||
124 | // Do some error handling stuff | 131 | // Do some error handling stuff |
125 | qWarning( "KRFBConnection: Socket error %d", err ); | 132 | owarn << "KRFBConnection: Socket error " << err << "" << oendl; |
126 | 133 | ||
127 | static QString refused = tr( "Connection Refused" ); | 134 | static QString refused = tr( "Connection Refused" ); |
128 | static QString host = tr( "Host not found" ); | 135 | static QString host = tr( "Host not found" ); |
@@ -172,11 +179,11 @@ void KRFBConnection::waitForData( unsigned int sz ) | |||
172 | assert( currentState_ != Error ); | 179 | assert( currentState_ != Error ); |
173 | 180 | ||
174 | if ( sock->size() >= sz ) { | 181 | if ( sock->size() >= sz ) { |
175 | // qWarning( "No need to wait for data" ); | 182 | // owarn << "No need to wait for data" << oendl; |
176 | emit gotEnoughData(); | 183 | emit gotEnoughData(); |
177 | } | 184 | } |
178 | else { | 185 | else { |
179 | // qWarning( "Waiting for %u bytes", sz ); | 186 | // owarn << "Waiting for " << sz << " bytes" << oendl; |
180 | minData_ = sz; | 187 | minData_ = sz; |
181 | connect( sock, SIGNAL( readyRead() ), SLOT( gotMoreData() ) ); | 188 | connect( sock, SIGNAL( readyRead() ), SLOT( gotMoreData() ) ); |
182 | } | 189 | } |
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp index db95154..69457e2 100644 --- a/noncore/comm/keypebble/krfbdecoder.cpp +++ b/noncore/comm/keypebble/krfbdecoder.cpp | |||
@@ -3,15 +3,20 @@ | |||
3 | #include "krfbdecoder.h" | 3 | #include "krfbdecoder.h" |
4 | #include "krfbbuffer.h" | 4 | #include "krfbbuffer.h" |
5 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | using namespace Opie::Core; | ||
6 | 9 | ||
10 | /* QT */ | ||
7 | #include <qpixmap.h> | 11 | #include <qpixmap.h> |
8 | 12 | ||
13 | /* STD */ | ||
9 | #include <assert.h> | 14 | #include <assert.h> |
10 | 15 | ||
11 | // | 16 | // |
12 | // Endian stuff | 17 | // Endian stuff |
13 | // | 18 | // |
14 | #ifndef KDE_USE_FINAL | 19 | #ifndef OPIE_NO_DEBUG |
15 | const int endianTest = 1; | 20 | const int endianTest = 1; |
16 | #endif | 21 | #endif |
17 | 22 | ||
@@ -135,7 +140,7 @@ void KRFBDecoder::sendClientInit() | |||
135 | con->write( &( con->options()->shared ), 1 ); | 140 | con->write( &( con->options()->shared ), 1 ); |
136 | 141 | ||
137 | // Wait for server init | 142 | // Wait for server init |
138 | qWarning( "Waiting for server init" ); | 143 | owarn << "Waiting for server init" << oendl; |
139 | 144 | ||
140 | static QString statusMsg = tr( "Waiting for server initialization..." ); | 145 | static QString statusMsg = tr( "Waiting for server initialization..." ); |
141 | emit status( statusMsg ); | 146 | emit status( statusMsg ); |
@@ -147,7 +152,7 @@ void KRFBDecoder::sendClientInit() | |||
147 | 152 | ||
148 | void KRFBDecoder::gotServerInit() | 153 | void KRFBDecoder::gotServerInit() |
149 | { | 154 | { |
150 | qWarning( "Got server init" ); | 155 | owarn << "Got server init" << oendl; |
151 | disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); | 156 | disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); |
152 | 157 | ||
153 | if ( info ) | 158 | if ( info ) |
@@ -181,7 +186,7 @@ void KRFBDecoder::gotServerInit() | |||
181 | con->read( &(info->nameLength), 4 ); | 186 | con->read( &(info->nameLength), 4 ); |
182 | info->nameLength = Swap32IfLE( info->nameLength ); | 187 | info->nameLength = Swap32IfLE( info->nameLength ); |
183 | 188 | ||
184 | qWarning( "Width = %d, Height = %d", info->width, info->height ); | 189 | owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl; |
185 | qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", | 190 | qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", |
186 | info->bpp, info->depth, info->bigEndian, info->trueColor ); | 191 | info->bpp, info->depth, info->bigEndian, info->trueColor ); |
187 | qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", | 192 | qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", |
@@ -192,7 +197,7 @@ void KRFBDecoder::gotServerInit() | |||
192 | buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); | 197 | buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); |
193 | 198 | ||
194 | // Wait for desktop name | 199 | // Wait for desktop name |
195 | qWarning( "Waiting for desktop name" ); | 200 | owarn << "Waiting for desktop name" << oendl; |
196 | 201 | ||
197 | static QString statusMsg = tr( "Waiting for desktop name..." ); | 202 | static QString statusMsg = tr( "Waiting for desktop name..." ); |
198 | emit status( statusMsg ); | 203 | emit status( statusMsg ); |
@@ -207,7 +212,7 @@ void KRFBDecoder::gotDesktopName() | |||
207 | assert( info ); | 212 | assert( info ); |
208 | assert( currentState == AwaitingDesktopName ); | 213 | assert( currentState == AwaitingDesktopName ); |
209 | 214 | ||
210 | qWarning( "Got desktop name" ); | 215 | owarn << "Got desktop name" << oendl; |
211 | 216 | ||
212 | disconnect( con, SIGNAL( gotEnoughData() ), | 217 | disconnect( con, SIGNAL( gotEnoughData() ), |
213 | this, SLOT( gotDesktopName() ) ); | 218 | this, SLOT( gotDesktopName() ) ); |
@@ -219,7 +224,7 @@ void KRFBDecoder::gotDesktopName() | |||
219 | buf[ info->nameLength ] = '\0'; | 224 | buf[ info->nameLength ] = '\0'; |
220 | info->name = buf; | 225 | info->name = buf; |
221 | 226 | ||
222 | qWarning( "Desktop: %s", info->name.latin1() ); | 227 | owarn << "Desktop: " << info->name.latin1() << "" << oendl; |
223 | 228 | ||
224 | delete buf; | 229 | delete buf; |
225 | 230 | ||
@@ -371,7 +376,7 @@ void KRFBDecoder::gotUpdateHeader() | |||
371 | { | 376 | { |
372 | assert( currentState == AwaitingUpdate ); | 377 | assert( currentState == AwaitingUpdate ); |
373 | 378 | ||
374 | // qWarning( "Got update header" ); | 379 | // owarn << "Got update header" << oendl; |
375 | 380 | ||
376 | disconnect( con, SIGNAL( gotEnoughData() ), | 381 | disconnect( con, SIGNAL( gotEnoughData() ), |
377 | this, SLOT( gotUpdateHeader() ) ); | 382 | this, SLOT( gotUpdateHeader() ) ); |
@@ -406,7 +411,7 @@ void KRFBDecoder::gotUpdateHeader() | |||
406 | con->read( &noRects, 2 ); | 411 | con->read( &noRects, 2 ); |
407 | noRects = Swap16IfLE( noRects ); | 412 | noRects = Swap16IfLE( noRects ); |
408 | 413 | ||
409 | // qWarning( "Expecting %d rects", noRects ); | 414 | // owarn << "Expecting " << noRects << " rects" << oendl; |
410 | 415 | ||
411 | // Now wait for the data | 416 | // Now wait for the data |
412 | currentState = AwaitingRectHeader; | 417 | currentState = AwaitingRectHeader; |
@@ -418,7 +423,7 @@ void KRFBDecoder::gotRectHeader() | |||
418 | { | 423 | { |
419 | assert( currentState == AwaitingRectHeader ); | 424 | assert( currentState == AwaitingRectHeader ); |
420 | 425 | ||
421 | // qWarning( "Got rect header" ); | 426 | // owarn << "Got rect header" << oendl; |
422 | 427 | ||
423 | disconnect( con, SIGNAL( gotEnoughData() ), | 428 | disconnect( con, SIGNAL( gotEnoughData() ), |
424 | this, SLOT( gotRectHeader() ) ); | 429 | this, SLOT( gotRectHeader() ) ); |
@@ -446,23 +451,23 @@ void KRFBDecoder::gotRectHeader() | |||
446 | // the remote value as is. | 451 | // the remote value as is. |
447 | // | 452 | // |
448 | if ( encoding == RawEncoding ) { | 453 | if ( encoding == RawEncoding ) { |
449 | // qWarning( "Raw encoding" ); | 454 | // owarn << "Raw encoding" << oendl; |
450 | handleRawRect(); | 455 | handleRawRect(); |
451 | } | 456 | } |
452 | else if ( encoding == CopyRectEncoding ) { | 457 | else if ( encoding == CopyRectEncoding ) { |
453 | // qWarning( "CopyRect encoding" ); | 458 | // owarn << "CopyRect encoding" << oendl; |
454 | handleCopyRect(); | 459 | handleCopyRect(); |
455 | } | 460 | } |
456 | else if ( encoding == RreEncoding ) { | 461 | else if ( encoding == RreEncoding ) { |
457 | qWarning( "RRE encoding" ); | 462 | owarn << "RRE encoding" << oendl; |
458 | handleRRERect(); | 463 | handleRRERect(); |
459 | } | 464 | } |
460 | else if ( encoding == CorreEncoding ) { | 465 | else if ( encoding == CorreEncoding ) { |
461 | qWarning( "CoRRE encoding" ); | 466 | owarn << "CoRRE encoding" << oendl; |
462 | handleCoRRERect(); | 467 | handleCoRRERect(); |
463 | } | 468 | } |
464 | else if ( encoding == HexTileEncoding ) { | 469 | else if ( encoding == HexTileEncoding ) { |
465 | qWarning( "HexTile encoding" ); | 470 | owarn << "HexTile encoding" << oendl; |
466 | handleHexTileRect(); | 471 | handleHexTileRect(); |
467 | } | 472 | } |
468 | else { | 473 | else { |
@@ -470,7 +475,7 @@ void KRFBDecoder::gotRectHeader() | |||
470 | QString protocolError = tr( "Protocol Error: An unknown encoding was " | 475 | QString protocolError = tr( "Protocol Error: An unknown encoding was " |
471 | "used by the server %1" ).arg( msg ); | 476 | "used by the server %1" ).arg( msg ); |
472 | currentState = Error; | 477 | currentState = Error; |
473 | qWarning( "Unknown encoding, %d", msg ); | 478 | owarn << "Unknown encoding, " << msg << "" << oendl; |
474 | emit error( protocolError ); | 479 | emit error( protocolError ); |
475 | return; | 480 | return; |
476 | } | 481 | } |
@@ -486,7 +491,7 @@ void KRFBDecoder::handleRawRect() | |||
486 | // rectanges nicely. The chunking should be based on the | 491 | // rectanges nicely. The chunking should be based on the |
487 | // overall size (but has to be in complete lines). | 492 | // overall size (but has to be in complete lines). |
488 | 493 | ||
489 | // qWarning( "Handling a raw rect chunk" ); | 494 | // owarn << "Handling a raw rect chunk" << oendl; |
490 | 495 | ||
491 | // CARD32 lineCount = w * format->bpp / 8; | 496 | // CARD32 lineCount = w * format->bpp / 8; |
492 | 497 | ||
@@ -509,7 +514,7 @@ void KRFBDecoder::getRawRectChunk( int lines ) | |||
509 | CARD32 count = lines * w * format->bpp / 8; | 514 | CARD32 count = lines * w * format->bpp / 8; |
510 | 515 | ||
511 | // Wait for server init | 516 | // Wait for server init |
512 | // qWarning( "Waiting for raw rect chunk, %ld", count ); | 517 | // owarn << "Waiting for raw rect chunk, " << count << "" << oendl; |
513 | 518 | ||
514 | currentState = AwaitingRawRectChunk; | 519 | currentState = AwaitingRawRectChunk; |
515 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) ); | 520 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) ); |
@@ -523,7 +528,7 @@ void KRFBDecoder::gotRawRectChunk() | |||
523 | disconnect( con, SIGNAL( gotEnoughData() ), | 528 | disconnect( con, SIGNAL( gotEnoughData() ), |
524 | this, SLOT( gotRawRectChunk() ) ); | 529 | this, SLOT( gotRawRectChunk() ) ); |
525 | 530 | ||
526 | // qWarning( "Got raw rect chunk" ); | 531 | // owarn << "Got raw rect chunk" << oendl; |
527 | 532 | ||
528 | // | 533 | // |
529 | // Read the rect data and copy it to the buffer. | 534 | // Read the rect data and copy it to the buffer. |
@@ -546,7 +551,7 @@ void KRFBDecoder::gotRawRectChunk() | |||
546 | else { | 551 | else { |
547 | noRects--; | 552 | noRects--; |
548 | 553 | ||
549 | // qWarning( "There are %d rects left", noRects ); | 554 | // owarn << "There are " << noRects << " rects left" << oendl; |
550 | 555 | ||
551 | if ( noRects ) { | 556 | if ( noRects ) { |
552 | currentState = AwaitingRectHeader; | 557 | currentState = AwaitingRectHeader; |
@@ -590,7 +595,7 @@ void KRFBDecoder::gotCopyRectPos() | |||
590 | 595 | ||
591 | noRects--; | 596 | noRects--; |
592 | 597 | ||
593 | // qWarning( "There are %d rects left", noRects ); | 598 | // owarn << "There are " << noRects << " rects left" << oendl; |
594 | 599 | ||
595 | if ( noRects ) { | 600 | if ( noRects ) { |
596 | currentState = AwaitingRectHeader; | 601 | currentState = AwaitingRectHeader; |
@@ -603,17 +608,17 @@ void KRFBDecoder::gotCopyRectPos() | |||
603 | 608 | ||
604 | void KRFBDecoder::handleRRERect() | 609 | void KRFBDecoder::handleRRERect() |
605 | { | 610 | { |
606 | qWarning( "RRE not implemented" ); | 611 | owarn << "RRE not implemented" << oendl; |
607 | } | 612 | } |
608 | 613 | ||
609 | void KRFBDecoder::handleCoRRERect() | 614 | void KRFBDecoder::handleCoRRERect() |
610 | { | 615 | { |
611 | qWarning( "CoRRE not implemented" ); | 616 | owarn << "CoRRE not implemented" << oendl; |
612 | } | 617 | } |
613 | 618 | ||
614 | void KRFBDecoder::handleHexTileRect() | 619 | void KRFBDecoder::handleHexTileRect() |
615 | { | 620 | { |
616 | qWarning( "HexTile not implemented" ); | 621 | owarn << "HexTile not implemented" << oendl; |
617 | } | 622 | } |
618 | 623 | ||
619 | void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) | 624 | void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) |
@@ -673,7 +678,7 @@ void KRFBDecoder::sendCutEvent( const QString &unicode ) | |||
673 | 678 | ||
674 | void KRFBDecoder::gotServerCut() | 679 | void KRFBDecoder::gotServerCut() |
675 | { | 680 | { |
676 | qWarning( "Got server cut" ); | 681 | owarn << "Got server cut" << oendl; |
677 | 682 | ||
678 | currentState = AwaitingServerCutLength; | 683 | currentState = AwaitingServerCutLength; |
679 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) ); | 684 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) ); |
@@ -721,7 +726,7 @@ void KRFBDecoder::gotServerCutText() | |||
721 | 726 | ||
722 | /* For some reason QApplication::clipboard()->setText() segfaults when called | 727 | /* For some reason QApplication::clipboard()->setText() segfaults when called |
723 | * from within keypebble's mass of signals and slots | 728 | * from within keypebble's mass of signals and slots |
724 | qWarning( "Server cut: %s", cutbuf ); | 729 | owarn << "Server cut: " << cutbuf << "" << oendl; |
725 | 730 | ||
726 | QString cutText( cutbuf ); // DANGER!! | 731 | QString cutText( cutbuf ); // DANGER!! |
727 | qApp->clipboard()->setText( cutText ); | 732 | qApp->clipboard()->setText( cutText ); |
@@ -738,14 +743,14 @@ void KRFBDecoder::gotServerCutText() | |||
738 | currentState = Idle; | 743 | currentState = Idle; |
739 | } | 744 | } |
740 | else { | 745 | else { |
741 | qWarning( "Async handled in weird state" ); | 746 | owarn << "Async handled in weird state" << oendl; |
742 | currentState = oldState; | 747 | currentState = oldState; |
743 | }; | 748 | }; |
744 | } | 749 | } |
745 | 750 | ||
746 | void KRFBDecoder::gotBell() | 751 | void KRFBDecoder::gotBell() |
747 | { | 752 | { |
748 | qWarning( "Got server bell" ); | 753 | owarn << "Got server bell" << oendl; |
749 | buf->soundBell(); | 754 | buf->soundBell(); |
750 | 755 | ||
751 | // Now wait for the update (again) | 756 | // Now wait for the update (again) |
@@ -758,7 +763,7 @@ void KRFBDecoder::gotBell() | |||
758 | currentState = Idle; | 763 | currentState = Idle; |
759 | } | 764 | } |
760 | else { | 765 | else { |
761 | qWarning( "Async handled in weird state" ); | 766 | owarn << "Async handled in weird state" << oendl; |
762 | currentState = oldState; | 767 | currentState = oldState; |
763 | }; | 768 | }; |
764 | } | 769 | } |
diff --git a/noncore/comm/keypebble/krfblogin.cpp b/noncore/comm/keypebble/krfblogin.cpp index 2bbd110..92005d2 100644 --- a/noncore/comm/keypebble/krfblogin.cpp +++ b/noncore/comm/keypebble/krfblogin.cpp | |||
@@ -1,14 +1,19 @@ | |||
1 | #include <assert.h> | 1 | #include "krfblogin.h" |
2 | #include "krfbconnection.h" | ||
2 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | using namespace Opie::Core; | ||
7 | |||
8 | /* QT */ | ||
9 | #include <qtimer.h> | ||
3 | 10 | ||
11 | /* STD */ | ||
12 | #include <assert.h> | ||
4 | extern "C" { | 13 | extern "C" { |
5 | #include "vncauth.h" | 14 | #include "vncauth.h" |
6 | } | 15 | } |
7 | 16 | ||
8 | #include "krfblogin.h" | ||
9 | #include "krfbconnection.h" | ||
10 | #include <qtimer.h> | ||
11 | |||
12 | // The length of the various messages (used to decide how many bytes to | 17 | // The length of the various messages (used to decide how many bytes to |
13 | // wait for). | 18 | // wait for). |
14 | const int ServerVersionLength = 12; | 19 | const int ServerVersionLength = 12; |
@@ -52,7 +57,7 @@ KRFBLogin::KRFBLogin( KRFBConnection *con ) | |||
52 | con, SIGNAL( error(const QString&) ) ); | 57 | con, SIGNAL( error(const QString&) ) ); |
53 | 58 | ||
54 | 59 | ||
55 | qWarning( "Waiting for server version..." ); | 60 | owarn << "Waiting for server version..." << oendl; |
56 | 61 | ||
57 | static QString statusMsg = tr( "Waiting for server version..." ); | 62 | static QString statusMsg = tr( "Waiting for server version..." ); |
58 | emit status( statusMsg ); | 63 | emit status( statusMsg ); |
@@ -74,7 +79,7 @@ KRFBLogin::State KRFBLogin::state() const | |||
74 | 79 | ||
75 | void KRFBLogin::gotServerVersion() | 80 | void KRFBLogin::gotServerVersion() |
76 | { | 81 | { |
77 | qWarning( "Got server version" ); | 82 | owarn << "Got server version" << oendl; |
78 | 83 | ||
79 | disconnect( con, SIGNAL( gotEnoughData() ), | 84 | disconnect( con, SIGNAL( gotEnoughData() ), |
80 | this, SLOT( gotServerVersion() ) ); | 85 | this, SLOT( gotServerVersion() ) ); |
@@ -92,7 +97,7 @@ void KRFBLogin::gotServerVersion() | |||
92 | if ( rfbString.find( regexp ) == -1 ) { | 97 | if ( rfbString.find( regexp ) == -1 ) { |
93 | static QString msg = tr( "Error: Invalid server version, %1" ).arg( rfbString ); | 98 | static QString msg = tr( "Error: Invalid server version, %1" ).arg( rfbString ); |
94 | 99 | ||
95 | qWarning( msg ); | 100 | owarn << msg << oendl; |
96 | emit error( msg ); | 101 | emit error( msg ); |
97 | currentState = Error; | 102 | currentState = Error; |
98 | return; | 103 | return; |
@@ -106,20 +111,20 @@ void KRFBLogin::gotServerVersion() | |||
106 | + (serverVersion[9] - '0') * 10 | 111 | + (serverVersion[9] - '0') * 10 |
107 | + (serverVersion[10] - '0'); | 112 | + (serverVersion[10] - '0'); |
108 | 113 | ||
109 | qWarning("Server Version: %03d.%03d", serverMajor, serverMinor ); | 114 | owarn << "Server Version: " << serverMajor << "." << serverMinor << "" << oendl; |
110 | 115 | ||
111 | if ( serverMajor != 3 ) { | 116 | if ( serverMajor != 3 ) { |
112 | QString msg = tr( "Error: Unsupported server version, %1" ) | 117 | QString msg = tr( "Error: Unsupported server version, %1" ) |
113 | .arg( rfbString ); | 118 | .arg( rfbString ); |
114 | 119 | ||
115 | qWarning( msg ); | 120 | owarn << msg << oendl; |
116 | emit error( msg ); | 121 | emit error( msg ); |
117 | currentState = Error; | 122 | currentState = Error; |
118 | return; | 123 | return; |
119 | } | 124 | } |
120 | 125 | ||
121 | if ( serverMinor != 3 ) { | 126 | if ( serverMinor != 3 ) { |
122 | qWarning( "Minor version mismatch: %d", serverMinor ); | 127 | owarn << "Minor version mismatch: " << serverMinor << "" << oendl; |
123 | } | 128 | } |
124 | 129 | ||
125 | // Setup for the next state | 130 | // Setup for the next state |
@@ -143,7 +148,7 @@ void KRFBLogin::gotAuthScheme() | |||
143 | 148 | ||
144 | switch ( scheme ) { | 149 | switch ( scheme ) { |
145 | case 0: | 150 | case 0: |
146 | qWarning( "Failed" ); | 151 | owarn << "Failed" << oendl; |
147 | // Handle failure | 152 | // Handle failure |
148 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotFailureReasonSize() ) ); | 153 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotFailureReasonSize() ) ); |
149 | con->waitForData( FailureReasonSizeLength ); | 154 | con->waitForData( FailureReasonSizeLength ); |
@@ -159,7 +164,7 @@ void KRFBLogin::gotAuthScheme() | |||
159 | con->waitForData( ChallengeLength ); | 164 | con->waitForData( ChallengeLength ); |
160 | break; | 165 | break; |
161 | default: | 166 | default: |
162 | qWarning( "Unknown authentication scheme, 0x%08lx", scheme ); | 167 | owarn << "Unknown authentication scheme, 0x" << scheme << "" << oendl; |
163 | currentState = Error; | 168 | currentState = Error; |
164 | break; | 169 | break; |
165 | }; | 170 | }; |
@@ -181,7 +186,7 @@ void KRFBLogin::getPassword() | |||
181 | 186 | ||
182 | // Last chance to enter a password | 187 | // Last chance to enter a password |
183 | if ( con->options_->password.isNull() ) { | 188 | if ( con->options_->password.isNull() ) { |
184 | qWarning( "krfblogin needs a password" ); | 189 | owarn << "krfblogin needs a password" << oendl; |
185 | emit passwordRequired( con ); | 190 | emit passwordRequired( con ); |
186 | } | 191 | } |
187 | 192 | ||
@@ -216,7 +221,7 @@ void KRFBLogin::gotAuthResult() | |||
216 | con->read( &result, AuthResultLength ); | 221 | con->read( &result, AuthResultLength ); |
217 | result = Swap32IfLE( result ); | 222 | result = Swap32IfLE( result ); |
218 | 223 | ||
219 | qWarning( "Authentication Result is 0x%08lx", result ); | 224 | owarn << "Authentication Result is 0x" << result << "" << oendl; |
220 | 225 | ||
221 | static QString failed = tr( "Error: The password you specified was incorrect." ); | 226 | static QString failed = tr( "Error: The password you specified was incorrect." ); |
222 | static QString tooMany = tr( "Error: Too many invalid login attempts have been made\n" | 227 | static QString tooMany = tr( "Error: Too many invalid login attempts have been made\n" |
@@ -232,7 +237,7 @@ void KRFBLogin::gotAuthResult() | |||
232 | con->gotRFBConnection(); | 237 | con->gotRFBConnection(); |
233 | break; | 238 | break; |
234 | case AuthFailed: | 239 | case AuthFailed: |
235 | qWarning( "Dammit" ); | 240 | owarn << "Dammit" << oendl; |
236 | emit status( statusMsgFailed ); | 241 | emit status( statusMsgFailed ); |
237 | emit error( failed ); | 242 | emit error( failed ); |
238 | break; | 243 | break; |
@@ -241,13 +246,13 @@ void KRFBLogin::gotAuthResult() | |||
241 | emit error( tooMany ); | 246 | emit error( tooMany ); |
242 | break; | 247 | break; |
243 | default: | 248 | default: |
244 | qWarning( "Invalid authentication result, %lx", result ); | 249 | owarn << "Invalid authentication result, " << result << "" << oendl; |
245 | break; | 250 | break; |
246 | } | 251 | } |
247 | } | 252 | } |
248 | 253 | ||
249 | void KRFBLogin::sendClientVersion() | 254 | void KRFBLogin::sendClientVersion() |
250 | { | 255 | { |
251 | qWarning( "Sending client version" ); | 256 | owarn << "Sending client version" << oendl; |
252 | con->write( (void*)"RFB 003.003\n", ClientVersionLength ); | 257 | con->write( (void*)"RFB 003.003\n", ClientVersionLength ); |
253 | } | 258 | } |
diff --git a/noncore/comm/keypebble/kvncbookmarkdlg.cpp b/noncore/comm/keypebble/kvncbookmarkdlg.cpp index ef2fa12..149c398 100644 --- a/noncore/comm/keypebble/kvncbookmarkdlg.cpp +++ b/noncore/comm/keypebble/kvncbookmarkdlg.cpp | |||
@@ -1,8 +1,14 @@ | |||
1 | #include "kvncbookmarkdlg.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | #include <qpe/global.h> | ||
6 | using namespace Opie::Core; | ||
7 | |||
8 | /* QT */ | ||
1 | #include <qdir.h> | 9 | #include <qdir.h> |
2 | #include <qtextstream.h> | 10 | #include <qtextstream.h> |
3 | #include <qlistbox.h> | 11 | #include <qlistbox.h> |
4 | #include <qpe/global.h> | ||
5 | #include "kvncbookmarkdlg.h" | ||
6 | 12 | ||
7 | KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) | 13 | KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) |
8 | 14 | ||
@@ -175,7 +181,7 @@ void KVNCBookmarkDlg::writeBookmarks(void) | |||
175 | KRFBServer *server; | 181 | KRFBServer *server; |
176 | 182 | ||
177 | for ( server=servers.first(); server != 0; server=servers.next() ) { | 183 | for ( server=servers.first(); server != 0; server=servers.next() ) { |
178 | qDebug(server->name); | 184 | odebug << server->name << oendl; |
179 | t << "server=" << server->name << '\n'; | 185 | t << "server=" << server->name << '\n'; |
180 | t << "\thostname=" << server->hostname << '\n'; | 186 | t << "\thostname=" << server->hostname << '\n'; |
181 | t << "\tpassword=" << encipher(server->password )<< '\n'; | 187 | t << "\tpassword=" << encipher(server->password )<< '\n'; |