evolution r36830 - in trunk/addressbook: . gui/widgets
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36830 - in trunk/addressbook: . gui/widgets
- Date: Thu, 4 Dec 2008 11:06:37 +0000 (UTC)
Author: mcrha
Date: Thu Dec 4 11:06:37 2008
New Revision: 36830
URL: http://svn.gnome.org/viewvc/evolution?rev=36830&view=rev
Log:
2008-12-04 Milan Crha <mcrha redhat com>
** Fix for bug #263268
* gui/widgets/e-addressbook-view.c: (search_activated),
(make_suboptions): Be able to search for contacts without category.
Modified:
trunk/addressbook/ChangeLog
trunk/addressbook/gui/widgets/e-addressbook-view.c
Modified: trunk/addressbook/gui/widgets/e-addressbook-view.c
==============================================================================
--- trunk/addressbook/gui/widgets/e-addressbook-view.c (original)
+++ trunk/addressbook/gui/widgets/e-addressbook-view.c Thu Dec 4 11:06:37 2008
@@ -1403,8 +1403,12 @@
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 @@
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; i<N; ++i) {
const char *category = g_list_nth_data (master_list, i);
- subitems[i+1].search.id = i+1;
- subitems[i+1].search.text = g_strdup (category);
- subitems[i+1].image = (char *)e_categories_get_icon_file_for (category);
+ subitems[i+3].search.id = i+3;
+ subitems[i+3].search.text = g_strdup (category);
+ subitems[i+3].image = (char *)e_categories_get_icon_file_for (category);
}
- subitems[N+1].search.id = -1;
- subitems[N+1].search.text = NULL;
- subitems[N+1].image = NULL;
+ subitems[N+3].search.id = -1;
+ subitems[N+3].search.text = NULL;
+ subitems[N+3].image = NULL;
- qsort (subitems + 1, N, sizeof (subitems[0]), compare_subitems);
+ qsort (subitems + 3, N, sizeof (subitems[0]), compare_subitems);
menu = generate_viewoption_menu (subitems);
e_search_bar_set_viewoption_menu ((ESearchBar *)view->search, menu);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]