[evolution-patches] Addressbook ebook_async changes patch
- From: Ross Burton <ross burtonini com>
- To: evolution-patches lists ximian com
- Cc: Chris Toshok <toshok ximian com>
- Subject: [evolution-patches] Addressbook ebook_async changes patch
- Date: Thu, 01 Jan 2004 17:14:23 +0000
Hi,
Attached is a patch to fix the compilation of the addressbook when the
e_book_async patches I mailed earlier are applied.
Regards,
Ross
--
Ross Burton mail: ross burtonini com
jabber: ross burtonini com
www: http://www.burtonini.com./
PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Index: addressbook/gui/component/select-names/e-select-names-completion.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/select-names/e-select-names-completion.c,v
retrieving revision 1.65
diff -u -r1.65 e-select-names-completion.c
--- addressbook/gui/component/select-names/e-select-names-completion.c 7 Nov 2003 05:51:32 -0000 1.65
+++ addressbook/gui/component/select-names/e-select-names-completion.c 1 Jan 2004 16:31:51 -0000
@@ -465,11 +465,12 @@
/*
* 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 @@
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_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 @@
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 @@
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 @@
g_free (comp->priv->query_text);
comp->priv->query_text = NULL;
}
- g_free (sexp);
+ e_book_query_unref (query);
} else {
Index: addressbook/gui/merging/eab-contact-compare.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/merging/eab-contact-compare.c,v
retrieving revision 1.2
diff -u -r1.2 eab-contact-compare.c
--- addressbook/gui/merging/eab-contact-compare.c 21 Oct 2003 18:48:52 -0000 1.2
+++ addressbook/gui/merging/eab-contact-compare.c 1 Jan 2004 16:31:52 -0000
@@ -617,7 +617,8 @@
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 @@
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
Index: addressbook/gui/widgets/e-addressbook-model.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-addressbook-model.c,v
retrieving revision 1.57
diff -u -r1.57 e-addressbook-model.c
--- addressbook/gui/widgets/e-addressbook-model.c 5 Dec 2003 18:30:58 -0000 1.57
+++ addressbook/gui/widgets/e-addressbook-model.c 1 Jan 2004 16:31:52 -0000
@@ -493,8 +493,6 @@
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 @@
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);
}
}
Index: addressbook/gui/widgets/eab-gui-util.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/eab-gui-util.c,v
retrieving revision 1.4
diff -u -r1.4 eab-gui-util.c
--- addressbook/gui/widgets/eab-gui-util.c 3 Dec 2003 15:38:29 -0000 1.4
+++ addressbook/gui/widgets/eab-gui-util.c 1 Jan 2004 16:31:52 -0000
@@ -136,7 +136,9 @@
gboolean editable)
{
EContactEditor *ce;
-
+ g_return_val_if_fail (book != NULL, NULL);
+ g_return_val_if_fail (contact != NULL, NULL);
+
ce = e_contact_editor_new (book, contact, is_new_contact, editable);
g_signal_connect (ce, "contact_added",
Index: addressbook/printing/e-contact-print.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/printing/e-contact-print.c,v
retrieving revision 1.40
diff -u -r1.40 e-contact-print.c
--- addressbook/printing/e-contact-print.c 7 Nov 2003 05:51:42 -0000 1.40
+++ addressbook/printing/e-contact-print.c 1 Jan 2004 16:31:52 -0000
@@ -67,7 +67,7 @@
gboolean uses_book;
int type;
EBook *book;
- gchar *query;
+ EBookQuery *query;
GList *contacts;
};
@@ -589,7 +589,7 @@
g_object_unref(ctxt->master);
if (ctxt->book)
g_object_unref(ctxt->book);
- g_free(ctxt->query);
+ e_book_query_unref (ctxt->query);
g_list_foreach(ctxt->contacts, (GFunc) g_object_unref, NULL);
g_list_free(ctxt->contacts);
g_object_unref(ctxt->style->headings_font);
@@ -651,13 +651,13 @@
}
static void
-e_contact_do_print_contacts (EBook *book, char *query, EContactPrintContext *ctxt)
+e_contact_do_print_contacts (EBook *book, EBookQuery *query, EContactPrintContext *ctxt)
{
- e_book_async_get_book_view(book, query, (EBookBookViewCallback) book_view_loaded, ctxt);
+ e_book_async_get_book_view(book, query, NULL, -1, (EBookBookViewCallback) book_view_loaded, ctxt);
}
static void
-e_contact_do_print (EBook *book, char *query, EContactPrintContext *ctxt)
+e_contact_do_print (EBook *book, EBookQuery *query, EContactPrintContext *ctxt)
{
switch ( ctxt->style->type ) {
case E_CONTACT_PRINT_TYPE_CARDS:
@@ -871,7 +871,7 @@
gboolean uses_book = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "uses_book"));
gboolean uses_list = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "uses_list"));
EBook *book = NULL;
- char *query = NULL;
+ EBookQuery *query = NULL;
EContact *contact = NULL;
GList *contact_list = NULL;
gdouble font_size;
@@ -880,6 +880,7 @@
if (uses_book) {
book = g_object_get_data(G_OBJECT(dialog), "book");
query = g_object_get_data(G_OBJECT(dialog), "query");
+ e_book_query_ref (query);
}
else if (uses_list) {
contact_list = g_object_get_data(G_OBJECT(dialog), "contact_list");
@@ -962,7 +963,7 @@
72 * style->page_height));
#endif
ctxt->book = book;
- ctxt->query = g_strdup(query);
+ ctxt->query = query;
if (uses_book) {
ctxt->contacts = NULL;
g_object_ref(book);
@@ -986,7 +987,7 @@
e_free_object_list (contact_list);
else
g_object_unref(contact);
- g_free(query);
+ e_book_query_unref (query);
gtk_widget_destroy (dialog);
g_free(style);
g_free(ctxt);
@@ -1008,7 +1009,7 @@
g_object_set_data(G_OBJECT(dialog), "uses_book", GINT_TO_POINTER (TRUE));
g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (FALSE));
g_object_set_data(G_OBJECT(dialog), "book", book);
- g_object_set_data(G_OBJECT(dialog), "query", g_strdup(query));
+ g_object_set_data(G_OBJECT(dialog), "query", e_book_query_from_string (query));
g_signal_connect(dialog,
"response", G_CALLBACK(e_contact_print_response), NULL);
g_signal_connect(dialog,
@@ -1055,7 +1056,7 @@
72 * style->page_height));
#endif
ctxt->book = book;
- ctxt->query = g_strdup(query);
+ ctxt->query = e_book_query_from_string (query);
ctxt->contacts = NULL;
g_object_ref(book);
e_contact_do_print(book, ctxt->query, ctxt);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]