I have probably fixed [1] the first item in TODO. Most of the work
actually went into factoring FilterRuleImpl::Apply and actual fix is very
small [2].

Btw, I have been unsure as to whether somebody is working on this already.
I thought it will be simple patch so I didn't announce anything, but then
the refactoring was a lot of work and I didn't want it duplicated. Maybe
bug tracker could be used as more discrete way to indicate who is working
on what. All bugs would then have to go through bug tracker first and they
would have to be marked before any work starts.

[1] <http://www.privateweb.sk/robertvazan/
patches/mahogany.robertvazan.filtermoveloss.patch>

[2]

--- beggar/src/modules/Filters.cpp      Sat Aug  2 20:18:23 2003
+++ work/src/modules/Filters.cpp        Sat Aug  2 19:57:39 2003
@@ -3558,6 +3558,8 @@
    // copy all messages we are copying to this destination at once
    UIdArray uidsToCopy;
+   wxArrayLong indexesToCopy;
    
    uidsToCopy.Add(m_msgs[m_idx]);
+   indexesToCopy.Add(m_idx);
 
    for ( size_t n = m_idx + 1; n < m_msgs.GetCount(); n++ )
@@ -3567,12 +3569,24 @@
       {
          uidsToCopy.Add(m_msgs[n]);
-
-         // don't try to copy it when we reach it
-         m_allOperations[copiedIndex] &= ~FilterRuleImpl::Copy;
+         indexesToCopy.Add(n);
       }
    }
    
-   return m_parent->m_MailFolder->SaveMessages(
+   bool copyOk = m_parent->m_MailFolder->SaveMessages(
       &uidsToCopy, m_destinations[m_idx]);
+   
+   for ( size_t copiedIndex = 0; copiedIndex < indexesToCopy.GetCount();
+      ++copiedIndex )
+   {
+      // don't try to copy it when we reach it
+      m_allOperations[copiedIndex] &= ~FilterRuleImpl::Copy;
+      
+      if ( !copyOk )
+      {
+         m_allOperations[copiedIndex] &= ~FilterRuleImpl::Delete;
+      }
+   }
+   
+   return copyOk;
 }
 



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to