From 0c5ce0e5158fe16cb64b0c8ab33d2cb04477f016 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Fri, 17 Jul 2009 18:03:50 +0200 Subject: [PATCH] No need for a data function for adblock text columns --- extensions/adblock.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index f4e8f443..50c1d247 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -35,20 +35,6 @@ adblock_deactivate_cb (MidoriExtension* extension, /* FIXME: Disconnect session callbacks */ } -static void -adblock_preferences_render_text (GtkTreeViewColumn* column, - GtkCellRenderer* renderer, - GtkTreeModel* model, - GtkTreeIter* iter, - MidoriExtension* extension) -{ - gchar* uri; - - gtk_tree_model_get (model, iter, 0, &uri, -1); - g_object_set (renderer, "text", uri, NULL); - g_free (uri); -} - static GtkWidget* adblock_get_preferences_dialog (MidoriExtension* extension) { @@ -107,14 +93,10 @@ adblock_get_preferences_dialog (MidoriExtension* extension) column = gtk_tree_view_column_new (); renderer_pixbuf = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE); - /* gtk_tree_view_column_set_cell_data_func (column, renderer_pixbuf, - (GtkTreeCellDataFunc)adblock_preferences_render_icon_cb, - treeview, NULL); */ renderer_text = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, renderer_text, TRUE); - gtk_tree_view_column_set_cell_data_func (column, renderer_text, - (GtkTreeCellDataFunc)adblock_preferences_render_text, - extension, NULL); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer_text, + "text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), -- 2.39.5