From c2031745964bc6d65d61099cf2cacd768930fb39 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 31 Oct 2005 21:38:28 +0000 Subject: Constification. 2005-10-31 Christian Persch * lib/ephy-dbus.c: * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_init_defaults): Constification. --- src/bookmarks/ephy-bookmarks-editor.c | 26 ++++++++++---------------- src/bookmarks/ephy-bookmarks.c | 6 ++---- 2 files changed, 12 insertions(+), 20 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 7608823a6..998ee15c1 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -67,26 +67,22 @@ #include "ephy-debug.h" #include "egg-toolbars-model.h" -static GtkTargetEntry topic_drag_dest_types [] = +static const GtkTargetEntry topic_drag_dest_types [] = { { EPHY_DND_URI_LIST_TYPE, 0, 0 } }; -static int n_topic_drag_dest_types = G_N_ELEMENTS (topic_drag_dest_types); - -static GtkTargetEntry bmk_drag_types [] = +static const GtkTargetEntry bmk_drag_types [] = { { EPHY_DND_URL_TYPE, 0, 0 }, { EPHY_DND_URI_LIST_TYPE, 0, 1 }, { EPHY_DND_TEXT_TYPE, 0, 2 } }; -static int n_bmk_drag_types = G_N_ELEMENTS (bmk_drag_types); -static GtkTargetEntry topic_drag_types [] = +static const GtkTargetEntry topic_drag_types [] = { { EPHY_DND_TOPIC_TYPE, 0, 0 } }; -static int n_topic_drag_types = G_N_ELEMENTS (topic_drag_types); static void ephy_bookmarks_editor_class_init (EphyBookmarksEditorClass *klass); static void ephy_bookmarks_editor_init (EphyBookmarksEditor *editor); @@ -162,7 +158,7 @@ enum static GObjectClass *parent_class = NULL; -static GtkActionEntry ephy_bookmark_popup_entries [] = { +static const GtkActionEntry ephy_bookmark_popup_entries [] = { /* Toplevel */ { "File", NULL, N_("_File") }, { "Edit", NULL, N_("_Edit") }, @@ -220,7 +216,6 @@ static GtkActionEntry ephy_bookmark_popup_entries [] = { N_("Display credits for the web browser creators"), G_CALLBACK (window_cmd_help_about) }, }; -static guint ephy_bookmark_popup_n_entries = G_N_ELEMENTS (ephy_bookmark_popup_entries); enum { @@ -228,7 +223,7 @@ enum VIEW_TITLE_AND_ADDRESS }; -static GtkRadioActionEntry ephy_bookmark_radio_entries [] = +static const GtkRadioActionEntry ephy_bookmark_radio_entries [] = { /* View Menu */ { "ViewTitle", NULL, N_("_Title"), NULL, @@ -237,7 +232,6 @@ static GtkRadioActionEntry ephy_bookmark_radio_entries [] = N_("Show both the title and address columns"), VIEW_TITLE_AND_ADDRESS } }; -static guint ephy_bookmark_n_radio_entries = G_N_ELEMENTS (ephy_bookmark_radio_entries); static void entry_selection_changed_cb (GtkWidget *widget, GParamSpec *pspec, EphyBookmarksEditor *editor) @@ -1553,12 +1547,12 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) action_group = gtk_action_group_new ("PopupActions"); gtk_action_group_set_translation_domain (action_group, NULL); gtk_action_group_add_actions (action_group, ephy_bookmark_popup_entries, - ephy_bookmark_popup_n_entries, editor); + G_N_ELEMENTS (ephy_bookmark_popup_entries), editor); details_value = get_details_value (editor); gtk_action_group_add_radio_actions (action_group, ephy_bookmark_radio_entries, - ephy_bookmark_n_radio_entries, + G_N_ELEMENTS (ephy_bookmark_radio_entries), details_value, G_CALLBACK (cmd_view_columns), editor); @@ -1608,11 +1602,11 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) EPHY_NODE_VIEW_SEARCHABLE, NULL, NULL); ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (key_view), topic_drag_types, - n_topic_drag_types, + G_N_ELEMENTS (topic_drag_types), col_id, -1); ephy_node_view_enable_drag_dest (EPHY_NODE_VIEW (key_view), topic_drag_dest_types, - n_topic_drag_dest_types); + G_N_ELEMENTS (topic_drag_dest_types)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (key_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); g_signal_connect (G_OBJECT (selection), @@ -1681,7 +1675,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) 0, NULL, &(editor->priv->address_col)); ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (bm_view), bmk_drag_types, - n_bmk_drag_types, + G_N_ELEMENTS (bmk_drag_types), url_col_id, title_col_id); ephy_node_view_set_sort (EPHY_NODE_VIEW (bm_view), G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE, GTK_SORT_ASCENDING); diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 4e661a497..52e5b4855 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -95,7 +95,6 @@ static const EphyBookmarksBookmarkInfo default_bookmarks [] = */ { N_("Search the web"), N_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8") } }; -static int n_default_bookmarks = G_N_ELEMENTS (default_bookmarks); static const char *default_topics [] = { @@ -106,7 +105,6 @@ static const char *default_topics [] = N_("Travel"), N_("Work") }; -static int n_default_topics = G_N_ELEMENTS (default_topics); /* Signals */ enum @@ -162,12 +160,12 @@ ephy_bookmarks_init_defaults (EphyBookmarks *eb) { int i; - for (i = 0; i < n_default_topics; i++) + for (i = 0; i < G_N_ELEMENTS (default_topics); i++) { ephy_bookmarks_add_keyword (eb, _(default_topics[i])); } - for (i = 0; i < n_default_bookmarks; i++) + for (i = 0; i < G_N_ELEMENTS (default_bookmarks); i++) { EphyNode *bmk; -- cgit