diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-07 03:06:51 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-07 03:06:51 +0800 |
commit | c07b2b93b5e9d8cdb6bea9e76481e9894b49da7d (patch) | |
tree | 578aadd026c99219786d5284237dc65f394d3d55 | |
parent | f69024938edb58e12fce6bf407c2cf1720caae5a (diff) | |
download | gsoc2013-evolution-c07b2b93b5e9d8cdb6bea9e76481e9894b49da7d.tar.gz gsoc2013-evolution-c07b2b93b5e9d8cdb6bea9e76481e9894b49da7d.tar.zst gsoc2013-evolution-c07b2b93b5e9d8cdb6bea9e76481e9894b49da7d.zip |
Set a CAMEL_FOLDER_VIRTUAL bit on the special folder info so our UI can
2004-02-06 Jeffrey Stedfast <fejj@ximian.com>
* camel-store.c (add_special_info): Set a CAMEL_FOLDER_VIRTUAL bit
on the special folder info so our UI can know if it is virtual or
not (meant for vTrash/vJunk).
(camel_store_get_folder_info): Don't add vTrash/vJunk if the
NO_VIRTUAL flag bit is set. Used by the subscriptions editor.
svn path=/trunk/; revision=24656
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-store.c | 7 | ||||
-rw-r--r-- | camel/camel-store.h | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 6f6c891c6d..fca4a08452 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2004-02-06 Jeffrey Stedfast <fejj@ximian.com> + + * camel-store.c (add_special_info): Set a CAMEL_FOLDER_VIRTUAL bit + on the special folder info so our UI can know if it is virtual or + not (meant for vTrash/vJunk). + (camel_store_get_folder_info): Don't add vTrash/vJunk if the + NO_VIRTUAL flag bit is set. Used by the subscriptions editor. + 2004-02-06 Not Zed <NotZed@Ximian.com> * camel-folder.c (camel_folder_set_message_flags): changed to diff --git a/camel/camel-store.c b/camel/camel-store.c index 10f14a8568..40be4d085b 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -714,6 +714,7 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co } /* Fill in the new fields */ + vinfo->flags |= CAMEL_FOLDER_VIRTUAL; vinfo->full_name = g_strdup (full_name); vinfo->name = g_strdup (vinfo->full_name); vinfo->url = uri; @@ -739,7 +740,9 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co * the immediate subfolders of @top. If @flags includes * %CAMEL_STORE_FOLDER_INFO_FAST, the unread_message_count fields of * some or all of the structures may be set to -1, if the store cannot - * determine that information quickly. + * determine that information quickly. If @flags includes + * %CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, don't include special virtual + * folders (such as vTrash or vJunk). * * Return value: a CamelFolderInfo tree, which must be freed with * camel_store_free_folder_info. @@ -758,7 +761,7 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C info = CS_CLASS (store)->get_folder_info (store, top, flags, ex); CAMEL_STORE_UNLOCK(store, folder_lock); - if (info && (top == NULL || *top == '\0')) { + if (info && (top == NULL || *top == '\0') && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) { if (info->url && (store->flags & CAMEL_STORE_VTRASH)) add_special_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), FALSE); if (info->url && (store->flags & CAMEL_STORE_VJUNK)) diff --git a/camel/camel-store.h b/camel/camel-store.h index 367adc4537..c936517fda 100644 --- a/camel/camel-store.h +++ b/camel/camel-store.h @@ -68,6 +68,8 @@ typedef struct _CamelFolderInfo { #define CAMEL_FOLDER_NOCHILDREN (1<<3) /* a folder which is subscribed */ #define CAMEL_FOLDER_SUBSCRIBED (1<<4) +/* a virtual folder on a non-virtual store (for vTrash/vJunk) */ +#define CAMEL_FOLDER_VIRTUAL (1<<5) /* Structure of rename event's event_data */ typedef struct _CamelRenameInfo { @@ -111,6 +113,7 @@ struct _CamelStore #define CAMEL_STORE_FOLDER_INFO_FAST (1 << 0) #define CAMEL_STORE_FOLDER_INFO_RECURSIVE (1 << 1) #define CAMEL_STORE_FOLDER_INFO_SUBSCRIBED (1 << 2) +#define CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL (1 << 3) /* don't include vTrash/vJunk folders */ typedef struct { CamelServiceClass parent_class; |