aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-25 20:42:06 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-25 20:42:06 +0800
commit0994e5f756dca8a0b4bb98da701132b733506a1b (patch)
tree412ec66a76ecfbb399b76904f76b183af01fa94f
parenta33d5f514695d3d487043397f3baf4f31cc92b73 (diff)
downloadgsoc2013-epiphany-0994e5f756dca8a0b4bb98da701132b733506a1b.tar.gz
gsoc2013-epiphany-0994e5f756dca8a0b4bb98da701132b733506a1b.tar.zst
gsoc2013-epiphany-0994e5f756dca8a0b4bb98da701132b733506a1b.zip
Unset the use-underline label property instead of doubling the
2004-10-25 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmark-action.c: (connect_proxy), (bookmark_changed_cb): * src/bookmarks/ephy-topic-action.c: (create_menu_item), (topic_changed_cb): Unset the use-underline label property instead of doubling the underscores. Saves tons of strdups.
-rw-r--r--ChangeLog10
-rw-r--r--src/bookmarks/ephy-bookmark-action.c12
-rw-r--r--src/bookmarks/ephy-topic-action.c22
3 files changed, 24 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 8dbf981d6..c34756c82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2004-10-25 Christian Persch <chpe@cvs.gnome.org>
+ * src/bookmarks/ephy-bookmark-action.c: (connect_proxy),
+ (bookmark_changed_cb):
+ * src/bookmarks/ephy-topic-action.c: (create_menu_item),
+ (topic_changed_cb):
+
+ Unset the use-underline label property instead of doubling the
+ underscores. Saves tons of strdups.
+
+2004-10-25 Christian Persch <chpe@cvs.gnome.org>
+
* embed/downloader-view.c: (downloader_view_add_download):
* lib/widgets/ephy-spinner.c: (ephy_spinner_cache_get_images),
(ephy_spinner_size_request):
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 14de49a99..25432d755 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -703,6 +703,10 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
}
else if (GTK_IS_MENU_ITEM (proxy))
{
+ GtkLabel *label;
+
+ label = (GtkLabel *) ((GtkBin *) proxy)->child;
+ gtk_label_set_use_underline (label, FALSE);
g_signal_connect (proxy, "activate", G_CALLBACK (activate_cb), action);
}
}
@@ -715,14 +719,12 @@ bookmark_changed_cb (EphyNode *node,
if (property_id == EPHY_NODE_BMK_PROP_TITLE)
{
GValue value = { 0, };
- const char *tmp;
- char *title, *short_title;
+ const char *title;
+ char *short_title;
- tmp = ephy_node_get_property_string
+ title = ephy_node_get_property_string
(action->priv->node, EPHY_NODE_BMK_PROP_TITLE);
- title = ephy_string_double_underscores (tmp);
short_title = ephy_string_shorten (title, MAX_LABEL_LENGTH);
- g_free (title);
g_value_init (&value, G_TYPE_STRING);
g_value_take_string (&value, short_title);
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index f8efa869e..aaac2b38c 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -690,21 +690,16 @@ create_menu_item (GtkAction *action)
{
GtkWidget *menu, *menu_item;
GValue value = { 0, };
- const char *tmp;
- char *label_text;
+ const char *title;
g_value_init (&value, G_TYPE_STRING);
g_object_get_property (G_OBJECT (action), "label", &value);
- tmp = g_value_get_string (&value);
- label_text = ephy_string_double_underscores (tmp);
+ title = g_value_get_string (&value);
- LOG ("create_menu_item action %p", action)
-
- menu_item = gtk_menu_item_new_with_label (label_text);
+ menu_item = gtk_menu_item_new_with_label (title);
g_value_unset (&value);
- g_free (label_text);
menu = build_menu (EPHY_TOPIC_ACTION (action));
gtk_widget_show (menu);
@@ -871,8 +866,7 @@ topic_changed_cb (EphyNode *node,
if (property_id == EPHY_NODE_KEYWORD_PROP_NAME)
{
GValue value = { 0, };
- const char *tmp;
- char *title;
+ const char *title;
int priority;
priority = ephy_node_get_property_int
@@ -880,18 +874,16 @@ topic_changed_cb (EphyNode *node,
if (priority == EPHY_NODE_ALL_PRIORITY)
{
- tmp = _("Bookmarks");
+ title = _("Bookmarks");
}
else
{
- tmp = ephy_node_get_property_string
+ title = ephy_node_get_property_string
(node, EPHY_NODE_KEYWORD_PROP_NAME);
}
- title = ephy_string_double_underscores (tmp);
-
g_value_init(&value, G_TYPE_STRING);
- g_value_take_string (&value, title);
+ g_value_set_string (&value, title);
g_object_set_property (G_OBJECT (action), "label", &value);
g_value_unset (&value);
}