aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c29
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gui/cal-search-bar.c35
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-util.c33
-rw-r--r--e-util/e-util.h1
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-folder-browser.c33
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-search-bar.c34
11 files changed, 81 insertions, 116 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 932c016cdd..9d9d0bd9d7 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,11 @@
2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+ ** Fix for bug #448223 from Gilles Dartiguelongue
+
+ * gui/widgets/e-addressbook-view.c: (generate_viewoption_menu):
+
+2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+
** Fix for bug #445812 from Gilles Dartiguelongue
* gui/widgets/eab-contact-display.c:
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 3174e5f21f..33042013c3 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -43,6 +43,7 @@
#include "a11y/addressbook/ea-addressbook.h"
#include "e-util/e-print.h"
+#include "e-util/e-util.h"
#include "libedataserver/e-sexp.h"
#include <libedataserver/e-categories.h>
@@ -1586,32 +1587,6 @@ compare_subitems (const void *a, const void *b)
return ret;
}
-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 (EABSearchBarItem *subitems)
{
@@ -1623,7 +1598,7 @@ generate_viewoption_menu (EABSearchBarItem *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)); */
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 03552d6f68..ba7fdfcc0e 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #448223 from Gilles Dartiguelongue
+
+ * gui/cal-search-bar.c: (generate_viewoption_menu):
+
2007-06-11 Milan Crha <mcrha@redhat.com>
** Fix for bug #325882
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));*/
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index fc5751421a..c12d6c07e5 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #448223 from Gilles Dartiguelongue
+
+ * e-util.c: (e_str_without_underscores):
+ * e-util.h:
+
2007-06-15 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #446870
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 4cfc5988b2..716c02e8bd 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -49,6 +49,39 @@
#include "e-util.h"
#include "e-util-private.h"
+/**
+ * e_str_without_underscores:
+ * @s: the string to strip underscores from.
+ *
+ * Strips underscores from a string in the same way @gtk_label_new_with_mnemonis does.
+ * The returned string should be freed.
+ */
+char *
+e_str_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;
+}
+
gint
e_str_compare (gconstpointer x, gconstpointer y)
{
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 1d4307dab4..2cbae35cb8 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -68,6 +68,7 @@ typedef enum {
E_FOCUS_END
} EFocus;
+char * e_str_without_underscores (const char *s);
gint e_str_compare (gconstpointer x,
gconstpointer y);
gint e_str_case_compare (gconstpointer x,
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 07eca6c462..92f9c2f778 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,4 +1,10 @@
2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #448223 from Gilles Dartiguelongue
+
+ * em-folder-browser.c: (generate_viewoption_menu):
+
+2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #445812 from Gilles Dartiguelongue
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index f560e150d6..b25e92bb75 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -78,6 +78,7 @@
#include <camel/camel-store.h>
#include "e-util/e-dialog-utils.h"
+#include "e-util/e-util.h"
#include "e-util/e-error.h"
#include "e-util/e-util-private.h"
#include "em-utils.h"
@@ -258,32 +259,6 @@ free_one_ui_file (gpointer data,
g_free (data);
}
-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 (GtkWidget *emfv)
{
@@ -296,7 +271,7 @@ generate_viewoption_menu (GtkWidget *emfv)
for (i = 0; emfb_view_items[i].search.id != -1; ++i) {
if (emfb_view_items[i].search.text) {
char *str;
- str = string_without_underscores (_(emfb_view_items[i].search.text));
+ str = e_str_without_underscores (_(emfb_view_items[i].search.text));
menu_item = gtk_image_menu_item_new_with_label (str);
if (emfb_view_items[i].image)
gtk_image_menu_item_set_image ((GtkImageMenuItem *)menu_item, e_icon_factory_get_image (emfb_view_items[i].image, E_ICON_SIZE_MENU));
@@ -333,7 +308,7 @@ generate_viewoption_menu (GtkWidget *emfv)
g_object_unref(gc);
image = gtk_image_new_from_pixmap(pixmap, NULL);
- str = string_without_underscores (label->name);
+ str = e_str_without_underscores (label->name);
menu_item = gtk_image_menu_item_new_with_label (str);
g_free (str);
gtk_image_menu_item_set_image ((GtkImageMenuItem *)menu_item, image);
@@ -351,7 +326,7 @@ generate_viewoption_menu (GtkWidget *emfv)
for (i = 0; temp_view_items[i].search.id != -1; ++i) {
if (temp_view_items[i].search.text) {
char *str;
- str = string_without_underscores (_(temp_view_items[i].search.text));
+ str = e_str_without_underscores (_(temp_view_items[i].search.text));
menu_item = gtk_image_menu_item_new_with_label (str);
if (temp_view_items[i].image)
gtk_image_menu_item_set_image ((GtkImageMenuItem *)menu_item, e_icon_factory_get_image (temp_view_items[i].image, E_ICON_SIZE_MENU));
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index b1c18f534a..363db5cd05 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-18 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #448223 from Gilles Dartiguelongue
+
+ * e-search-bar.c: (set_option), (e_search_bar_set_viewoption),
+ (e_search_bar_set_scopeoption):
+
2007-06-15 Milan Crha <mcrha@redhat.com>
** Fix for bug #257118
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 81f1e36fda..4b8d459911 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -52,8 +52,10 @@
#include "e-icon-entry.h"
#include "e-search-bar.h"
+#include "e-util/e-util.h"
#include "e-util/e-util-marshal.h"
#include "e-util/e-icon-factory.h"
+
enum {
QUERY_CHANGED,
@@ -452,32 +454,6 @@ scopeitem_activated_cb(GtkWidget *widget, ESearchBar *esb)
esb->block_search = FALSE;
}
-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 void
option_activated_cb (GtkWidget *widget,
ESearchBar *esb)
@@ -722,7 +698,7 @@ set_option (ESearchBar *esb, ESearchBarItem *items)
if (items[i].text) {
char *str;
- str = string_without_underscores (_(items[i].text));
+ str = e_str_without_underscores (_(items[i].text));
switch (items[i].type) {
case ESB_ITEMTYPE_NORMAL:
item = gtk_menu_item_new_with_label (str);
@@ -1180,7 +1156,7 @@ e_search_bar_set_viewoption (ESearchBar *search_bar, int option_id, ESearchBarIt
for (i = 0; subitems[i].id != -1; ++i) {
if (subitems[i].text) {
char *str = NULL;
- str = string_without_underscores (subitems[i].text);
+ str = e_str_without_underscores (subitems[i].text);
menu_item = gtk_menu_item_new_with_label (str);
g_free (str);
} else {
@@ -1229,7 +1205,7 @@ e_search_bar_set_scopeoption (ESearchBar *search_bar, ESearchBarItem *scopeitems
for (i = 0; scopeitems[i].id != -1; ++i) {
if (scopeitems[i].text) {
char *str;
- str = string_without_underscores (_(scopeitems[i].text));
+ str = e_str_without_underscores (_(scopeitems[i].text));
menu_item = gtk_menu_item_new_with_label (str);
g_object_set_data_full (G_OBJECT (menu_item), "string",str, g_free);
} else {