diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-08-11 00:35:28 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-08-11 00:35:28 +0800 |
commit | 690509bf826bc02af09cbec064f1f34c48dd9b0c (patch) | |
tree | 41580cd68f0f3e0dc297f11e34e237c37b2dc09e /camel/camel-folder.c | |
parent | 544eb3c3493bfa25d6a3a82d1c18805174c37eb9 (diff) | |
download | gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar.gz gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar.bz2 gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar.lz gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar.xz gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.tar.zst gsoc2013-evolution-690509bf826bc02af09cbec064f1f34c48dd9b0c.zip |
A better way to compress leading whitespace. The code is probably invalid
2000-08-11 Not Zed <NotZed@HelixCode.com>
* camel-mime-parser.c (folder_scan_header): A better way to
compress leading whitespace. The code is probably invalid anyway,
I dont think it will work across buffer boundaries.
* providers/mbox/camel-mbox-folder.c (mbox_append_message): And
write out proper format From lines here too.
* providers/mbox/camel-mbox-summary.c
(camel_mbox_summary_build_from): New function to build a more
compatible mbox "From " line.
(camel_mbox_summary_sync): Write From lines in the proper format.
2000-08-10 Not Zed <NotZed@HelixCode.com>
* providers/mh/camel-mh-store.c (get_folder): Remove warnin g.
* providers/mbox/camel-mbox-store.c (xrename): Kill some warnings
with constification.
* providers/imap/camel-imap-folder.c (imap_append_message): Fixed
for append api change. Eek this routine seriously wastes memory.
* providers/mh/camel-mh-folder.c (mh_search_free): Impelemnt.
(mh_append_message): Fix for api change, and include user flags
and tags in new message.
* providers/vee/camel-vee-folder.c (vee_search_by_expression): Fix
for search api change.
* camel-folder.c (camel_folder_search_free): New function for
freeing search results.
(search_free): Changed my mind, implement a default that actually
does something. Free as to the old interface.
(camel_folder_append_message): Changed to accept a
camelmessageinfo rather than flags, which just doesn't have enough
info in it.
(copy_message_to): Change for append_message api change.
(move_message_to): Likewise.
* providers/mbox/camel-mbox-folder.c (mbox_search_free):
Implement.
(mbox_append_message): Fix for api change, and also copy user
flags/tags across to new summary.
* camel-folder-search.c (search_user_tag): A search expression
that returns the current use flag by name.
(camel_folder_search_free_result): New function to free the result
of a search.
* camel-folder-summary.c: Bump summary version.
(message_info_new):
(message_info_load):
(message_info_save):
(camel_message_info_dup_to):
(camel_message_info_free): Added support for arbitrary tag/value
pairs (CamelTag's).
(camel_tag_get):
(camel_tag_set):
(camel_tag_list_size):
(camel_tag_list_free): Operations for working with CamelTags.
svn path=/trunk/; revision=4683
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 764 |
1 files changed, 301 insertions, 463 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c index 047c814e5e..dd469e78aa 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -36,7 +36,6 @@ static CamelObjectClass *parent_class = NULL; /* Returns the class for a CamelFolder */ #define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT (so)->klass) - enum SIGNALS { FOLDER_CHANGED, MESSAGE_CHANGED, @@ -45,98 +44,66 @@ enum SIGNALS { static guint signals[LAST_SIGNAL] = { 0 }; +static void init(CamelFolder * folder, CamelStore * parent_store, + CamelFolder * parent_folder, const gchar * name, + gchar * separator, gboolean path_begins_with_sep, CamelException * ex); -static void init (CamelFolder *folder, CamelStore *parent_store, - CamelFolder *parent_folder, const gchar *name, - gchar *separator, gboolean path_begins_with_sep, - CamelException *ex); - -static void finalize (GtkObject *object); - - -static void folder_sync (CamelFolder *folder, gboolean expunge, - CamelException *ex); - -static const gchar *get_name (CamelFolder *folder); -static const gchar *get_full_name (CamelFolder *folder); +static void finalize(GtkObject * object); +static void folder_sync(CamelFolder * folder, gboolean expunge, CamelException * ex); -static gboolean can_hold_folders (CamelFolder *folder); -static gboolean can_hold_messages (CamelFolder *folder); -static guint32 get_permanent_flags (CamelFolder *folder); -static guint32 get_message_flags (CamelFolder *folder, const char *uid); -static void set_message_flags (CamelFolder *folder, const char *uid, - guint32 flags, guint32 set); -static gboolean get_message_user_flag (CamelFolder *folder, const char *uid, - const char *name); -static void set_message_user_flag (CamelFolder *folder, const char *uid, - const char *name, gboolean value); +static const gchar *get_name(CamelFolder * folder); +static const gchar *get_full_name(CamelFolder * folder); +static gboolean can_hold_folders(CamelFolder * folder); +static gboolean can_hold_messages(CamelFolder * folder); +static guint32 get_permanent_flags(CamelFolder * folder); +static guint32 get_message_flags(CamelFolder * folder, const char *uid); +static void set_message_flags(CamelFolder * folder, const char *uid, guint32 flags, guint32 set); +static gboolean get_message_user_flag(CamelFolder * folder, const char *uid, const char *name); +static void set_message_user_flag(CamelFolder * folder, const char *uid, const char *name, gboolean value); -static GPtrArray *get_subfolder_names (CamelFolder *folder); -static void free_subfolder_names (CamelFolder *folder, - GPtrArray *array); -static CamelFolder *get_subfolder (CamelFolder *folder, - const gchar *folder_name, - gboolean create, - CamelException *ex); -static CamelFolder *get_parent_folder (CamelFolder *folder); -static CamelStore *get_parent_store (CamelFolder *folder); +static GPtrArray *get_subfolder_names(CamelFolder * folder); +static void free_subfolder_names(CamelFolder * folder, GPtrArray * array); +static CamelFolder *get_subfolder(CamelFolder * folder, -static gint get_message_count (CamelFolder *folder); -static gint get_unread_message_count (CamelFolder *folder); + const gchar * folder_name, gboolean create, CamelException * ex); +static CamelFolder *get_parent_folder(CamelFolder * folder); +static CamelStore *get_parent_store(CamelFolder * folder); -static void expunge (CamelFolder *folder, - CamelException *ex); +static gint get_message_count(CamelFolder * folder); +static gint get_unread_message_count(CamelFolder * folder); +static void expunge(CamelFolder * folder, CamelException * ex); -static void append_message (CamelFolder *folder, CamelMimeMessage *message, - guint32 flags, CamelException *ex); +static void append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, CamelException * ex); +static GPtrArray *get_uids(CamelFolder * folder); +static void free_uids(CamelFolder * folder, GPtrArray * array); +static GPtrArray *get_summary(CamelFolder * folder); +static void free_summary(CamelFolder * folder, GPtrArray * array); +static CamelMimeMessage *get_message(CamelFolder * folder, const gchar * uid, CamelException * ex); -static GPtrArray *get_uids (CamelFolder *folder); -static void free_uids (CamelFolder *folder, - GPtrArray *array); -static GPtrArray *get_summary (CamelFolder *folder); -static void free_summary (CamelFolder *folder, - GPtrArray *array); -static CamelMimeMessage *get_message (CamelFolder *folder, - const gchar *uid, - CamelException *ex); +static const CamelMessageInfo *get_message_info(CamelFolder * folder, const char *uid); -static const CamelMessageInfo *get_message_info (CamelFolder *folder, - const char *uid); +static GPtrArray *search_by_expression(CamelFolder * folder, const char *exp, CamelException * ex); +static void search_free(CamelFolder * folder, GPtrArray * result); -static GPtrArray *search_by_expression (CamelFolder *folder, - const char *exp, - CamelException *ex); +static void copy_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex); -static void copy_message_to (CamelFolder *source, - const char *uid, - CamelFolder *dest, - CamelException *ex); +static void move_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex); -static void move_message_to (CamelFolder *source, - const char *uid, - CamelFolder *dest, - CamelException *ex); +static void freeze(CamelFolder * folder); +static void thaw(CamelFolder * folder); -static void freeze (CamelFolder *folder); -static void thaw (CamelFolder *folder); +static void folder_changed(CamelFolder * folder, int type); +static void message_changed(CamelFolder * folder, const char *uid); -static void folder_changed (CamelFolder *folder, - int type); -static void message_changed (CamelFolder *folder, - const char *uid); - - -static void -camel_folder_class_init (CamelFolderClass *camel_folder_class) +static void camel_folder_class_init(CamelFolderClass * camel_folder_class) { - GtkObjectClass *gtk_object_class = - GTK_OBJECT_CLASS (camel_folder_class); + GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS(camel_folder_class); - parent_class = gtk_type_class (camel_object_get_type ()); + parent_class = gtk_type_class(camel_object_get_type()); /* virtual method definition */ camel_folder_class->init = init; @@ -165,6 +132,7 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class) camel_folder_class->get_summary = get_summary; camel_folder_class->free_summary = free_summary; camel_folder_class->search_by_expression = search_by_expression; + camel_folder_class->search_free = search_free; camel_folder_class->get_message_info = get_message_info; camel_folder_class->copy_message_to = copy_message_to; camel_folder_class->move_message_to = move_message_to; @@ -176,77 +144,67 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class) /* virtual method overload */ gtk_object_class->finalize = finalize; - signals[FOLDER_CHANGED] = - gtk_signal_new ("folder_changed", - GTK_RUN_FIRST, - gtk_object_class->type, - GTK_SIGNAL_OFFSET (CamelFolderClass, - folder_changed), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + signals[FOLDER_CHANGED] = + gtk_signal_new("folder_changed", + GTK_RUN_FIRST, + gtk_object_class->type, + GTK_SIGNAL_OFFSET(CamelFolderClass, + folder_changed), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); - signals[MESSAGE_CHANGED] = - gtk_signal_new ("message_changed", - GTK_RUN_FIRST, - gtk_object_class->type, - GTK_SIGNAL_OFFSET (CamelFolderClass, - message_changed), - gtk_marshal_NONE__STRING, - GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[MESSAGE_CHANGED] = + gtk_signal_new("message_changed", + GTK_RUN_FIRST, + gtk_object_class->type, + GTK_SIGNAL_OFFSET(CamelFolderClass, + message_changed), + gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - gtk_object_class_add_signals (gtk_object_class, signals, LAST_SIGNAL); + gtk_object_class_add_signals(gtk_object_class, signals, LAST_SIGNAL); } - -GtkType -camel_folder_get_type (void) +GtkType camel_folder_get_type(void) { static GtkType camel_folder_type = 0; - if (!camel_folder_type) { - GtkTypeInfo camel_folder_info = - { + if (!camel_folder_type) { + GtkTypeInfo camel_folder_info = { "CamelFolder", - sizeof (CamelFolder), - sizeof (CamelFolderClass), + sizeof(CamelFolder), + sizeof(CamelFolderClass), (GtkClassInitFunc) camel_folder_class_init, (GtkObjectInitFunc) NULL, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, }; - camel_folder_type = gtk_type_unique (camel_object_get_type (), - &camel_folder_info); + camel_folder_type = gtk_type_unique(camel_object_get_type(), &camel_folder_info); } return camel_folder_type; } - -static void -finalize (GtkObject *object) +static void finalize(GtkObject * object) { - CamelFolder *camel_folder = CAMEL_FOLDER (object); + CamelFolder *camel_folder = CAMEL_FOLDER(object); GList *m; - g_free (camel_folder->name); - g_free (camel_folder->full_name); + g_free(camel_folder->name); + g_free(camel_folder->full_name); if (camel_folder->parent_store) - gtk_object_unref (GTK_OBJECT (camel_folder->parent_store)); + gtk_object_unref(GTK_OBJECT(camel_folder->parent_store)); if (camel_folder->parent_folder) - gtk_object_unref (GTK_OBJECT (camel_folder->parent_folder)); + gtk_object_unref(GTK_OBJECT(camel_folder->parent_folder)); for (m = camel_folder->messages_changed; m; m = m->next) - g_free (m->data); - g_list_free (camel_folder->messages_changed); + g_free(m->data); + g_list_free(camel_folder->messages_changed); - GTK_OBJECT_CLASS (parent_class)->finalize (object); + GTK_OBJECT_CLASS(parent_class)->finalize(object); } - /** * init: init the folder * @folder: folder object to initialize @@ -260,32 +218,31 @@ finalize (GtkObject *object) * and name. **/ static void -init (CamelFolder *folder, CamelStore *parent_store, - CamelFolder *parent_folder, const gchar *name, - gchar *separator, gboolean path_begins_with_sep, - CamelException *ex) +init(CamelFolder * folder, CamelStore * parent_store, + CamelFolder * parent_folder, const gchar * name, + gchar * separator, gboolean path_begins_with_sep, CamelException * ex) { gchar *full_name; const gchar *parent_full_name; - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (CAMEL_IS_STORE (parent_store)); - g_return_if_fail (parent_folder == NULL || CAMEL_IS_FOLDER (parent_folder)); - g_return_if_fail (folder->parent_store == NULL); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); + g_return_if_fail(CAMEL_IS_STORE(parent_store)); + g_return_if_fail(parent_folder == NULL || CAMEL_IS_FOLDER(parent_folder)); + g_return_if_fail(folder->parent_store == NULL); folder->parent_store = parent_store; - gtk_object_ref (GTK_OBJECT (parent_store)); + gtk_object_ref(GTK_OBJECT(parent_store)); folder->parent_folder = parent_folder; if (parent_folder) - gtk_object_ref (GTK_OBJECT (parent_folder)); + gtk_object_ref(GTK_OBJECT(parent_folder)); folder->separator = separator; folder->path_begins_with_sep = path_begins_with_sep; /* if the folder already has a name, free it */ - g_free (folder->name); - g_free (folder->full_name); + g_free(folder->name); + g_free(folder->full_name); /* set those fields to NULL now, so that if an exception occurs, they will be set anyway */ @@ -293,19 +250,17 @@ init (CamelFolder *folder, CamelStore *parent_store, folder->full_name = NULL; if (folder->parent_folder) { - parent_full_name = - camel_folder_get_full_name (folder->parent_folder); + parent_full_name = camel_folder_get_full_name(folder->parent_folder); - full_name = g_strdup_printf ("%s%s%s", parent_full_name, - folder->separator, name); + full_name = g_strdup_printf("%s%s%s", parent_full_name, folder->separator, name); } else { if (path_begins_with_sep) - full_name = g_strdup_printf ("%s%s", folder->separator, name); + full_name = g_strdup_printf("%s%s", folder->separator, name); else - full_name = g_strdup (name); + full_name = g_strdup(name); } - folder->name = g_strdup (name); + folder->name = g_strdup(name); folder->full_name = full_name; folder->frozen = 0; @@ -313,12 +268,9 @@ init (CamelFolder *folder, CamelStore *parent_store, folder->messages_changed = NULL; } - -static void -folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) +static void folder_sync(CamelFolder * folder, gboolean expunge, CamelException * ex) { - g_warning ("CamelFolder::sync not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::sync not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -330,18 +282,14 @@ folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) * Sync changes made to a folder to its backing store, possibly expunging * deleted messages as well. **/ -void -camel_folder_sync (CamelFolder *folder, gboolean expunge, - CamelException *ex) +void camel_folder_sync(CamelFolder * folder, gboolean expunge, CamelException * ex) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->sync (folder, expunge, ex); + CF_CLASS(folder)->sync(folder, expunge, ex); } - -static const gchar * -get_name (CamelFolder *folder) +static const gchar *get_name(CamelFolder * folder) { return folder->name; } @@ -355,17 +303,14 @@ get_name (CamelFolder *folder) * * Return value: name of the folder **/ -const gchar * -camel_folder_get_name (CamelFolder *folder) +const gchar *camel_folder_get_name(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_name (folder); + return CF_CLASS(folder)->get_name(folder); } - -static const gchar * -get_full_name (CamelFolder *folder) +static const gchar *get_full_name(CamelFolder * folder) { return folder->full_name; } @@ -378,45 +323,36 @@ get_full_name (CamelFolder *folder) * * Return value: full name of the folder **/ -const gchar * -camel_folder_get_full_name (CamelFolder *folder) +const gchar *camel_folder_get_full_name(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_full_name (folder); + return CF_CLASS(folder)->get_full_name(folder); } - -static gboolean -can_hold_folders (CamelFolder *folder) +static gboolean can_hold_folders(CamelFolder * folder) { return folder->can_hold_folders; } -static gboolean -can_hold_messages (CamelFolder *folder) +static gboolean can_hold_messages(CamelFolder * folder) { return folder->can_hold_messages; } - -static CamelFolder * -get_subfolder (CamelFolder *folder, const gchar *folder_name, - gboolean create, CamelException *ex) +static CamelFolder *get_subfolder(CamelFolder * folder, const gchar * folder_name, gboolean create, CamelException * ex) { CamelFolder *new_folder; gchar *full_name; const gchar *current_folder_full_name; - g_return_val_if_fail (CAMEL_IS_STORE (folder->parent_store), NULL); + g_return_val_if_fail(CAMEL_IS_STORE(folder->parent_store), NULL); - current_folder_full_name = camel_folder_get_full_name (folder); + current_folder_full_name = camel_folder_get_full_name(folder); - full_name = g_strdup_printf ("%s%s%s", current_folder_full_name, - folder->separator, folder_name); - new_folder = camel_store_get_folder (folder->parent_store, - full_name, create, ex); - g_free (full_name); + full_name = g_strdup_printf("%s%s%s", current_folder_full_name, folder->separator, folder_name); + new_folder = camel_store_get_folder(folder->parent_store, full_name, create, ex); + g_free(full_name); return new_folder; } @@ -435,20 +371,16 @@ get_subfolder (CamelFolder *folder, const gchar *folder_name, * Return value: the requested folder, or %NULL if the subfolder object * could not be obtained **/ -CamelFolder * -camel_folder_get_subfolder (CamelFolder *folder, const gchar *folder_name, - gboolean create, CamelException *ex) +CamelFolder *camel_folder_get_subfolder(CamelFolder * folder, const gchar * folder_name, + gboolean create, CamelException * ex) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); - g_return_val_if_fail (folder_name != NULL, NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); + g_return_val_if_fail(folder_name != NULL, NULL); - return CF_CLASS (folder)->get_subfolder (folder, folder_name, - create, ex); + return CF_CLASS(folder)->get_subfolder(folder, folder_name, create, ex); } - -static CamelFolder * -get_parent_folder (CamelFolder *folder) +static CamelFolder *get_parent_folder(CamelFolder * folder) { return folder->parent_folder; } @@ -459,17 +391,14 @@ get_parent_folder (CamelFolder *folder) * * Return value: the folder's parent **/ -CamelFolder * -camel_folder_get_parent_folder (CamelFolder *folder) +CamelFolder *camel_folder_get_parent_folder(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_parent_folder (folder); + return CF_CLASS(folder)->get_parent_folder(folder); } - -static CamelStore * -get_parent_store (CamelFolder *folder) +static CamelStore *get_parent_store(CamelFolder * folder) { return folder->parent_store; } @@ -480,20 +409,16 @@ get_parent_store (CamelFolder *folder) * * Return value: the parent store of the folder. **/ -CamelStore * -camel_folder_get_parent_store (CamelFolder *folder) +CamelStore *camel_folder_get_parent_store(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_parent_store (folder); + return CF_CLASS(folder)->get_parent_store(folder); } - -static GPtrArray * -get_subfolder_names (CamelFolder *folder) +static GPtrArray *get_subfolder_names(CamelFolder * folder) { - g_warning ("CamelFolder::get_subfolder_names not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_subfolder_names not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -505,20 +430,17 @@ get_subfolder_names (CamelFolder *folder) * subfolders. The array should not be modified and must be freed with * camel_folder_free_subfolder_names(). **/ -GPtrArray * -camel_folder_get_subfolder_names (CamelFolder *folder) +GPtrArray *camel_folder_get_subfolder_names(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_subfolder_names (folder); + return CF_CLASS(folder)->get_subfolder_names(folder); } - -static void -free_subfolder_names (CamelFolder *folder, GPtrArray *array) +static void free_subfolder_names(CamelFolder * folder, GPtrArray * array) { - g_warning ("CamelFolder::free_subfolder_names not implemented " - "for `%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::free_subfolder_names not implemented " + "for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -528,23 +450,18 @@ free_subfolder_names (CamelFolder *folder, GPtrArray *array) * * Frees the array of names returned by camel_folder_get_subfolder_names(). **/ -void -camel_folder_free_subfolder_names (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_subfolder_names(CamelFolder * folder, GPtrArray * array) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->free_subfolder_names (folder, array); + CF_CLASS(folder)->free_subfolder_names(folder, array); } - -static void -expunge (CamelFolder *folder, CamelException *ex) +static void expunge(CamelFolder * folder, CamelException * ex) { - g_warning ("CamelFolder::expunge not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::expunge not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } - /** * camel_folder_expunge: * @folder: the folder @@ -552,20 +469,16 @@ expunge (CamelFolder *folder, CamelException *ex) * * Delete messages which have been marked as "DELETED" **/ -void -camel_folder_expunge (CamelFolder *folder, CamelException *ex) +void camel_folder_expunge(CamelFolder * folder, CamelException * ex) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->expunge (folder, ex); + CF_CLASS(folder)->expunge(folder, ex); } - -static gint -get_message_count (CamelFolder *folder) +static gint get_message_count(CamelFolder * folder) { - g_warning ("CamelFolder::get_message_count not implemented " - "for `%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_message_count not implemented " "for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return -1; } @@ -575,19 +488,17 @@ get_message_count (CamelFolder *folder) * * Return value: the number of messages in the folder, or -1 if unknown. **/ -gint -camel_folder_get_message_count (CamelFolder *folder) +gint camel_folder_get_message_count(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), -1); - return CF_CLASS (folder)->get_message_count (folder); + return CF_CLASS(folder)->get_message_count(folder); } -static gint -get_unread_message_count (CamelFolder *folder) +static gint get_unread_message_count(CamelFolder * folder) { - g_warning ("CamelFolder::get_unread_message_count not implemented " - "for `%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_unread_message_count not implemented " + "for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return -1; } @@ -597,21 +508,16 @@ get_unread_message_count (CamelFolder *folder) * * Return value: the number of unread messages in the folder, or -1 if unknown. **/ -gint -camel_folder_get_unread_message_count (CamelFolder *folder) +gint camel_folder_get_unread_message_count(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), -1); - return CF_CLASS (folder)->get_unread_message_count (folder); + return CF_CLASS(folder)->get_unread_message_count(folder); } - -static void -append_message (CamelFolder *folder, CamelMimeMessage *message, - guint32 flags, CamelException *ex) +static void append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, CamelException * ex) { - g_warning ("CamelFolder::append_message not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::append_message not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return; } @@ -620,24 +526,19 @@ append_message (CamelFolder *folder, CamelMimeMessage *message, * camel_folder_append_message: add a message to a folder * @folder: folder object to add the message to * @message: message object + * @info: optional message info with additional flags/etc to set on new message. * @ex: exception object * * Add a message to a folder. **/ -void -camel_folder_append_message (CamelFolder *folder, - CamelMimeMessage *message, - guint32 flags, - CamelException *ex) +void camel_folder_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, CamelException * ex) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->append_message (folder, message, flags, ex); + CF_CLASS(folder)->append_message(folder, message, info, ex); } - -static guint32 -get_permanent_flags (CamelFolder *folder) +static guint32 get_permanent_flags(CamelFolder * folder) { return folder->permanent_flags; } @@ -650,20 +551,16 @@ get_permanent_flags (CamelFolder *folder) * stored on a message between sessions. If it includes %CAMEL_FLAG_USER, * then user-defined flags will be remembered. **/ -guint32 -camel_folder_get_permanent_flags (CamelFolder *folder) +guint32 camel_folder_get_permanent_flags(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), 0); - return CF_CLASS (folder)->get_permanent_flags (folder); + return CF_CLASS(folder)->get_permanent_flags(folder); } - -static guint32 -get_message_flags (CamelFolder *folder, const char *uid) +static guint32 get_message_flags(CamelFolder * folder, const char *uid) { - g_warning ("CamelFolder::get_message_flags not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_message_flags not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return 0; } @@ -675,21 +572,16 @@ get_message_flags (CamelFolder *folder, const char *uid) * Return value: the CamelMessageFlags that are set on the indicated * message. **/ -guint32 -camel_folder_get_message_flags (CamelFolder *folder, const char *uid) +guint32 camel_folder_get_message_flags(CamelFolder * folder, const char *uid) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), 0); - return CF_CLASS (folder)->get_message_flags (folder, uid); + return CF_CLASS(folder)->get_message_flags(folder, uid); } - -static void -set_message_flags (CamelFolder *folder, const char *uid, - guint32 flags, guint32 set) +static void set_message_flags(CamelFolder * folder, const char *uid, guint32 flags, guint32 set) { - g_warning ("CamelFolder::set_message_flags not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::set_message_flags not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -703,22 +595,17 @@ set_message_flags (CamelFolder *folder, const char *uid, * on the indicated message. (This may or may not persist after the * folder or store is closed. See camel_folder_get_permanent_flags().) **/ -void -camel_folder_set_message_flags (CamelFolder *folder, const char *uid, - guint32 flags, guint32 set) +void camel_folder_set_message_flags(CamelFolder * folder, const char *uid, guint32 flags, guint32 set) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->set_message_flags (folder, uid, flags, set); + CF_CLASS(folder)->set_message_flags(folder, uid, flags, set); } - -static gboolean -get_message_user_flag (CamelFolder *folder, const char *uid, - const char *name) +static gboolean get_message_user_flag(CamelFolder * folder, const char *uid, const char *name) { - g_warning ("CamelFolder::get_message_user_flag not implemented " - "for `%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_message_user_flag not implemented " + "for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return FALSE; } @@ -730,22 +617,17 @@ get_message_user_flag (CamelFolder *folder, const char *uid, * * Return value: whether or not the given user flag is set on the message. **/ -gboolean -camel_folder_get_message_user_flag (CamelFolder *folder, const char *uid, - const char *name) +gboolean camel_folder_get_message_user_flag(CamelFolder * folder, const char *uid, const char *name) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), 0); - return CF_CLASS (folder)->get_message_user_flag (folder, uid, name); + return CF_CLASS(folder)->get_message_user_flag(folder, uid, name); } - -static void -set_message_user_flag (CamelFolder *folder, const char *uid, - const char *name, gboolean value) +static void set_message_user_flag(CamelFolder * folder, const char *uid, const char *name, gboolean value) { - g_warning ("CamelFolder::set_message_user_flag not implemented " - "for `%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::set_message_user_flag not implemented " + "for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -759,21 +641,16 @@ set_message_user_flag (CamelFolder *folder, const char *uid, * on the indicated message. (This may or may not persist after the * folder or store is closed. See camel_folder_get_permanent_flags().) **/ -void -camel_folder_set_message_user_flag (CamelFolder *folder, const char *uid, - const char *name, gboolean value) +void camel_folder_set_message_user_flag(CamelFolder * folder, const char *uid, const char *name, gboolean value) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->set_message_user_flag (folder, uid, name, value); + CF_CLASS(folder)->set_message_user_flag(folder, uid, name, value); } - -static const CamelMessageInfo * -get_message_info (CamelFolder *folder, const char *uid) +static const CamelMessageInfo *get_message_info(CamelFolder * folder, const char *uid) { - g_warning ("CamelFolder::get_message_info not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_message_info not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -784,33 +661,27 @@ get_message_info (CamelFolder *folder, const char *uid) * * Return value: the summary information for the indicated message **/ -const CamelMessageInfo * -camel_folder_get_message_info (CamelFolder *folder, const char *uid) +const CamelMessageInfo *camel_folder_get_message_info(CamelFolder * folder, const char *uid) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); - g_return_val_if_fail (uid != NULL, NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); + g_return_val_if_fail(uid != NULL, NULL); - return CF_CLASS (folder)->get_message_info (folder, uid); + return CF_CLASS(folder)->get_message_info(folder, uid); } - /* TODO: is this function required anyway? */ -gboolean -camel_folder_has_summary_capability (CamelFolder *folder) +gboolean camel_folder_has_summary_capability(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), FALSE); return folder->has_summary_capability; } - /* UIDs stuff */ -static CamelMimeMessage * -get_message (CamelFolder *folder, const gchar *uid, CamelException *ex) +static CamelMimeMessage *get_message(CamelFolder * folder, const gchar * uid, CamelException * ex) { - g_warning ("CamelFolder::get_message not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_message not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -826,21 +697,16 @@ get_message (CamelFolder *folder, const gchar *uid, CamelException *ex) * * Return value: Message corresponding to the UID **/ -CamelMimeMessage * -camel_folder_get_message (CamelFolder *folder, const gchar *uid, - CamelException *ex) +CamelMimeMessage *camel_folder_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_message (folder, uid, ex); + return CF_CLASS(folder)->get_message(folder, uid, ex); } - -static GPtrArray * -get_uids (CamelFolder *folder) +static GPtrArray *get_uids(CamelFolder * folder) { - g_warning ("CamelFolder::get_uids not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_uids not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -856,20 +722,16 @@ get_uids (CamelFolder *folder) * Return value: GPtrArray of UIDs corresponding to the messages * available in the folder. **/ -GPtrArray * -camel_folder_get_uids (CamelFolder *folder) +GPtrArray *camel_folder_get_uids(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_uids (folder); + return CF_CLASS(folder)->get_uids(folder); } - -static void -free_uids (CamelFolder *folder, GPtrArray *array) +static void free_uids(CamelFolder * folder, GPtrArray * array) { - g_warning ("CamelFolder::free_uids not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::free_uids not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -879,20 +741,16 @@ free_uids (CamelFolder *folder, GPtrArray *array) * * Frees the array of UIDs returned by camel_folder_get_uids(). **/ -void -camel_folder_free_uids (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_uids(CamelFolder * folder, GPtrArray * array) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->free_uids (folder, array); + CF_CLASS(folder)->free_uids(folder, array); } - -static GPtrArray * -get_summary (CamelFolder *folder) +static GPtrArray *get_summary(CamelFolder * folder) { - g_warning ("CamelFolder::get_summary not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::get_summary not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -906,20 +764,16 @@ get_summary (CamelFolder *folder) * * Return value: an array of CamelMessageInfo **/ -GPtrArray * -camel_folder_get_summary (CamelFolder *folder) +GPtrArray *camel_folder_get_summary(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); - return CF_CLASS (folder)->get_summary (folder); + return CF_CLASS(folder)->get_summary(folder); } - -static void -free_summary (CamelFolder *folder, GPtrArray *array) +static void free_summary(CamelFolder * folder, GPtrArray * array) { - g_warning ("CamelFolder::free_summary not implemented for `%s'", - gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::free_summary not implemented for `%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); } /** @@ -929,15 +783,13 @@ free_summary (CamelFolder *folder, GPtrArray *array) * * Frees the summary array returned by camel_folder_get_summary(). **/ -void -camel_folder_free_summary (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_summary(CamelFolder * folder, GPtrArray * array) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->free_summary (folder, array); + CF_CLASS(folder)->free_summary(folder, array); } - /** * camel_folder_has_search_capability: * @folder: Folder object @@ -946,20 +798,17 @@ camel_folder_free_summary (CamelFolder *folder, GPtrArray *array) * * Return value: %TRUE if the folder supports searching **/ -gboolean -camel_folder_has_search_capability (CamelFolder *folder) +gboolean camel_folder_has_search_capability(CamelFolder * folder) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), FALSE); return folder->has_search_capability; } -static GPtrArray * -search_by_expression (CamelFolder *folder, const char *expression, - CamelException *ex) +static GPtrArray *search_by_expression(CamelFolder * folder, const char *expression, CamelException * ex) { - g_warning ("CamelFolder::search_by_expression not implemented for " - "`%s'", gtk_type_name (GTK_OBJECT_TYPE (folder))); + g_warning("CamelFolder::search_by_expression not implemented for " + "`%s'", gtk_type_name(GTK_OBJECT_TYPE(folder))); return NULL; } @@ -974,33 +823,52 @@ search_by_expression (CamelFolder *folder, const char *expression, * Return value: a list of uids of matching messages. The caller must * free the list and each of the elements when it is done. **/ -GPtrArray * -camel_folder_search_by_expression (CamelFolder *folder, const char *expression, - CamelException *ex) +GPtrArray *camel_folder_search_by_expression(CamelFolder * folder, const char *expression, CamelException * ex) { - g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); - g_return_val_if_fail (folder->has_search_capability, NULL); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), NULL); + g_return_val_if_fail(folder->has_search_capability, NULL); - return CF_CLASS (folder)->search_by_expression (folder, expression, ex); + return CF_CLASS(folder)->search_by_expression(folder, expression, ex); } +void search_free(CamelFolder * folder, GPtrArray * result) +{ + int i; + + for (i = 0; i < result->len; i++) + g_free(g_ptr_array_index(result, i)); + g_ptr_array_free(result, TRUE); +} -static void -copy_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, - CamelException *ex) +/** + * camel_folder_search_free: + * @folder: + * @result: + * + * Free the result of a search. + **/ +void camel_folder_search_free(CamelFolder * folder, GPtrArray * result) +{ + g_return_if_fail(CAMEL_IS_FOLDER(folder)); + g_return_if_fail(folder->has_search_capability); + + return CF_CLASS(folder)->search_free(folder, result); +} + +static void copy_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex) { CamelMimeMessage *msg; const CamelMessageInfo *info; /* Default implementation. */ - - msg = camel_folder_get_message (source, uid, ex); + + msg = camel_folder_get_message(source, uid, ex); if (!msg) return; - info = camel_folder_get_message_info (source, uid); - camel_folder_append_message (dest, msg, info ? info->flags : 0, ex); - gtk_object_unref (GTK_OBJECT (msg)); - if (camel_exception_is_set (ex)) + info = camel_folder_get_message_info(source, uid); + camel_folder_append_message(dest, msg, info, ex); + gtk_object_unref(GTK_OBJECT(msg)); + if (camel_exception_is_set(ex)) return; } @@ -1015,40 +883,34 @@ copy_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, * @dest folders have the same parent_store, this may be more efficient * than a camel_folder_append_message(). **/ -void -camel_folder_copy_message_to (CamelFolder *source, const char *uid, - CamelFolder *dest, CamelException *ex) +void camel_folder_copy_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex) { - g_return_if_fail (CAMEL_IS_FOLDER (source)); - g_return_if_fail (CAMEL_IS_FOLDER (dest)); - g_return_if_fail (uid != NULL); + g_return_if_fail(CAMEL_IS_FOLDER(source)); + g_return_if_fail(CAMEL_IS_FOLDER(dest)); + g_return_if_fail(uid != NULL); if (source->parent_store == dest->parent_store) { - return CF_CLASS (source)->copy_message_to (source, uid, - dest, ex); + return CF_CLASS(source)->copy_message_to(source, uid, dest, ex); } else - return copy_message_to (source, uid, dest, ex); + return copy_message_to(source, uid, dest, ex); } - -static void -move_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, - CamelException *ex) +static void move_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex) { CamelMimeMessage *msg; const CamelMessageInfo *info; /* Default implementation. */ - - msg = camel_folder_get_message (source, uid, ex); + + msg = camel_folder_get_message(source, uid, ex); if (!msg) return; - info = camel_folder_get_message_info (source, uid); - camel_folder_append_message (dest, msg, info ? info->flags : 0, ex); - gtk_object_unref (GTK_OBJECT (msg)); - if (camel_exception_is_set (ex)) + info = camel_folder_get_message_info(source, uid); + camel_folder_append_message(dest, msg, info, ex); + gtk_object_unref(GTK_OBJECT(msg)); + if (camel_exception_is_set(ex)) return; - camel_folder_delete_message (source, uid); + camel_folder_delete_message(source, uid); } /** @@ -1063,24 +925,19 @@ move_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, * than a camel_folder_append_message() followed by * camel_folder_delete_message(). **/ -void -camel_folder_move_message_to (CamelFolder *source, const char *uid, - CamelFolder *dest, CamelException *ex) +void camel_folder_move_message_to(CamelFolder * source, const char *uid, CamelFolder * dest, CamelException * ex) { - g_return_if_fail (CAMEL_IS_FOLDER (source)); - g_return_if_fail (CAMEL_IS_FOLDER (dest)); - g_return_if_fail (uid != NULL); + g_return_if_fail(CAMEL_IS_FOLDER(source)); + g_return_if_fail(CAMEL_IS_FOLDER(dest)); + g_return_if_fail(uid != NULL); if (source->parent_store == dest->parent_store) { - return CF_CLASS (source)->move_message_to (source, uid, - dest, ex); + return CF_CLASS(source)->move_message_to(source, uid, dest, ex); } else - return move_message_to (source, uid, dest, ex); + return move_message_to(source, uid, dest, ex); } - -static void -freeze (CamelFolder *folder) +static void freeze(CamelFolder * folder) { folder->frozen++; } @@ -1094,17 +951,14 @@ freeze (CamelFolder *folder) * When the folder is later thawed with camel_folder_thaw(), the * suppressed signals will be emitted. **/ -void -camel_folder_freeze (CamelFolder *folder) +void camel_folder_freeze(CamelFolder * folder) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); - CF_CLASS (folder)->freeze (folder); + CF_CLASS(folder)->freeze(folder); } - -static void -thaw (CamelFolder *folder) +static void thaw(CamelFolder * folder) { GList *messages, *m; @@ -1124,25 +978,23 @@ thaw (CamelFolder *folder) if (folder->folder_changed) { folder->folder_changed = FALSE; - gtk_signal_emit (GTK_OBJECT (folder), - signals[FOLDER_CHANGED], 0); + gtk_signal_emit(GTK_OBJECT(folder), signals[FOLDER_CHANGED], 0); } else if (folder->messages_changed) { /* FIXME: would be nice to not emit more than once for * a given message */ for (m = messages; m; m = m->next) { - gtk_signal_emit_by_name (GTK_OBJECT (folder), - "message_changed", m->data); - g_free (m->data); + gtk_signal_emit_by_name(GTK_OBJECT(folder), "message_changed", m->data); + g_free(m->data); } - g_list_free (messages); + g_list_free(messages); return; } if (messages) { for (m = messages; m; m = m->next) - g_free (m->data); - g_list_free (messages); + g_free(m->data); + g_list_free(messages); } } @@ -1153,49 +1005,38 @@ thaw (CamelFolder *folder) * Thaws the folder and emits any pending folder_changed or * message_changed signals. **/ -void -camel_folder_thaw (CamelFolder *folder) +void camel_folder_thaw(CamelFolder * folder) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); - g_return_if_fail (folder->frozen != 0); + g_return_if_fail(CAMEL_IS_FOLDER(folder)); + g_return_if_fail(folder->frozen != 0); - CF_CLASS (folder)->thaw (folder); + CF_CLASS(folder)->thaw(folder); } - /* Default signal implementations, which block emission when we're * frozen. */ -static void -folder_changed (CamelFolder *folder, int type) +static void folder_changed(CamelFolder * folder, int type) { if (folder->frozen) { - gtk_signal_emit_stop (GTK_OBJECT (folder), - signals[FOLDER_CHANGED]); + gtk_signal_emit_stop(GTK_OBJECT(folder), signals[FOLDER_CHANGED]); folder->folder_changed = TRUE; } } -static void -message_changed (CamelFolder *folder, const char *uid) +static void message_changed(CamelFolder * folder, const char *uid) { if (folder->frozen) { - gtk_signal_emit_stop (GTK_OBJECT (folder), - signals[MESSAGE_CHANGED]); + gtk_signal_emit_stop(GTK_OBJECT(folder), signals[MESSAGE_CHANGED]); /* Only record the UID if it will be useful later. */ if (!folder->folder_changed && - gtk_signal_handler_pending (GTK_OBJECT (folder), - signals[MESSAGE_CHANGED], - FALSE)) { - folder->messages_changed = - g_list_prepend (folder->messages_changed, - g_strdup (uid)); + gtk_signal_handler_pending(GTK_OBJECT(folder), signals[MESSAGE_CHANGED], FALSE)) { + folder->messages_changed = g_list_prepend(folder->messages_changed, g_strdup(uid)); } } } - /** * camel_folder_free_nop: * @folder: a folder @@ -1206,8 +1047,7 @@ message_changed (CamelFolder *folder, const char *uid) * or free_subfolder_names when the returned array is "static" * information and should not be freed. **/ -void -camel_folder_free_nop (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_nop(CamelFolder * folder, GPtrArray * array) { ; } @@ -1222,10 +1062,9 @@ camel_folder_free_nop (CamelFolder *folder, GPtrArray *array) * free_subfolder_names when the returned array needs to be freed * but its contents come from "static" information. **/ -void -camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_shallow(CamelFolder * folder, GPtrArray * array) { - g_ptr_array_free (array, TRUE); + g_ptr_array_free(array, TRUE); } /** @@ -1238,12 +1077,11 @@ camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array) * free_subfolder_names (but NOT free_summary) when the provided * information was created explicitly by the corresponding get_ call. **/ -void -camel_folder_free_deep (CamelFolder *folder, GPtrArray *array) +void camel_folder_free_deep(CamelFolder * folder, GPtrArray * array) { int i; for (i = 0; i < array->len; i++) - g_free (array->pdata[i]); - g_ptr_array_free (array, TRUE); + g_free(array->pdata[i]); + g_ptr_array_free(array, TRUE); } |