aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-08 05:13:41 +0800
committerDan Winship <danw@src.gnome.org>2000-07-08 05:13:41 +0800
commit011e287e7d36126a6fbf88992c14a9b4c0344739 (patch)
treecf4415f66ef195463161874d055686b5ea79621e /camel/camel-folder-search.c
parent665da2c706a462d92c70fad3e41974fe5f4d8c30 (diff)
downloadgsoc2013-evolution-011e287e7d36126a6fbf88992c14a9b4c0344739.tar.gz
gsoc2013-evolution-011e287e7d36126a6fbf88992c14a9b4c0344739.tar.zst
gsoc2013-evolution-011e287e7d36126a6fbf88992c14a9b4c0344739.zip
Make this return a GPtrArray rather than a GList.
* 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. svn path=/trunk/; revision=3958
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c17
1 files changed, 8 insertions, 9 deletions
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 {