Update of /cvsroot/mahogany/M/include
In directory usw-pr-cvs1:/tmp/cvs-serv15592/include

Modified Files:
        MEvent.h MailFolderCC.h MailFolderCmn.h 
Log Message:
1. more code refactoring to be able to use it from MFVirt: this time
   the expunge event generation moved to MFCmn from MFCC
2. search now uses MFVirt and it even works -- as long as you don't try
   to delete the messages from the search results folder


Index: MEvent.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MEvent.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -b -u -2 -r1.49 -r1.50
--- MEvent.h    17 Jul 2002 14:43:54 -0000      1.49
+++ MEvent.h    17 Jul 2002 19:22:49 -0000      1.50
@@ -159,4 +159,16 @@
 
 /**
+  This struct contains the information used by MEventFolderExpungeData
+ */
+struct ExpungeData
+{
+   /// the msgnos which have been expunged from the folder
+   wxArrayInt msgnos;
+
+   /// the positions (on screen) of the expunged messages
+   wxArrayInt positions;
+};
+
+/**
    MEventFolderExpungeData: notifies about message expunge
  */
@@ -164,33 +176,29 @@
 {
 public:
-   /// ctor takes the array of deleted msgnos which will be deleted by us
+   /// ctor takes ownership of the pointer passed to it and will delete it
    MEventFolderExpungeData(MailFolder *folder,
-                           wxArrayInt *delMsgnos,
-                           wxArrayInt *delPositions)
+                           ExpungeData *expungeData)
       : MEventWithFolderData(MEventId_FolderExpunge, folder)
       {
-         m_delMsgnos = delMsgnos;
-         m_delPositions = delPositions;
+         m_expungeData = expungeData;
       }
 
-   /// free msgno array
+   /// dtors frees the data
    virtual ~MEventFolderExpungeData()
    {
-      delete m_delMsgnos;
-      delete m_delPositions;
+      delete m_expungeData;
    }
 
    /// return the number of messages deleted
-   size_t GetCount() const { return m_delMsgnos ? m_delMsgnos->GetCount() : 0; }
+   size_t GetCount() const { return m_expungeData->msgnos.GetCount(); }
 
    /// return the msgno of n-th deleted item
-   size_t GetItem(size_t n) const { return m_delMsgnos->Item(n); }
+   size_t GetItem(size_t n) const { return m_expungeData->msgnos[n]; }
 
    /// return the position in the listing of the n-th deleted item
-   size_t GetItemPos(size_t n) const { return m_delPositions->Item(n); }
+   size_t GetItemPos(size_t n) const { return m_expungeData->positions[n]; }
 
 private:
-   wxArrayInt *m_delMsgnos,
-              *m_delPositions;
+   ExpungeData *m_expungeData;
 };
 

Index: MailFolderCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolderCC.h,v
retrieving revision 1.209
retrieving revision 1.210
diff -b -u -2 -r1.209 -r1.210
--- MailFolderCC.h      16 Jul 2002 20:21:43 -0000      1.209
+++ MailFolderCC.h      17 Jul 2002 19:22:49 -0000      1.210
@@ -326,12 +326,4 @@
    //@}
 
-   /** @name Mailbox update helpers */
-   //@{
-
-   /// call to notify everybody that some messages were expunged
-   void RequestUpdateAfterExpunge();
-
-   //@}
-
    /** @name Message counting */
    //@{
@@ -411,7 +403,4 @@
    virtual void ReadConfig(MailFolderCmn::MFCmnOptions& config);
 
-   /// clear m_expungedMsgnos and m_expungedPositions arrays
-   void DiscardExpungeData();
-
    /// fill mailstatus with the results of c-client mail_status() call
    static bool DoCheckStatus(const MFolder *folder,
@@ -522,40 +511,4 @@
     */
    bool m_gotUnprocessedNewMail;
-
-   /**
-     These two arrays are used between the moment when we get the expunge
-     notification and until the moment we can send the notification about it
-     to the GUI.
-
-     We need both msgnos and positions because by the time GUI code gets our
-     notification, the header listing doesn't have the items corresponding to
-     the expunged msgnos (they were expunged!) and so can't be asked for the
-     positions of these msgnos but the GUI needs them.
-    */
-   //@{
-
-   /// the array containing indices of expunged messages or NULL
-   wxArrayInt *m_expungedMsgnos;
-
-   /// the array containing the positions of expunged messages or NULL
-   wxArrayInt *m_expungedPositions;
-
-   //@}
-
-   /**
-     The elements are added to these arrays from mm_flags() handler
-     (i.e. UpdateMessageStatus()) and they are cleared later in
-     OnMsgStatusChanged()
-    */
-   //@{
-
-   /// the array containing the msgnos of the messages whose status changed
-   wxArrayInt *m_statusChangedMsgnos;
-
-   /// the arrays containing the old and new status of these messages
-   wxArrayInt *m_statusChangedOld,
-              *m_statusChangedNew;
-
-   //@}
 
    /** If we are searching, this points to an UIdArray where to store

Index: MailFolderCmn.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolderCmn.h,v
retrieving revision 1.77
retrieving revision 1.78
diff -b -u -2 -r1.77 -r1.78
--- MailFolderCmn.h     17 Jul 2002 14:43:55 -0000      1.77
+++ MailFolderCmn.h     17 Jul 2002 19:22:49 -0000      1.78
@@ -207,4 +207,15 @@
    void SendMsgStatusChangeEvent();
 
+   /**
+     Send the message notifying the GUI about the messages which have been
+     expunged (uses m_expungeData)
+   */
+   void RequestUpdateAfterExpunge();
+
+   /**
+     Delete m_expungeData and reset the pointer to NULL.
+    */
+   void DiscardExpungeData();
+
    /** @name Config management */
    //@{
@@ -261,6 +272,30 @@
    class MailFolderTimer *m_Timer;
 
-   /// struct used by SendMsgStatusChangeEvent()
+   /** @name Mail folder events data */
+   //@{
+
+   /**
+     The two arrays inside m_expungeData are used between the moment when we
+     get the expunge notification and until the moment we can send the
+     notification about it to the GUI.
+
+     We need both msgnos and positions because by the time GUI code gets our
+     notification, the header listing doesn't have the items corresponding to
+     the expunged msgnos (they were expunged!) and so can't be asked for the
+     positions of these msgnos but the GUI needs them.
+    */
+   ExpungeData *m_expungeData;
+
+   /**
+     The elements are added to these arrays when the messages status changes
+     (e.g. from mm_flags() in MailFolderCC) and then, during the next event
+     loop iteration, SendMsgStatusChangeEvent() is called to notify the GUI
+     code about all the changes at once.
+
+     Outside of this time window this pointer is always NULL.
+    */
    StatusChangeData *m_statusChangeData;
+
+   //@}
 
 private:



-------------------------------------------------------
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

Reply via email to