-rw-r--r-- | noncore/comm/keypebble/config.in | 2 | ||||
-rw-r--r-- | noncore/comm/keypebble/keypebble.pro | 9 | ||||
-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, 112 insertions, 78 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 @@ -2,3 +2,3 @@ boolean "opie-keypebble (Virtual Network Computing VNC viewer)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) + 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 @@ -1,3 +1,3 @@ -CONFIG += qt warn_on quick-app +CONFIG += qt warn_on quick-app HEADERS = d3des.h \ krfbbuffer.h \ @@ -24,10 +24,9 @@ SOURCES = d3des.c \ kvncbookmarkdlg.cpp \ main.cpp -INTERFACES = kvncconndlgbase.ui \ - kvncbookmarkdlgbase.ui +INTERFACES = kvncconndlgbase.ui kvncbookmarkdlgbase.ui -INCLUDEPATH += $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopiecore2 TARGET = keypebble 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,6 +1,2 @@ -#include <assert.h> -#include <qimage.h> -#include <qpainter.h> -#include <qapplication.h> #include "krfbdecoder.h" #include "krfbbuffer.h" @@ -8,8 +4,20 @@ #include "krfbserverinfo.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qimage.h> +#include <qpainter.h> +#include <qapplication.h> + +/* STD */ +#include <assert.h> + // // Endian stuff // -#ifndef KDE_USE_FINAL +#ifndef OPIE_NO_DEBUG const int endianTest = 1; #endif @@ -40,5 +48,5 @@ KRFBBuffer::~KRFBBuffer() void KRFBBuffer::resize( int w, int h ) { - qWarning( "Resizing buffer" ); + owarn << "Resizing buffer" << oendl; pix->resize( w, h ); @@ -62,5 +70,5 @@ void KRFBBuffer::mouseEvent( QMouseEvent *e ) void KRFBBuffer::keyPressEvent( QKeyEvent *e ) { - qWarning( "Buffer got a key" ); + owarn << "Buffer got a key" << oendl; decoder->sendKeyPressEvent( e ); @@ -75,5 +83,5 @@ void KRFBBuffer::copyRect( int srcX, int srcY, int destX, int destY, int w, int h ) { -// qWarning( "Got copy rect" ); +// owarn << "Got copy rect" << oendl; bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP ); 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 @@ -3,6 +3,10 @@ #include "krfbbuffer.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; +/* QT */ #include <qclipboard.h> @@ -43,5 +47,5 @@ void KRFBCanvas::openURL( const QUrl &url ) { if ( loggedIn_ ) { - qWarning( "openURL invoked when logged in\n" ); + owarn << "openURL invoked when logged in\n" << oendl; return; } @@ -75,5 +79,5 @@ void KRFBCanvas::bell() void KRFBCanvas::loggedIn() { - qWarning( "Ok, we're logged in" ); + owarn << "Ok, we're logged in" << oendl; // 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,7 +1,2 @@ -#include <assert.h> -#include <qsocket.h> -#include <qtimer.h> -#include <string.h> - #include "krfbconnection.h" #include "krfblogin.h" @@ -9,4 +4,16 @@ #include "krfbbuffer.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qsocket.h> +#include <qtimer.h> + +/* STD */ +#include <assert.h> +#include <string.h> + KRFBConnection::KRFBConnection( QObject *parent ) : QObject( parent, "KRFBConnection" ) @@ -44,5 +51,5 @@ void KRFBConnection::connectTo( KRFBServer server) connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); - qWarning( "Connecting..." ); + owarn << "Connecting..." << oendl; currentState_ = Connecting; @@ -52,5 +59,5 @@ void KRFBConnection::connectTo( KRFBServer server) void KRFBConnection::disconnect() { - qWarning( "Disconnecting from server" ); + owarn << "Disconnecting from server" << oendl; if ( ( currentState_ != Disconnected ) @@ -83,5 +90,5 @@ void KRFBConnection::gotSocketConnection() currentState_ = LoggingIn; - qWarning( "Connected, logging in..." ); + owarn << "Connected, logging in..." << oendl; static QString statusMsg = tr( "Connected" ); @@ -94,5 +101,5 @@ void KRFBConnection::gotSocketConnection() void KRFBConnection::gotRFBConnection() { - qWarning( "Logged into server" ); + owarn << "Logged into server" << oendl; currentState_ = Connected; @@ -123,5 +130,5 @@ void KRFBConnection::gotSocketError( int err ) // Do some error handling stuff - qWarning( "KRFBConnection: Socket error %d", err ); + owarn << "KRFBConnection: Socket error " << err << "" << oendl; static QString refused = tr( "Connection Refused" ); @@ -173,9 +180,9 @@ void KRFBConnection::waitForData( unsigned int sz ) if ( sock->size() >= sz ) { - // qWarning( "No need to wait for data" ); + // owarn << "No need to wait for data" << oendl; emit gotEnoughData(); } else { - // qWarning( "Waiting for %u bytes", sz ); + // owarn << "Waiting for " << sz << " bytes" << oendl; minData_ = sz; connect( sock, SIGNAL( readyRead() ), SLOT( gotMoreData() ) ); 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 @@ -4,7 +4,12 @@ #include "krfbbuffer.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ #include <qpixmap.h> +/* STD */ #include <assert.h> @@ -12,5 +17,5 @@ // Endian stuff // -#ifndef KDE_USE_FINAL +#ifndef OPIE_NO_DEBUG const int endianTest = 1; #endif @@ -136,5 +141,5 @@ void KRFBDecoder::sendClientInit() // Wait for server init - qWarning( "Waiting for server init" ); + owarn << "Waiting for server init" << oendl; static QString statusMsg = tr( "Waiting for server initialization..." ); @@ -148,5 +153,5 @@ void KRFBDecoder::sendClientInit() void KRFBDecoder::gotServerInit() { - qWarning( "Got server init" ); + owarn << "Got server init" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); @@ -182,5 +187,5 @@ void KRFBDecoder::gotServerInit() info->nameLength = Swap32IfLE( info->nameLength ); - qWarning( "Width = %d, Height = %d", info->width, info->height ); + owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl; qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", info->bpp, info->depth, info->bigEndian, info->trueColor ); @@ -193,5 +198,5 @@ void KRFBDecoder::gotServerInit() // Wait for desktop name - qWarning( "Waiting for desktop name" ); + owarn << "Waiting for desktop name" << oendl; static QString statusMsg = tr( "Waiting for desktop name..." ); @@ -208,5 +213,5 @@ void KRFBDecoder::gotDesktopName() assert( currentState == AwaitingDesktopName ); - qWarning( "Got desktop name" ); + owarn << "Got desktop name" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), @@ -220,5 +225,5 @@ void KRFBDecoder::gotDesktopName() info->name = buf; - qWarning( "Desktop: %s", info->name.latin1() ); + owarn << "Desktop: " << info->name.latin1() << "" << oendl; delete buf; @@ -372,5 +377,5 @@ void KRFBDecoder::gotUpdateHeader() assert( currentState == AwaitingUpdate ); - // qWarning( "Got update header" ); + // owarn << "Got update header" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), @@ -407,5 +412,5 @@ void KRFBDecoder::gotUpdateHeader() noRects = Swap16IfLE( noRects ); - // qWarning( "Expecting %d rects", noRects ); + // owarn << "Expecting " << noRects << " rects" << oendl; // Now wait for the data @@ -419,5 +424,5 @@ void KRFBDecoder::gotRectHeader() assert( currentState == AwaitingRectHeader ); - // qWarning( "Got rect header" ); + // owarn << "Got rect header" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), @@ -447,21 +452,21 @@ void KRFBDecoder::gotRectHeader() // if ( encoding == RawEncoding ) { - // qWarning( "Raw encoding" ); + // owarn << "Raw encoding" << oendl; handleRawRect(); } else if ( encoding == CopyRectEncoding ) { -// qWarning( "CopyRect encoding" ); +// owarn << "CopyRect encoding" << oendl; handleCopyRect(); } else if ( encoding == RreEncoding ) { - qWarning( "RRE encoding" ); + owarn << "RRE encoding" << oendl; handleRRERect(); } else if ( encoding == CorreEncoding ) { - qWarning( "CoRRE encoding" ); + owarn << "CoRRE encoding" << oendl; handleCoRRERect(); } else if ( encoding == HexTileEncoding ) { - qWarning( "HexTile encoding" ); + owarn << "HexTile encoding" << oendl; handleHexTileRect(); } @@ -471,5 +476,5 @@ void KRFBDecoder::gotRectHeader() "used by the server %1" ).arg( msg ); currentState = Error; - qWarning( "Unknown encoding, %d", msg ); + owarn << "Unknown encoding, " << msg << "" << oendl; emit error( protocolError ); return; @@ -487,5 +492,5 @@ void KRFBDecoder::handleRawRect() // overall size (but has to be in complete lines). - // qWarning( "Handling a raw rect chunk" ); + // owarn << "Handling a raw rect chunk" << oendl; // CARD32 lineCount = w * format->bpp / 8; @@ -510,5 +515,5 @@ void KRFBDecoder::getRawRectChunk( int lines ) // Wait for server init - // qWarning( "Waiting for raw rect chunk, %ld", count ); + // owarn << "Waiting for raw rect chunk, " << count << "" << oendl; currentState = AwaitingRawRectChunk; @@ -524,5 +529,5 @@ void KRFBDecoder::gotRawRectChunk() this, SLOT( gotRawRectChunk() ) ); - // qWarning( "Got raw rect chunk" ); + // owarn << "Got raw rect chunk" << oendl; // @@ -547,5 +552,5 @@ void KRFBDecoder::gotRawRectChunk() noRects--; - // qWarning( "There are %d rects left", noRects ); + // owarn << "There are " << noRects << " rects left" << oendl; if ( noRects ) { @@ -591,5 +596,5 @@ void KRFBDecoder::gotCopyRectPos() noRects--; - // qWarning( "There are %d rects left", noRects ); + // owarn << "There are " << noRects << " rects left" << oendl; if ( noRects ) { @@ -604,15 +609,15 @@ void KRFBDecoder::gotCopyRectPos() void KRFBDecoder::handleRRERect() { - qWarning( "RRE not implemented" ); + owarn << "RRE not implemented" << oendl; } void KRFBDecoder::handleCoRRERect() { - qWarning( "CoRRE not implemented" ); + owarn << "CoRRE not implemented" << oendl; } void KRFBDecoder::handleHexTileRect() { - qWarning( "HexTile not implemented" ); + owarn << "HexTile not implemented" << oendl; } @@ -674,5 +679,5 @@ void KRFBDecoder::sendCutEvent( const QString &unicode ) void KRFBDecoder::gotServerCut() { - qWarning( "Got server cut" ); + owarn << "Got server cut" << oendl; currentState = AwaitingServerCutLength; @@ -722,5 +727,5 @@ void KRFBDecoder::gotServerCutText() /* For some reason QApplication::clipboard()->setText() segfaults when called * from within keypebble's mass of signals and slots - qWarning( "Server cut: %s", cutbuf ); + owarn << "Server cut: " << cutbuf << "" << oendl; QString cutText( cutbuf ); // DANGER!! @@ -739,5 +744,5 @@ void KRFBDecoder::gotServerCutText() } else { - qWarning( "Async handled in weird state" ); + owarn << "Async handled in weird state" << oendl; currentState = oldState; }; @@ -746,5 +751,5 @@ void KRFBDecoder::gotServerCutText() void KRFBDecoder::gotBell() { - qWarning( "Got server bell" ); + owarn << "Got server bell" << oendl; buf->soundBell(); @@ -759,5 +764,5 @@ void KRFBDecoder::gotBell() } else { - qWarning( "Async handled in weird state" ); + owarn << "Async handled in weird state" << oendl; currentState = oldState; }; 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,13 +1,18 @@ -#include <assert.h> +#include "krfblogin.h" +#include "krfbconnection.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qtimer.h> +/* STD */ +#include <assert.h> extern "C" { #include "vncauth.h" } -#include "krfblogin.h" -#include "krfbconnection.h" -#include <qtimer.h> - // The length of the various messages (used to decide how many bytes to // wait for). @@ -53,5 +58,5 @@ KRFBLogin::KRFBLogin( KRFBConnection *con ) - qWarning( "Waiting for server version..." ); + owarn << "Waiting for server version..." << oendl; static QString statusMsg = tr( "Waiting for server version..." ); @@ -75,5 +80,5 @@ KRFBLogin::State KRFBLogin::state() const void KRFBLogin::gotServerVersion() { - qWarning( "Got server version" ); + owarn << "Got server version" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), @@ -93,5 +98,5 @@ void KRFBLogin::gotServerVersion() static QString msg = tr( "Error: Invalid server version, %1" ).arg( rfbString ); - qWarning( msg ); + owarn << msg << oendl; emit error( msg ); currentState = Error; @@ -107,5 +112,5 @@ void KRFBLogin::gotServerVersion() + (serverVersion[10] - '0'); - qWarning("Server Version: %03d.%03d", serverMajor, serverMinor ); + owarn << "Server Version: " << serverMajor << "." << serverMinor << "" << oendl; if ( serverMajor != 3 ) { @@ -113,5 +118,5 @@ void KRFBLogin::gotServerVersion() .arg( rfbString ); - qWarning( msg ); + owarn << msg << oendl; emit error( msg ); currentState = Error; @@ -120,5 +125,5 @@ void KRFBLogin::gotServerVersion() if ( serverMinor != 3 ) { - qWarning( "Minor version mismatch: %d", serverMinor ); + owarn << "Minor version mismatch: " << serverMinor << "" << oendl; } @@ -144,5 +149,5 @@ void KRFBLogin::gotAuthScheme() switch ( scheme ) { case 0: - qWarning( "Failed" ); + owarn << "Failed" << oendl; // Handle failure connect( con, SIGNAL( gotEnoughData() ), SLOT( gotFailureReasonSize() ) ); @@ -160,5 +165,5 @@ void KRFBLogin::gotAuthScheme() break; default: - qWarning( "Unknown authentication scheme, 0x%08lx", scheme ); + owarn << "Unknown authentication scheme, 0x" << scheme << "" << oendl; currentState = Error; break; @@ -182,5 +187,5 @@ void KRFBLogin::getPassword() // Last chance to enter a password if ( con->options_->password.isNull() ) { - qWarning( "krfblogin needs a password" ); + owarn << "krfblogin needs a password" << oendl; emit passwordRequired( con ); } @@ -217,5 +222,5 @@ void KRFBLogin::gotAuthResult() result = Swap32IfLE( result ); - qWarning( "Authentication Result is 0x%08lx", result ); + owarn << "Authentication Result is 0x" << result << "" << oendl; static QString failed = tr( "Error: The password you specified was incorrect." ); @@ -233,5 +238,5 @@ void KRFBLogin::gotAuthResult() break; case AuthFailed: - qWarning( "Dammit" ); + owarn << "Dammit" << oendl; emit status( statusMsgFailed ); emit error( failed ); @@ -242,5 +247,5 @@ void KRFBLogin::gotAuthResult() break; default: - qWarning( "Invalid authentication result, %lx", result ); + owarn << "Invalid authentication result, " << result << "" << oendl; break; } @@ -249,5 +254,5 @@ void KRFBLogin::gotAuthResult() void KRFBLogin::sendClientVersion() { - qWarning( "Sending client version" ); + owarn << "Sending client version" << oendl; con->write( (void*)"RFB 003.003\n", ClientVersionLength ); } 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,7 +1,13 @@ +#include "kvncbookmarkdlg.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/global.h> +using namespace Opie::Core; + +/* QT */ #include <qdir.h> #include <qtextstream.h> #include <qlistbox.h> -#include <qpe/global.h> -#include "kvncbookmarkdlg.h" KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) @@ -176,5 +182,5 @@ void KVNCBookmarkDlg::writeBookmarks(void) for ( server=servers.first(); server != 0; server=servers.next() ) { - qDebug(server->name); + odebug << server->name << oendl; t << "server=" << server->name << '\n'; t << "\thostname=" << server->hostname << '\n'; |