summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble/krfbconnection.cpp
Unidiff
Diffstat (limited to 'noncore/comm/keypebble/krfbconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbconnection.cpp31
1 files changed, 19 insertions, 12 deletions
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>
8using 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
11KRFBConnection::KRFBConnection( QObject *parent ) 18KRFBConnection::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
52void KRFBConnection::disconnect() 59void 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
94void KRFBConnection::gotRFBConnection() 101void 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 }