From b476b5573e56fb9da9bc7730d920f18b5a771ab1 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 21 Jan 2004 02:19:19 +0000 Subject: [ fixes bug #52955 ] handle the case properly where there are no query 2004-01-20 Chris Toshok [ fixes bug #52955 ] * gui/merging/eab-contact-compare.c (use_common_book_cb): handle the case properly where there are no query parts (p == 0). Instead of passing "" to e_book_query_from_string, just set the query to NULL. * util/eab-book-util.c (eab_contact_list_to_string): we need to put a blank line here, so \r\n\r\n, not just \r\n. svn path=/trunk/; revision=24340 --- addressbook/ChangeLog | 11 +++++++++++ addressbook/gui/merging/eab-contact-compare.c | 11 ++++++++--- addressbook/util/eab-book-util.c | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index cf39251cb5..d041e6b7e8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2004-01-20 Chris Toshok + + [ fixes bug #52955 ] + * gui/merging/eab-contact-compare.c (use_common_book_cb): handle + the case properly where there are no query parts (p == 0). + Instead of passing "" to e_book_query_from_string, just set the + query to NULL. + + * util/eab-book-util.c (eab_contact_list_to_string): we need to + put a blank line here, so \r\n\r\n, not just \r\n. + 2004-01-20 Chris Toshok * gui/component/addressbook-migrate.c (create_groups): deal with diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index de0c7b4675..ec80f12639 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -669,14 +669,18 @@ use_common_book_cb (EBook *book, gpointer closure) qj = g_strjoinv (" ", query_parts); for(i = 0; query_parts[i] != NULL; i++) g_free(query_parts[i]); - if (p > 0) { + if (p > 1) { char *s; s = g_strdup_printf ("(or %s)", qj); query = e_book_query_from_string (s); g_free (s); - } else { + } + else if (p == 1) { query = e_book_query_from_string (qj); } + else { + query = NULL; + } if (query) e_book_async_get_contacts (book, query, query_cb, info); @@ -684,7 +688,8 @@ use_common_book_cb (EBook *book, gpointer closure) query_cb (book, E_BOOK_ERROR_OK, NULL, info); g_free (qj); - e_book_query_unref (query); + if (query) + e_book_query_unref (query); } void diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c index 2c80d6f8a1..611944b22d 100644 --- a/addressbook/util/eab-book-util.c +++ b/addressbook/util/eab-book-util.c @@ -200,7 +200,7 @@ eab_contact_list_to_string (GList *contacts) g_string_append (str, vcard_str); if (l->next) - g_string_append (str, "\r\n"); + g_string_append (str, "\r\n\r\n"); } return g_string_free (str, FALSE); -- cgit v1.2.3