Diffstat (limited to 'noncore/unsupported/mail2/libmail/imaphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/libmail/imaphandler.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp index 7493240..dc97b28 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.cpp +++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp | |||
@@ -277,53 +277,56 @@ QString IMAPHandler::iX(const QString &commandAtom, const QString &arguments) | |||
277 | return tag(false); | 277 | return tag(false); |
278 | } | 278 | } |
279 | 279 | ||
280 | QString IMAPHandler::escape(const QString &in) | 280 | QString IMAPHandler::escape(const QString &in) |
281 | { | 281 | { |
282 | QString in_ = in; | 282 | QString in_ = in; |
283 | return in_.replace(QRegExp("\""), "\\\""); | 283 | return in_.replace(QRegExp("\""), "\\\""); |
284 | } | 284 | } |
285 | 285 | ||
286 | QString IMAPHandler::tag(bool count) | 286 | QString IMAPHandler::tag(bool count) |
287 | { | 287 | { |
288 | return QString("a%1").arg(count ? _tag++ : _tag); | 288 | return QString("a%1").arg(count ? _tag++ : _tag); |
289 | } | 289 | } |
290 | 290 | ||
291 | void IMAPHandler::slotDataReceived(const QString &data) | 291 | void IMAPHandler::slotDataReceived(const QString &data) |
292 | { | 292 | { |
293 | if (!_ready) { | 293 | if (!_ready) { |
294 | // The first data is always the greeting string. | 294 | // The first data is always the greeting string. |
295 | // We can ignore it. | 295 | // We can ignore it. |
296 | _ready = true; | 296 | _ready = true; |
297 | return; | 297 | return; |
298 | } | 298 | } |
299 | 299 | ||
300 | 300 | ||
301 | IMAPResponseParser parser(data); | 301 | IMAPResponseParser parser; |
302 | //connect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & ))); | ||
303 | parser. parse ( data ); | ||
302 | IMAPResponse response = parser.response(); | 304 | IMAPResponse response = parser.response(); |
305 | //disconnect ( &parser, SIGNAL( needMoreData ( QString & )), _ibase, SLOT( tryRead ( QString & ))); | ||
303 | response.setImapHandler(this); | 306 | response.setImapHandler(this); |
304 | 307 | ||
305 | if (!_loggingin) emit gotResponse(response); | 308 | if (!_loggingin) { qDebug("Emitting gotResponse!\n" ); emit gotResponse(response); } |
306 | else { | 309 | else { |
307 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { | 310 | if (response.statusResponse().status() == IMAPResponseEnums::OK) { |
308 | _loggingin = false; | 311 | _loggingin = false; |
309 | _loggedin = true; | 312 | _loggedin = true; |
310 | qWarning("OK. Logged in. Leaving loggingin state."); | 313 | qWarning("OK. Logged in. Leaving loggingin state."); |
311 | } else { | 314 | } else { |
312 | _loggingin = false; | 315 | _loggingin = false; |
313 | emit IMAPError(IMAPBase::IMAPErrLoginFailed); | 316 | emit IMAPError(IMAPBase::IMAPErrLoginFailed); |
314 | } | 317 | } |
315 | } | 318 | } |
316 | } | 319 | } |
317 | 320 | ||
318 | void IMAPHandler::slotLookingUpHost() | 321 | void IMAPHandler::slotLookingUpHost() |
319 | { | 322 | { |
320 | emit IMAPLookingUpHost(); | 323 | emit IMAPLookingUpHost(); |
321 | } | 324 | } |
322 | 325 | ||
323 | void IMAPHandler::slotHostFound() | 326 | void IMAPHandler::slotHostFound() |
324 | { | 327 | { |
325 | emit IMAPHostFound(); | 328 | emit IMAPHostFound(); |
326 | } | 329 | } |
327 | 330 | ||
328 | void IMAPHandler::slotConnected() | 331 | void IMAPHandler::slotConnected() |
329 | { | 332 | { |