* use GError to convey error info in MuQuery; update users

This commit is contained in:
Dirk-Jan C. Binnema
2010-11-24 00:47:36 +02:00
parent 21c01f156d
commit b87b5d25fd
5 changed files with 69 additions and 47 deletions

View File

@ -311,21 +311,25 @@ empty_or_display_contact (const gchar* str)
static MuMsgIter *
run_query (const char *xpath, const char *query)
{
GError *err;
MuQuery *xapian;
MuMsgIter *iter;
xapian = mu_query_new (xpath);
err = NULL;
xapian = mu_query_new (xpath, &err);
if (!xapian) {
g_printerr ("Failed to create a Xapian query\n");
g_warning ("Error: %s", err->message);
g_error_free (err);
return NULL;
}
iter = mu_query_run (xapian, query,
MU_MSG_FIELD_ID_DATE,
TRUE, 0);
TRUE, 0, &err);
mu_query_destroy (xapian);
if (!iter) {
g_warning ("error: running query failed\n");
g_warning ("Error: %s", err->message);
g_error_free (err);
return NULL;
}