From a3b8881d09c0a6854b12551dcee89c87c28739fe Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 4 Dec 2008 11:06:37 +0000 Subject: ** Fix for bug #263268 2008-12-04 Milan Crha ** Fix for bug #263268 * gui/widgets/e-addressbook-view.c: (search_activated), (make_suboptions): Be able to search for contacts without category. svn path=/trunk/; revision=36830 --- addressbook/ChangeLog | 7 ++++++ addressbook/gui/widgets/e-addressbook-view.c | 32 +++++++++++++++++++--------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index bb0cdeb755..0465a19384 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2008-12-04 Milan Crha + + ** Fix for bug #263268 + + * gui/widgets/e-addressbook-view.c: (search_activated), + (make_suboptions): Be able to search for contacts without category. + 2008-12-02 Matthew Barnes ** Fixes part of bug #348299 diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index cda3922a87..cc5558324e 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1403,8 +1403,12 @@ search_activated (ESearchBar *esb, EABView *v) if (subid) { master_list = get_master_list (FALSE); - category_name = g_list_nth_data (master_list, subid-1); - view_sexp = g_strdup_printf ("(is \"category_list\" \"%s\")", category_name); + if (subid < 3) { + view_sexp = g_strdup ("(not (and (exists \"CATEGORIES\") (not (is \"CATEGORIES\" \"\"))))"); + } else { + category_name = g_list_nth_data (master_list, subid-3); + view_sexp = g_strdup_printf ("(is \"category_list\" \"%s\")", category_name); + } search_query = g_strconcat ("(and ", view_sexp, search_query, ")", NULL); g_free (view_sexp); } @@ -1518,24 +1522,32 @@ make_suboptions (EABView *view) master_list = get_master_list (FALSE); N = g_list_length (master_list); - subitems = g_new (EABSearchBarItem, N+2); + subitems = g_new (EABSearchBarItem, N+4); subitems[0].search.id = 0; subitems[0].search.text = g_strdup (_("Any Category")); subitems[0].image = NULL; + subitems[1].search.text = g_strdup (_("Unmatched")); + subitems[1].search.id = 1; + subitems[1].image = NULL; + + subitems[2].search.text = NULL; + subitems[2].search.id = 0; + subitems[2].image = NULL; + for (i=0; isearch, menu); -- cgit v1.2.3