Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1:/tmp/cvs-serv17053/src/mail
Modified Files:
MailFolderCmn.cpp
Log Message:
Final fix for bug #808 (cancelling Pop3 download)
Index: MailFolderCmn.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCmn.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -b -u -2 -r1.121 -r1.122
--- MailFolderCmn.cpp 30 Sep 2003 13:46:21 -0000 1.121
+++ MailFolderCmn.cpp 3 Oct 2003 11:05:16 -0000 1.122
@@ -769,4 +769,7 @@
}
+BOUND_POINTER(MProgressDialog,MProgressDialogPointer);
+IMPLEMENT_BOUND_POINTER(MProgressDialogPointer)
+
bool
MailFolderCmn::SaveMessages(const UIdArray *selections,
@@ -788,5 +791,5 @@
CHECK( n, true, _T("SaveMessages(): nothing to save") );
- MailFolder *mf = MailFolder::OpenFolder(folder);
+ MailFolder_obj mf(MailFolder::OpenFolder(folder));
if ( !mf )
{
@@ -801,11 +804,8 @@
{
FAIL_MSG( _T("Can't SaveMessages() to locked folder") );
-
- mf->DecRef();
-
return false;
}
- MProgressDialog *pd = NULL;
+ MProgressDialogPointer pd;
long threshold = GetProgressThreshold(mf->GetProfile());
@@ -817,5 +817,5 @@
n, folder->GetName().c_str());
- pd = new MProgressDialog(
+ pd.Initialize(new MProgressDialog(
mf->GetName(), // title
msg, // label message
@@ -824,12 +824,9 @@
false, // disable parent only
true // allow aborting
- );
+ ));
}
- if ( n > 1 )
- {
// minimize the number of updates by only doing it once
- mf->SuspendUpdates();
- }
+ SuspendFolderUpdates suspend(mf);
bool rc = true;
@@ -839,6 +836,5 @@
{
// cancelled
- rc = false;
- break;
+ return false;
}
@@ -852,6 +848,5 @@
{
// cancelled
- rc = false;
- break;
+ return false;
}
}
@@ -862,17 +857,4 @@
}
- if ( n > 1 )
- {
- // make it notice new messages as we disabled them above
- mf->ResumeUpdates();
- }
-
- // force the folder status update as the number of messages in it changed
- mf->Ping();
-
- mf->DecRef();
-
- delete pd;
-
return rc;
}
@@ -1340,4 +1322,17 @@
// MailFolderCmn misc
// ----------------------------------------------------------------------------
+
+void
+MailFolderCmn::ResumeUpdates()
+{
+ if ( !--m_suspendUpdates )
+ {
+ RequestUpdate();
+
+ // make the folder notice the new messages
+ // This step was skipped in MailFolderCC::UpdateAfterAppend
+ Ping();
+ }
+}
void
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates