aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-08-15 01:55:12 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-08-15 01:55:12 +0800
commite881e3acc10b2690267ae2021d9bff2d1ef1a11b (patch)
treefc19769d98cb280cac6ab13d6a630c185f6fe6ad
parent84eb55399b9ac31c9b213316cf6cfff3df3a07f1 (diff)
downloadgsoc2013-evolution-e881e3acc10b2690267ae2021d9bff2d1ef1a11b.tar.gz
gsoc2013-evolution-e881e3acc10b2690267ae2021d9bff2d1ef1a11b.tar.zst
gsoc2013-evolution-e881e3acc10b2690267ae2021d9bff2d1ef1a11b.zip
Make the "Any Category" item consistent with the one in the addressbook.
2001-08-14 Federico Mena Quintero <federico@ximian.com> * gui/cal-search-bar.c (make_suboptions): Make the "Any Category" item consistent with the one in the addressbook. Also, free the items correctly. svn path=/trunk/; revision=12020
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gui/cal-search-bar.c15
2 files changed, 15 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 14b34f4a48..c258bfe192 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,11 @@
2001-08-14 Federico Mena Quintero <federico@ximian.com>
+ * gui/cal-search-bar.c (make_suboptions): Make the "Any Category"
+ item consistent with the one in the addressbook. Also, free the
+ items correctly.
+
+2001-08-14 Federico Mena Quintero <federico@ximian.com>
+
* gui/cal-search-bar.c (get_current_category): Handle an array of
categories in the CalSearchBar instead of our own menu items.
(notify_query_contains): Fetch the text from the search bar here
diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c
index 4c0937097f..b6fde4e6f4 100644
--- a/calendar/gui/cal-search-bar.c
+++ b/calendar/gui/cal-search-bar.c
@@ -63,7 +63,7 @@ static ESearchBarItem search_option_items[] = {
/* IDs for the categories suboptions */
#define CATEGORIES_ALL 0
#define CATEGORIES_UNMATCHED 1
-#define CATEGORIES_OFFSET 2
+#define CATEGORIES_OFFSET 3
/* Private part of the CalSearchBar structure */
struct CalSearchBarPrivate {
@@ -409,7 +409,7 @@ make_suboptions (CalSearchBar *cal_search)
/* All, unmatched, separator */
- subitems[0].text = _("Any");
+ subitems[0].text = _("Any Category");
subitems[0].id = CATEGORIES_ALL;
subitems[0].translate = FALSE;
@@ -417,12 +417,12 @@ make_suboptions (CalSearchBar *cal_search)
subitems[1].id = CATEGORIES_UNMATCHED;
subitems[1].translate = FALSE;
+ /* All the other items */
+
if (priv->categories->len > 0) {
subitems[2].text = NULL; /* separator */
subitems[2].id = 0;
- /* All the other items */
-
for (i = 0; i < priv->categories->len; i++) {
const char *category;
char *str;
@@ -435,8 +435,6 @@ make_suboptions (CalSearchBar *cal_search)
subitems[i + CATEGORIES_OFFSET].text = str;
subitems[i + CATEGORIES_OFFSET].id = i + CATEGORIES_OFFSET;
subitems[i + CATEGORIES_OFFSET].translate = FALSE;
-
- g_free (str);
}
subitems[i + CATEGORIES_OFFSET].id = -1; /* terminator */
@@ -444,6 +442,11 @@ make_suboptions (CalSearchBar *cal_search)
subitems[2].id = -1; /* terminator */
e_search_bar_set_suboption (E_SEARCH_BAR (cal_search), SEARCH_CATEGORY_IS, subitems);
+
+ /* Free the strings */
+ for (i = 0; i < priv->categories->len; i++)
+ g_free (subitems[i + CATEGORIES_OFFSET].text);
+
g_free (subitems);
}