diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/cal-search-bar.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c index 75e0d819ad..fb11626789 100644 --- a/calendar/gui/cal-search-bar.c +++ b/calendar/gui/cal-search-bar.c @@ -35,11 +35,13 @@ #include <e-util/e-icon-factory.h> #include <libedataserver/e-categories.h> #include <filter/rule-editor.h> + #include "cal-search-bar.h" + +#include "e-util/e-util.h" #include "e-util/e-error.h" #include "e-util/e-util-private.h" - typedef struct CALSearchBarItem { ESearchBarItem search; const char *image; @@ -532,35 +534,6 @@ cal_search_bar_search_activated (ESearchBar *search) regen_query (cal_search); } - - - -static char * -string_without_underscores (const char *s) -{ - char *new_string; - const char *sp; - char *dp; - - new_string = g_malloc (strlen (s) + 1); - - dp = new_string; - for (sp = s; *sp != '\0'; sp ++) { - if (*sp != '_') { - *dp = *sp; - dp ++; - } else if (sp[1] == '_') { - /* Translate "__" in "_". */ - *dp = '_'; - dp ++; - sp ++; - } - } - *dp = 0; - - return new_string; -} - static GtkWidget * generate_viewoption_menu (CALSearchBarItem *subitems) { @@ -572,7 +545,7 @@ generate_viewoption_menu (CALSearchBarItem *subitems) for (i = 0; subitems[i].search.id != -1; ++i) { if (subitems[i].search.text) { char *str = NULL; - str = string_without_underscores (subitems[i].search.text); + str = e_str_without_underscores (subitems[i].search.text); menu_item = gtk_image_menu_item_new_with_label (str); /* if (subitems[i].image) gtk_image_menu_item_set_image (menu_item, e_icon_factory_get_image (subitems[i].image, E_ICON_SIZE_MENU));*/ |