author | conber <conber> | 2002-06-15 18:26:36 (UTC) |
---|---|---|
committer | conber <conber> | 2002-06-15 18:26:36 (UTC) |
commit | f797160d879c74652b27bca3df8a74243465d65c (patch) (side-by-side diff) | |
tree | eb6a376174ba1e532127d099df6a02d201e2e34f | |
parent | ff47b17768607d8819ef5cd3316a1cab0abdcf3a (diff) | |
download | opie-f797160d879c74652b27bca3df8a74243465d65c.zip opie-f797160d879c74652b27bca3df8a74243465d65c.tar.gz opie-f797160d879c74652b27bca3df8a74243465d65c.tar.bz2 |
fixed bug. you should be able to browse and search in an imap account now.
-rw-r--r-- | noncore/unsupported/mail2/libmail/imaphandler.cpp | 9 | ||||
-rw-r--r-- | noncore/unsupported/mail2/libmail/imaphandler.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp index 66c92c5..730a004 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.cpp +++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp @@ -1,15 +1,16 @@ #include "imapresponse.h" #include "imaphandler.h" #include "imapbase.h" IMAPHandler::IMAPHandler(const Account &account) : QObject(), _account(account) { + _ready = false; _loggingin = false; _loggedin = false; _tag = 0; _ibase = new IMAPBase(account); connect(_ibase, SIGNAL(dataReceived(const QString &)), SLOT(slotDataReceived(const QString &))); connect(_ibase, SIGNAL(lookingUpHost()), SLOT(slotLookingUpHost())); connect(_ibase, SIGNAL(hostFound()), SLOT(slotHostFound())); @@ -284,16 +285,24 @@ QString IMAPHandler::escape(const QString &in) QString IMAPHandler::tag(bool count) { return QString("a%1").arg(count ? _tag++ : _tag); } void IMAPHandler::slotDataReceived(const QString &data) { + if (!_ready) { + // The first data is always the greeting string. + // We can ignore it. + _ready = true; + return; + } + + IMAPResponseParser parser(data); IMAPResponse response = parser.response(); response.setImapHandler(this); if (!_loggingin) emit gotResponse(response); else { if (response.statusResponse().status() == IMAPResponseEnums::OK) { _loggingin = false; diff --git a/noncore/unsupported/mail2/libmail/imaphandler.h b/noncore/unsupported/mail2/libmail/imaphandler.h index 8cb42db..cc47a85 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.h +++ b/noncore/unsupported/mail2/libmail/imaphandler.h @@ -74,13 +74,13 @@ protected slots: void slotConnected(); void slotDisconnected(); void slotError(int err); private: Account _account; IMAPBase *_ibase; unsigned int _tag; - bool _loggingin, _loggedin; + bool _ready, _loggingin, _loggedin; }; #endif |