Author: czeidler Date: 2011-03-01 04:19:15 +0100 (Tue, 01 Mar 2011) New Revision: 40752 Changeset: http://dev.haiku-os.org/changeset/40752 Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.h haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h Log: Reset status view when fetch failed. Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp 2011-03-01 03:16:09 UTC (rev 40751) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp 2011-03-01 03:19:15 UTC (rev 40752) @@ -61,6 +61,13 @@ } +void +DispatcherIMAPListener::FetchEnd() +{ + fProtocol.ResetProgress(); +} + + const uint32 kMsgStartWatching = '&StW'; Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.h 2011-03-01 03:16:09 UTC (rev 40751) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.h 2011-03-01 03:19:15 UTC (rev 40752) @@ -31,6 +31,7 @@ void BodyFetched(int32 uid, BPositionIO* data); void NewMessagesToFetch(int32 nMessages); + void FetchEnd(); private: MailProtocol& fProtocol; IMAPStorage& fStorage; Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp 2011-03-01 03:16:09 UTC (rev 40751) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp 2011-03-01 03:19:15 UTC (rev 40752) @@ -306,7 +306,7 @@ fOutData(data), fFetchBodyLimit(fetchBodyLimit) { - + fIMAPMailbox.Listener().NewMessagesToFetch(fEndMessage - fMessage + 1); } @@ -320,10 +320,16 @@ fOutData(NULL), fFetchBodyLimit(fetchBodyLimit) { - + fIMAPMailbox.Listener().NewMessagesToFetch(fEndMessage - fMessage + 1); } +FetchMessageCommand::~FetchMessageCommand() +{ + fIMAPMailbox.Listener().FetchEnd(); +} + + BString FetchMessageCommand::Command() { @@ -478,6 +484,8 @@ int32 uid = fIMAPMailbox.MessageNumberToUID(message); if (uid >= 0) fIMAPMailbox.Listener().BodyFetched(uid, fOutData); + else + fIMAPMailbox.Listener().FetchEnd(); return true; } @@ -615,8 +623,6 @@ nMessages + 1, exists, &list, NULL); fIMAPMailbox.AddAfterQuakeCommand(command); - fIMAPMailbox.Listener().NewMessagesToFetch(exists - nMessages); - command = new FetchMessageCommand(fIMAPMailbox, nMessages + 1, exists, fIMAPMailbox.FetchBodyLimit()); fIMAPMailbox.AddAfterQuakeCommand(command); Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h 2011-03-01 03:16:09 UTC (rev 40751) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h 2011-03-01 03:19:15 UTC (rev 40752) @@ -130,6 +130,7 @@ FetchMessageCommand(IMAPMailbox& mailbox, int32 firstMessage, int32 lastMessage, int32 fetchBodyLimit = -1); + ~FetchMessageCommand(); BString Command(); bool Handle(const BString& response); Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h 2011-03-01 03:16:09 UTC (rev 40751) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.h 2011-03-01 03:19:15 UTC (rev 40752) @@ -22,6 +22,7 @@ virtual void BodyFetched(int32 uid, BPositionIO* data) {} virtual void NewMessagesToFetch(int32 nMessages) {} + virtual void FetchEnd() {} };