diff options
author | Not Zed <NotZed@Ximian.com> | 2001-03-27 07:10:40 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-03-27 07:10:40 +0800 |
commit | 1d80d46ed53ac4fd6b292c972529b7c6d3bd0597 (patch) | |
tree | f17bdb8c7cab7325e9ec5ed173ea81fd9e182a4f /camel/camel-vee-store.c | |
parent | 43f089b9ccf1d2b660f41b7b211f8030ab2ed8ab (diff) | |
download | gsoc2013-evolution-1d80d46ed53ac4fd6b292c972529b7c6d3bd0597.tar.gz gsoc2013-evolution-1d80d46ed53ac4fd6b292c972529b7c6d3bd0597.tar.zst gsoc2013-evolution-1d80d46ed53ac4fd6b292c972529b7c6d3bd0597.zip |
Added folder_created event here.
2001-03-27 Not Zed <NotZed@Ximian.com>
* camel-vee-store.c (vee_get_folder): Added folder_created event
here.
* camel-vee-folder.c (unmatched_finalise): Removed, moved into
main finalise code.
(message_changed): Just create a new change entry and promote it
to a folder_changed thing.
(vee_sync): Always rebuild folder on sync, even when not expunge.
(folder_changed): If not autoupdating, make sure we remove any
removed entries.
(vee_folder_build_folder):
(vee_folder_remove_folder): NOP if we're called on
folder_unmatched.
(vee_search_by_expression): Only search each folder once. Should
we also order the result in summary order?
2001-03-20 Not Zed <NotZed@Ximian.com>
* camel-store.c (init_trash): Fix calling for vee_folder_new().
* camel-folder-summary.c (camel_folder_summary_remove_index):
Optimise slightly, use ptr_array_remove_index rather than have to
search for the index by using summary_remove.
* camel-vee-folder.h: Removed local member from VeeFolder, since
it was never used.
* camel-vee-store.c (camel_vee_store_finalise): Setup finalise
function.
* camel-vee-folder.c (camel_vee_folder_set_expression): New
function to set the query of an existing vfolder.
(camel_vee_folder_construct): New function for
convenience/subclasses.
(camel_vee_folder_new): Removed exception parameter, no longer
needed (since we dont search yet).
(camel_vee_folder_new): Changed to use folder_construct, and no
longer raise the folder created signal.
(vee_folder_build_folder): Make it return error on exception, so
we can work without exceptions.
(vee_folder_remove_folder): Use remove index rather than
remove_uid, this is ok since we have the summary locked for our
own access.
(camel_vee_folder_add_folder): Only add the folder to the
unmatched private if it is not a private folder.
(camel_vee_folder_remove_folder): Only remove the folder from
unmatched if it is not private.
(vee_expunge): Just call sync with expunge set.
(vee_sync): If expunging, also refresh the search.
(vee_folder_build_folder): We do our own locking now, removed from
callers, also trigger changed events here too (within locks),
fixed callers appropriately.
(vee_folder_remove_folder): Do our own locking, and trigger
changed events.
(vee_folder_add_info): Renamed of vee_folder_add, we now take a
hash of the folder name, rather than use the folders address.
(hash_folder): Convert a folder name into an 8 character hash.
(vee_get_message, vee_search_by_expression, vee_set_message_flags,
vee_set_message_user_flag, vee_move_message_to): Changed the uid
to be an 8 byte hash + original uid, with no ':' anymore.
svn path=/trunk/; revision=8957
Diffstat (limited to 'camel/camel-vee-store.c')
-rw-r--r-- | camel/camel-vee-store.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c index 38d535dbee..5a9d79d8b2 100644 --- a/camel/camel-vee-store.c +++ b/camel/camel-vee-store.c @@ -22,17 +22,21 @@ #include "camel-vee-store.h" #include "camel-vee-folder.h" +#include <string.h> + static CamelFolder *vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); static void vee_init_trash (CamelStore *store); static CamelFolder *vee_get_trash (CamelStore *store, CamelException *ex); struct _CamelVeeStorePrivate { + CamelFolderInfo *folder_info; }; #define _PRIVATE(o) (((CamelVeeStore *)(o))->priv) static void camel_vee_store_class_init (CamelVeeStoreClass *klass); static void camel_vee_store_init (CamelVeeStore *obj); +static void camel_vee_store_finalise (CamelObject *obj); static CamelStoreClass *camel_vee_store_parent; @@ -48,14 +52,13 @@ camel_vee_store_get_type (void) (CamelObjectClassInitFunc) camel_vee_store_class_init, NULL, (CamelObjectInitFunc) camel_vee_store_init, - NULL); + (CamelObjectFinalizeFunc) camel_vee_store_finalise); } return type; } static void - camel_vee_store_class_init (CamelVeeStoreClass *klass) { CamelStoreClass *store_class = (CamelStoreClass *) klass; @@ -76,6 +79,14 @@ camel_vee_store_init (CamelVeeStore *obj) p = _PRIVATE(obj) = g_malloc0(sizeof(*p)); } +static void +camel_vee_store_finalise (CamelObject *obj) +{ + CamelVeeStore *vs = (CamelVeeStore *)obj; + + g_free(vs->priv); +} + /** * camel_vee_store_new: * @@ -86,14 +97,33 @@ camel_vee_store_init (CamelVeeStore *obj) CamelVeeStore * camel_vee_store_new (void) { - CamelVeeStore *new = CAMEL_VEE_STORE ( camel_object_new (camel_vee_store_get_type ())); + CamelVeeStore *new = CAMEL_VEE_STORE(camel_object_new(camel_vee_store_get_type ())); return new; } static CamelFolder * vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex) { - return camel_vee_folder_new(store, folder_name, flags, ex); + CamelFolderInfo *fi; + CamelVeeFolder *vf; + char *name; + + vf = (CamelVeeFolder *)camel_vee_folder_new(store, folder_name, flags); + if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) { + fi = g_malloc0(sizeof(*fi)); + fi->full_name = g_strdup(vf->vname); + name = strrchr(vf->vname, '/'); + if (name == NULL) + name = vf->vname; + fi->name = g_strdup(name); + fi->url = g_strdup_printf("vfolder:%s", vf->vname); + fi->unread_message_count = -1; + + camel_object_trigger_event(CAMEL_OBJECT(store), "folder_created", fi); + camel_folder_info_free(fi); + } + + return (CamelFolder *)vf; } static void |