summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble/krfblogin.cpp
Unidiff
Diffstat (limited to 'noncore/comm/keypebble/krfblogin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfblogin.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/noncore/comm/keypebble/krfblogin.cpp b/noncore/comm/keypebble/krfblogin.cpp
index cc3a8fa..0d2a205 100644
--- a/noncore/comm/keypebble/krfblogin.cpp
+++ b/noncore/comm/keypebble/krfblogin.cpp
@@ -49,14 +49,12 @@ KRFBLogin::KRFBLogin( KRFBConnection *con )
49 this->con = con; 49 this->con = con;
50 currentState = AwaitingServerVersion; 50 currentState = AwaitingServerVersion;
51 51
52 connect( this, SIGNAL( error( const QString & ) ), 52 connect( this, SIGNAL( error( const QString & ) ),
53 con, SIGNAL( error( const QString & ) ) ); 53 con, SIGNAL( error( const QString & ) ) );
54 54
55 connect( this, SIGNAL( passwordRequired( KRFBConnection * ) ),
56 con, SIGNAL( passwordRequired( KRFBConnection * ) ) );
57 55
58 qWarning( "Waiting for server version..." ); 56 qWarning( "Waiting for server version..." );
59 57
60 static QString statusMsg = tr( "Waiting for server version..." ); 58 static QString statusMsg = tr( "Waiting for server version..." );
61 emit status( statusMsg ); 59 emit status( statusMsg );
62 60
@@ -180,26 +178,26 @@ void KRFBLogin::getPassword()
180{ 178{
181 // Got data 179 // Got data
182 CARD8 challenge[ ChallengeLength ]; 180 CARD8 challenge[ ChallengeLength ];
183 con->read( challenge, ChallengeLength ); 181 con->read( challenge, ChallengeLength );
184 182
185 // Last chance to enter a password 183 // Last chance to enter a password
186 if ( con->pass_.isNull() ) { 184 if ( con->options_->password.isNull() ) {
187 qWarning( "krfblogin needs a password" ); 185 qWarning( "krfblogin needs a password" );
188 emit passwordRequired( con ); 186 emit passwordRequired( con );
189 } 187 }
190 188
191 if ( con->pass_.isNull() ) { 189 if ( con->options_->password.isNull() ) {
192 QString msg = tr( "Error: This server requires a password, but none " 190 QString msg = tr( "Error: This server requires a password, but none "
193 "has been specified.\n" ); 191 "has been specified.\n" );
194 192
195 emit error( msg ); 193 emit error( msg );
196 return; 194 return;
197 } 195 }
198 196
199 vncEncryptBytes( (unsigned char *) challenge, con->pass_.data() ); 197 vncEncryptBytes( (unsigned char *) challenge, QCString(con->options_->password.latin1()).data() );
200 con->write( challenge, ChallengeLength ); 198 con->write( challenge, ChallengeLength );
201 199
202 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotAuthResult() ) ); 200 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotAuthResult() ) );
203 con->waitForData( AuthResultLength ); 201 con->waitForData( AuthResultLength );
204} 202}
205 203