From 548402bb7c8c0059c60a68c85e929c5ebab09a2e Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Tue, 8 Mar 2011 03:09:41 +0000 Subject: [PATCH] Close the status window again when an error occurred durring a message fetch. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40865 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../inbound_protocols/imap/IMAPInboundProtocol.cpp | 2 +- .../inbound_protocols/imap/imap_lib/IMAPHandler.cpp | 8 ++++++-- .../inbound_protocols/imap/imap_lib/IMAPHandler.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp index 1c7d6d81f5..0610e3e852 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPInboundProtocol.cpp @@ -70,7 +70,7 @@ DispatcherIMAPListener::NewMessagesToFetch(int32 nMessages) void DispatcherIMAPListener::FetchEnd() { - fProtocol.ResetProgress(); + fProtocol.ReportProgress(0, 1); } diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp index 8a199419a9..c0f8501e99 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp @@ -318,7 +318,8 @@ FetchMessageCommand::FetchMessageCommand(IMAPMailbox& mailbox, fMessage(firstMessage), fEndMessage(lastMessage), fOutData(NULL), - fFetchBodyLimit(fetchBodyLimit) + fFetchBodyLimit(fetchBodyLimit), + fHandled(false) { } @@ -326,7 +327,8 @@ FetchMessageCommand::FetchMessageCommand(IMAPMailbox& mailbox, FetchMessageCommand::~FetchMessageCommand() { - + if (!fHandled) + fIMAPMailbox.Listener().FetchEnd(); } @@ -407,6 +409,8 @@ FetchMessageCommand::Handle(const BString& response) BString lastLine; fConnectionReader.GetNextLine(lastLine); + fHandled = true; + bool bodyIsComing = true; if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize) bodyIsComing = false; diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h index 5443b31651..d9f7bb8986 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h @@ -140,6 +140,7 @@ private: int32 fEndMessage; BPositionIO* fOutData; int32 fFetchBodyLimit; + bool fHandled; };