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

Modified Files:
        MailFolder.h MailFolderCC.h 
Log Message:
check if we can set the flags before setting them to deal with the IMAP
folders which don't allow setting of some flags (or are just readonly)
(fixes bug 592)


Index: MailFolder.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolder.h,v
retrieving revision 1.174
retrieving revision 1.175
diff -b -u -2 -r1.174 -r1.175
--- MailFolder.h        13 May 2002 00:27:39 -0000      1.174
+++ MailFolder.h        12 Jun 2002 17:58:07 -0000      1.175
@@ -550,7 +550,30 @@
    /** @name Accessors */
    //@{
+
    /// is the folder opened
    virtual bool IsOpened(void) const = 0;
 
+   /**
+      Even a folder opened without ReadOnly flag could be opened in read only
+      mode if this is the maximum we can manage (examples: public IMAP servers,
+      file formats using read only files &c).
+
+      In this case, this method may be used to check if we can write to the
+      folder. Note that it's invalid to use it unless IsOpened() is true
+
+      @return true if the folder is opened as read only, false if read/write
+    */
+   virtual bool IsReadOnly(void) const = 0;
+
+   /**
+      An IMAP folder opened in read only mode might still allow setting the
+      flags so this should be used instead of IsReadOnly() to test whether we
+      can do it.
+
+      @param flags the combination of flags we'd like to set or clear
+      @return true if this flag can be set, false otherwise
+    */
+   virtual bool CanSetFlag(int flags) const = 0;
+
    /** Get name of mailbox.
        @return the symbolic name of the mailbox
@@ -583,4 +606,5 @@
     */
    virtual char GetFolderDelimiter() const;
+
    //@}
 

Index: MailFolderCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolderCC.h,v
retrieving revision 1.203
retrieving revision 1.204
diff -b -u -2 -r1.203 -r1.204
--- MailFolderCC.h      4 Jun 2002 19:43:01 -0000       1.203
+++ MailFolderCC.h      12 Jun 2002 17:58:07 -0000      1.204
@@ -100,4 +100,7 @@
    virtual bool IsOpened(void) const { return m_MailStream != NULL; }
 
+   virtual bool IsReadOnly(void) const;
+   virtual bool CanSetFlag(int flags) const;
+
    /** return the full folder name
        @return the folder's name


_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to