diff options
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 10 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-menu.c | 9 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 18 |
3 files changed, 27 insertions, 10 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 96c07822d..f805109d4 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -484,17 +484,19 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class) static void sync_bookmark_properties (GtkAction *action, EphyNode *bmk) { - const char *title, *location, *icon; + const char *tmp, *location, *icon; + char *title; gboolean smart_url; icon = ephy_node_get_property_string (bmk, EPHY_NODE_BMK_PROP_ICON); - title = ephy_node_get_property_string - (bmk, EPHY_NODE_BMK_PROP_TITLE); location = ephy_node_get_property_string (bmk, EPHY_NODE_BMK_PROP_LOCATION); smart_url = ephy_node_get_property_boolean (bmk, EPHY_NODE_BMK_PROP_HAS_SMART_ADDRESS); + tmp = ephy_node_get_property_string + (bmk, EPHY_NODE_BMK_PROP_TITLE); + title = ephy_string_double_underscores (tmp); g_object_set (action, "label", title, @@ -502,6 +504,8 @@ sync_bookmark_properties (GtkAction *action, EphyNode *bmk) "smarturl", smart_url, "icon", icon, NULL); + + g_free (title); } static void diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 6c1b2d86d..58d6c529a 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -24,6 +24,7 @@ #include "ephy-bookmark-action.h" #include "ephy-shell.h" #include "ephy-node-common.h" +#include "ephy-string.h" #include "ephy-debug.h" //#include <libxml/entities.h> @@ -296,13 +297,16 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu) for (l = node_list; l != NULL; l = l->next) { char verb[30], name[30], path[60]; - const char *title; + const char *tmp; + char *title; EphyNode *child; GtkAction *action; child = l->data; - title = ephy_node_get_property_string (child, EPHY_NODE_KEYWORD_PROP_NAME); + tmp = ephy_node_get_property_string (child, EPHY_NODE_KEYWORD_PROP_NAME); + title = ephy_string_double_underscores (tmp); + g_sprintf (verb, "OpenTopic%ld", ephy_node_get_id (child)); g_sprintf (name, "%sName", verb); g_sprintf (path, "%s/%s", BOOKMARKS_MENU_PATH, name); @@ -313,6 +317,7 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu) NULL); gtk_action_group_add_action (p->action_group, action); g_object_unref (action); + g_free (title); gtk_ui_manager_add_ui (p->merge, p->ui_id, BOOKMARKS_MENU_PATH, diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 6de5ce28f..9d2d049a0 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -459,18 +459,21 @@ create_menu_item (GtkAction *action) { GtkWidget *menu, *menu_item; GValue value = { 0, }; - const char *label_text; + const char *tmp; + char *label_text; g_value_init (&value, G_TYPE_STRING); g_object_get_property (G_OBJECT (action), "label", &value); - label_text = g_value_get_string (&value); + tmp = g_value_get_string (&value); + label_text = ephy_string_double_underscores (tmp); LOG ("create_menu_item action %p", action) menu_item = gtk_menu_item_new_with_label (label_text); g_value_unset (&value); + g_free (label_text); menu = build_menu (EPHY_TOPIC_ACTION (action)); gtk_widget_show (menu); @@ -608,7 +611,8 @@ ephy_topic_action_class_init (EphyTopicActionClass *class) static void sync_topic_properties (GtkAction *action, EphyNode *bmk) { - const char *title; + const char *tmp; + char *title; int priority; priority = ephy_node_get_property_int @@ -616,15 +620,19 @@ sync_topic_properties (GtkAction *action, EphyNode *bmk) if (priority == EPHY_NODE_ALL_PRIORITY) { - title = _("Bookmarks"); + tmp = _("Bookmarks"); } else { - title = ephy_node_get_property_string + tmp = ephy_node_get_property_string (bmk, EPHY_NODE_KEYWORD_PROP_NAME); } + title = ephy_string_double_underscores (tmp); + g_object_set (action, "label", title, NULL); + + g_free (title); } static void |