diff options
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/camel-folder-search.c | 17 | ||||
-rw-r--r-- | camel/camel-folder-search.h | 2 | ||||
-rw-r--r-- | camel/camel-folder.c | 9 | ||||
-rw-r--r-- | camel/camel-folder.h | 14 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/nntp/camel-nntp-folder.c | 2 |
8 files changed, 37 insertions, 26 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index e628e69e64..03ecd349c4 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2000-07-07 Dan Winship <danw@helixcode.com> + + * camel-folder.c (camel_folder_search_by_expression): Make this + return a GPtrArray rather than a GList. + + * camel-folder-search.c (camel_folder_search_execute_expression): + * providers/imap/camel-imap-folder.c (imap_search_by_expression): + * providers/mbox/camel-mbox-folder.c (mbox_search_by_expression): + * providers/nntp/camel-nntp-folder.c (nntp_search_by_expression): + Update to return a GPtrArray rather than a GList. + 2000-07-07 Jeffrey Stedfast <fejj@helixcode.com> * providers/smtp/camel-smtp-transport.c (esmtp_get_authtypes): diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index e065316ef7..583316d50f 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -237,25 +237,24 @@ camel_folder_search_set_body_index(CamelFolderSearch *search, ibex *index) * @expr: * @ex: * - * Execute the search expression @expr, returning a list of - * all matches as a GList of uid's of matching messages. + * Execute the search expression @expr, returning an array of + * all matches as a GPtrArray of uid's of matching messages. * * Note that any settings such as set_body_index(), set_folder(), * and so on are reset to #NULL once the search has completed. * - * TODO: The interface should probably return a GPtrArray - * of summary items instead (since they are much more useful - * to any client). + * TODO: The interface should probably return summary items instead + * (since they are much more useful to any client). * - * Return value: A GList of strings of all matching messages. Once + * Return value: A GPtrArray of strings of all matching messages. Once * finished with this, the array AND CONTENTS should be free'd * by the caller. **/ -GList * +GPtrArray * camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex) { ESExpResult *r; - GList *matches = NULL; + GPtrArray *matches = g_ptr_array_new (); int i; /* only re-parse if the search has changed */ @@ -274,7 +273,7 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex d(printf("got result ...\n")); for (i=0;i<r->value.ptrarray->len;i++) { d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i))); - matches = g_list_prepend(matches, g_strdup(g_ptr_array_index(r->value.ptrarray, i))); + g_ptr_array_add(matches, g_strdup(g_ptr_array_index(r->value.ptrarray, i))); } e_sexp_result_free(r); } else { diff --git a/camel/camel-folder-search.h b/camel/camel-folder-search.h index 87493912f8..e601eba4ce 100644 --- a/camel/camel-folder-search.h +++ b/camel/camel-folder-search.h @@ -80,6 +80,6 @@ void camel_folder_search_construct (CamelFolderSearch *search); void camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *folder); void camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary); void camel_folder_search_set_body_index(CamelFolderSearch *search, ibex *index); -GList *camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex); +GPtrArray *camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex); #endif /* ! _CAMEL_FOLDER_SEARCH_H */ diff --git a/camel/camel-folder.c b/camel/camel-folder.c index aa5991b48b..8420bd75cf 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -119,8 +119,9 @@ static void delete_message (CamelFolder *folder, static const CamelMessageInfo *get_message_info (CamelFolder *folder, const char *uid); -static GList *search_by_expression (CamelFolder *folder, const char *exp, - CamelException *ex); +static GPtrArray *search_by_expression (CamelFolder *folder, + const char *exp, + CamelException *ex); static void copy_message_to (CamelFolder *source, const char *uid, @@ -1018,7 +1019,7 @@ camel_folder_has_search_capability (CamelFolder *folder) return folder->has_search_capability; } -static GList * +static GPtrArray * search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex) { @@ -1038,7 +1039,7 @@ 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. **/ -GList * +GPtrArray * camel_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex) { diff --git a/camel/camel-folder.h b/camel/camel-folder.h index d49a7f7650..a7fc8fa89c 100644 --- a/camel/camel-folder.h +++ b/camel/camel-folder.h @@ -159,9 +159,9 @@ typedef struct { gboolean (*has_search_capability) (CamelFolder *folder); - GList * (*search_by_expression) (CamelFolder *folder, - const char *expression, - CamelException *ex); + GPtrArray * (*search_by_expression) (CamelFolder *folder, + const char *expression, + CamelException *ex); const CamelMessageInfo * (*get_message_info) (CamelFolder *, const char *uid); @@ -203,8 +203,6 @@ CamelFolder * camel_folder_get_parent_folder (CamelFolder *folder, CamelException *ex); CamelStore * camel_folder_get_parent_store (CamelFolder *folder, CamelException *ex); -GList * camel_folder_list_subfolders (CamelFolder *folder, - CamelException *ex); /* delete operations */ @@ -285,9 +283,11 @@ void camel_folder_free_uids (CamelFolder *folder, /* search api */ gboolean camel_folder_has_search_capability (CamelFolder *folder); -GList * 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); -/* summary info. FIXME: rename this slightly? */ +/* summary info */ const CamelMessageInfo *camel_folder_get_message_info (CamelFolder *summary, const char *uid); diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index baa38315c7..8922d0dd4d 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -78,7 +78,7 @@ static void imap_expunge (CamelFolder *folder, CamelException *ex); static const CamelMessageInfo *imap_get_message_info (CamelFolder *folder, const char *uid); -static GList *imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex); +static GPtrArray *imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex); static void imap_finalize (GtkObject *object); @@ -1341,7 +1341,7 @@ imap_get_message_info (CamelFolder *folder, const char *uid) return info; } -static GList * +static GPtrArray * imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex) { return NULL; diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index d7ee9c2376..ca313ec045 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -76,7 +76,7 @@ static void mbox_delete_message (CamelFolder *folder, const gchar *uid, CamelExc static const CamelMessageInfo *mbox_get_message_info (CamelFolder *folder, const char *uid); -static GList *mbox_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex); +static GPtrArray *mbox_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex); static guint32 mbox_get_message_flags (CamelFolder *folder, const char *uid, CamelException *ex); static void mbox_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set, CamelException *ex); @@ -496,7 +496,7 @@ mbox_get_message_info (CamelFolder *folder, const char *uid) return camel_folder_summary_uid (CAMEL_FOLDER_SUMMARY (mbox_folder->summary), uid); } -static GList * +static GPtrArray * mbox_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex) { CamelMboxFolder *mbox_folder = CAMEL_MBOX_FOLDER (folder); diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index a3cfc49d26..033259a1cd 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -359,7 +359,7 @@ nntp_folder_free_subfolder_names (CamelFolder *folder, GPtrArray *subfolders) } } -static GList* +static GPtrArray* nntp_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex) { g_assert (0); |