** Part of fix for bug #271863
authorMilan Crha <mcrha@redhat.com>
Wed, 2 Apr 2008 13:32:08 +0000 (13:32 +0000)
committerMilan Crha <mcrha@src.gnome.org>
Wed, 2 Apr 2008 13:32:08 +0000 (13:32 +0000)
2008-04-02  Milan Crha  <mcrha@redhat.com>

** Part of fix for bug #271863

* camel-folder.h: New CAMEL_FOLDER_JUNKED_NOT_DELETED property.
* camel-folder.c: (folder_getv):
Count junk messages which are not marked as deleted separately.

svn path=/trunk/; revision=8609

camel/ChangeLog
camel/camel-folder.c
camel/camel-folder.h

index 46b80a8..ffd0506 100644 (file)
@@ -1,3 +1,11 @@
+2008-04-02  Milan Crha  <mcrha@redhat.com>
+
+       ** Part of fix for bug #271863
+
+       * camel-folder.h: New CAMEL_FOLDER_JUNKED_NOT_DELETED property.
+       * camel-folder.c: (folder_getv):
+       Count junk messages which are not marked as deleted separately.
+
 2008-03-31  Milan Crha  <mcrha@redhat.com>
 
        ** Fix for bug #524704
index 0d9184c..40a88fb 100644 (file)
@@ -307,7 +307,7 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
        CamelFolder *folder = (CamelFolder *)object;
        int i;
        guint32 tag;
-       int unread = -1, deleted = 0, junked = 0, visible = 0, count = -1;
+       int unread = -1, deleted = 0, junked = 0, junked_not_deleted = 0, visible = 0, count = -1;
 
        for (i = 0; i < args->argc; i++) {
                CamelArgGet *arg = &args->argv[i];
@@ -341,6 +341,7 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
                case CAMEL_FOLDER_ARG_UNREAD:
                case CAMEL_FOLDER_ARG_DELETED:
                case CAMEL_FOLDER_ARG_JUNKED:
+               case CAMEL_FOLDER_ARG_JUNKED_NOT_DELETED:
                case CAMEL_FOLDER_ARG_VISIBLE:
                        /* This is so we can get the values atomically, and also so we can calculate them only once */
                        if (unread == -1) {
@@ -358,8 +359,11 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
                                                        unread++;
                                                if (flags & CAMEL_MESSAGE_DELETED)
                                                        deleted++;
-                                               if (flags & CAMEL_MESSAGE_JUNK)
+                                               if (flags & CAMEL_MESSAGE_JUNK) {
                                                        junked++;
+                                                       if (! (flags & CAMEL_MESSAGE_DELETED))
+                                                               junked_not_deleted++;
+                                               }
                                                if ((flags & (CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_JUNK)) == 0)
                                                        visible++;
                                                camel_message_info_free(info);
@@ -377,6 +381,9 @@ folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
                        case CAMEL_FOLDER_ARG_JUNKED:
                                count = junked;
                                break;
+                       case CAMEL_FOLDER_ARG_JUNKED_NOT_DELETED:
+                               count = junked_not_deleted;
+                               break;
                        case CAMEL_FOLDER_ARG_VISIBLE:
                                count = visible;
                                break;
index afaeae3..481f231 100644 (file)
@@ -52,6 +52,7 @@ enum {
        CAMEL_FOLDER_ARG_UID_ARRAY,
        CAMEL_FOLDER_ARG_INFO_ARRAY,
        CAMEL_FOLDER_ARG_PROPERTIES,
+       CAMEL_FOLDER_ARG_JUNKED_NOT_DELETED, /* junked, but not deleted messages */
        CAMEL_FOLDER_ARG_LAST = CAMEL_ARG_FIRST + 0x2000
 };
 
@@ -64,6 +65,7 @@ enum {
        CAMEL_FOLDER_UNREAD = CAMEL_FOLDER_ARG_UNREAD | CAMEL_ARG_INT,
        CAMEL_FOLDER_DELETED = CAMEL_FOLDER_ARG_DELETED | CAMEL_ARG_INT,
        CAMEL_FOLDER_JUNKED = CAMEL_FOLDER_ARG_JUNKED | CAMEL_ARG_INT,
+       CAMEL_FOLDER_JUNKED_NOT_DELETED = CAMEL_FOLDER_ARG_JUNKED_NOT_DELETED | CAMEL_ARG_INT,
        CAMEL_FOLDER_VISIBLE = CAMEL_FOLDER_ARG_VISIBLE | CAMEL_ARG_INT,
 
        CAMEL_FOLDER_UID_ARRAY = CAMEL_FOLDER_ARG_UID_ARRAY | CAMEL_ARG_PTR,