From 927100b2cb4b488d2581d63f764b74db976db69c Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 10 Feb 2006 22:49:29 +0000 Subject: Remove *_action_name functions, and use static buffers instead. Minor 2006-02-10 Christian Persch * src/bookmarks/ephy-bookmark-action-group.c: (smart_added_cb), (smart_removed_cb), (node_changed_cb), (node_added_cb), (node_removed_cb): * src/bookmarks/ephy-bookmark-action.c: (ephy_bookmark_action_new): * src/bookmarks/ephy-bookmark-action.h: * src/bookmarks/ephy-bookmark-factory-action.c: (build_menu_for_topic): * src/bookmarks/ephy-bookmarks-editor.c: (cmd_toolbar), (ephy_bookmarks_editor_update_menu): * src/bookmarks/ephy-bookmarks-menu.c: (append_bookmarks), (append_menu), (ephy_bookmarks_menu_build): * src/bookmarks/ephy-bookmarks-ui.c: (ephy_bookmarks_ui_attach_window), (topic_has_data), (topic_get_data), (topic_get_name), (bookmark_has_data), (bookmark_get_data), (bookmark_get_name), (bookmark_new_name), (toolbar_node_removed_cb): * src/bookmarks/ephy-bookmarks-ui.h: * src/bookmarks/ephy-open-tabs-action.c: (node_added_cb), (node_removed_cb), (ephy_open_tabs_group_new): * src/bookmarks/ephy-open-tabs-action.h: * src/bookmarks/ephy-topic-action-group.c: (node_changed_cb), (node_added_cb), (node_removed_cb), (ephy_topic_action_group_new): * src/bookmarks/ephy-topic-action-group.h: * src/bookmarks/ephy-topic-action.c: (ephy_topic_action_new): * src/bookmarks/ephy-topic-action.h: * src/bookmarks/ephy-topic-factory-action.c: (build_menu): Remove *_action_name functions, and use static buffers instead. Minor cleanups. --- src/bookmarks/ephy-bookmarks-menu.c | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/bookmarks/ephy-bookmarks-menu.c') diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index bf1673925..db19cf01c 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -51,20 +51,23 @@ enum /* Construct a block of bookmark actions, postfixing the names with a topic id * to allow different. */ static void -append_bookmarks (GString *string, const GPtrArray *bookmarks, gint instance) +append_bookmarks (GString *string, + const GPtrArray *bookmarks, + int instance) { - char *name; + EphyNode *child; + char name[EPHY_BOOKMARK_ACTION_NAME_BUFFER_SIZE]; + long i; for (i = 0; i < bookmarks->len; i++) { - name = ephy_bookmark_action_name (g_ptr_array_index (bookmarks, i)); - if (name) - { - g_string_append_printf (string, "", - name, name, instance); - g_free (name); - } + child = g_ptr_array_index (bookmarks, i); + + EPHY_BOOKMARK_ACTION_NAME_PRINTF (name, child); + + g_string_append_printf (string, "", + name, name, instance); } } @@ -86,7 +89,7 @@ append_menu (GString *string, const GPtrArray *topics, const GPtrArray *bookmark EphyNode *topic; gint size, total; gboolean separate = FALSE; - char *name; + char name[EPHY_TOPIC_ACTION_NAME_BUFFER_SIZE]; /* Get the subtopics, uncovered bookmarks, and subtopic sizes. */ sizes = g_array_sized_new (FALSE, FALSE, sizeof(int), topics->len); @@ -133,17 +136,14 @@ append_menu (GString *string, const GPtrArray *topics, const GPtrArray *bookmark { topic = g_ptr_array_index (submenus, i); ephy_nodes_get_covered (topic, bookmarks, subset); - - name = ephy_topic_action_name (topic); - if (name) - { - g_string_append_printf (string, "", - name, name); - append_menu (string, topics, subset, flags); - g_string_append (string, ""); - separate = TRUE; - g_free (name); - } + + EPHY_TOPIC_ACTION_NAME_PRINTF (name, topic); + + g_string_append_printf (string, "", + name, name); + append_menu (string, topics, subset, flags); + g_string_append (string, ""); + separate = TRUE; } /* Build a list of bookmarks which don't appear in any subdivision yet. */ @@ -252,17 +252,17 @@ ephy_bookmarks_menu_build (GString *string, EphyNode *parent) /* Otherwise, build the menu with "Open in tabs". */ else { - char *name; + char name[EPHY_OPEN_TABS_ACTION_NAME_BUFFER_SIZE]; append_menu (string, topics, children, flags); g_ptr_array_free (topics, TRUE); if (children->len > 1) { - name = ephy_open_tabs_action_name (node); + EPHY_OPEN_TABS_ACTION_NAME_PRINTF (name, node); + g_string_append_printf - (string, "", name); - g_free (name); + (string, "", name); } } } -- cgit v1.2.3