aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorRoss Burton <rburton@src.gnome.org>2004-01-09 20:18:33 +0800
committerRoss Burton <rburton@src.gnome.org>2004-01-09 20:18:33 +0800
commit51a593107b1a483263fd1cc92d2ad682958a4e7a (patch)
treeae7f6558dbad592f623ac8a629062d5714838842 /addressbook/gui
parentaf3f81fbeaebd6d45fb4142611c1338c576da29f (diff)
downloadgsoc2013-evolution-51a593107b1a483263fd1cc92d2ad682958a4e7a.tar.gz
gsoc2013-evolution-51a593107b1a483263fd1cc92d2ad682958a4e7a.tar.zst
gsoc2013-evolution-51a593107b1a483263fd1cc92d2ad682958a4e7a.zip
Update for API changes to e-book-async
svn path=/trunk/; revision=24130
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c25
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c16
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c8
3 files changed, 27 insertions, 22 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index 39b5f7a008..b80611b9ff 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -465,11 +465,12 @@ static gint book_query_count = sizeof (book_queries) / sizeof (BookQuery);
/*
* Build up a big compound sexp corresponding to all of our queries.
*/
-static gchar *
+static EBookQuery*
book_query_sexp (ESelectNamesCompletion *comp)
{
gint i, j;
- gchar **queryv, *query;
+ gchar **queryv;
+ EBookQuery *query;
g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
@@ -486,12 +487,15 @@ book_query_sexp (ESelectNamesCompletion *comp)
if (j == 0) {
query = NULL;
} else if (j == 1) {
- query = queryv[0];
+ query = e_book_query_from_string (queryv[0]);
queryv[0] = NULL;
} else {
- gchar *tmp = g_strjoinv (" ", queryv);
- query = g_strdup_printf ("(or %s)", tmp);
+ gchar *tmp, *tmp2;
+ tmp = g_strjoinv (" ", queryv);
+ tmp2 = g_strdup_printf ("(or %s)", tmp);
+ query = e_book_query_from_string (tmp2);
g_free (tmp);
+ g_free (tmp2);
}
for (i=0; i<book_query_count; ++i)
@@ -946,7 +950,7 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
e_select_names_completion_stop_query (comp); /* Stop any prior queries. */
if (comp->priv->books_not_ready == 0) {
- gchar *sexp;
+ EBookQuery *query;
if (strlen (query_text) < comp->priv->minimum_query_length) {
e_completion_end_search (E_COMPLETION (comp));
@@ -956,8 +960,8 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
g_free (comp->priv->query_text);
comp->priv->query_text = g_strdup (query_text);
- sexp = book_query_sexp (comp);
- if (sexp && *sexp) {
+ query = book_query_sexp (comp);
+ if (query) {
GList *l;
if (out)
@@ -1005,7 +1009,8 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
book_data->cached_query_text = g_strdup (query_text);
book_data->book_view_tag = e_book_async_get_book_view (book_data->book,
- sexp,
+ query,
+ NULL, -1,
e_select_names_completion_got_book_view_cb, book_data);
comp->priv->pending_completion_seq++;
}
@@ -1024,7 +1029,7 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
g_free (comp->priv->query_text);
comp->priv->query_text = NULL;
}
- g_free (sexp);
+ e_book_query_unref (query);
} else {
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index 409b1bce81..de0c7b4675 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -617,7 +617,8 @@ use_common_book_cb (EBook *book, gpointer closure)
GList *contact_email;
gchar *query_parts[MAX_QUERY_PARTS];
gint p=0;
- gchar *query, *qj;
+ gchar *qj;
+ EBookQuery *query = NULL;
int i;
if (book == NULL) {
@@ -669,18 +670,21 @@ use_common_book_cb (EBook *book, gpointer closure)
for(i = 0; query_parts[i] != NULL; i++)
g_free(query_parts[i]);
if (p > 0) {
- query = g_strdup_printf ("(or %s)", qj);
- g_free (qj);
+ char *s;
+ s = g_strdup_printf ("(or %s)", qj);
+ query = e_book_query_from_string (s);
+ g_free (s);
} else {
- query = qj;
+ query = e_book_query_from_string (qj);
}
- if (query && *query)
+ if (query)
e_book_async_get_contacts (book, query, query_cb, info);
else
query_cb (book, E_BOOK_ERROR_OK, NULL, info);
- g_free (query);
+ g_free (qj);
+ e_book_query_unref (query);
}
void
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 992b42b852..69a612234e 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -493,8 +493,6 @@ get_view (EABModel *model)
gboolean success;
if (model->book && model->query) {
- char *query_string = e_book_query_to_string (model->query);
-
remove_book_view(model);
free_data (model);
@@ -502,20 +500,18 @@ get_view (EABModel *model)
model->first_get_view = FALSE;
if (e_book_check_static_capability (model->book, "do-initial-query")) {
- success = e_book_async_get_book_view (model->book, query_string, book_view_loaded, model);
+ success = e_book_async_get_book_view (model->book, model->query, NULL, -1, book_view_loaded, model);
} else {
g_signal_emit (model,
eab_model_signals [MODEL_CHANGED], 0);
g_signal_emit (model,
eab_model_signals [STOP_STATE_CHANGED], 0);
- g_free (query_string);
return;
}
}
else
- success = e_book_async_get_book_view (model->book, query_string, book_view_loaded, model);
+ success = e_book_async_get_book_view (model->book, model->query, NULL, -1, book_view_loaded, model);
- g_free (query_string);
}
}