Only connect liststore after populating the model with filters

We don't want to reload the rules for each row.
This commit is contained in:
Alexander Butenko 2010-02-03 18:30:48 +01:00 committed by Christian Dywan
parent de7818b7aa
commit 27653d6670

View file

@ -446,14 +446,6 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
entry = gtk_entry_new (); entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 4);
liststore = gtk_list_store_new (1, G_TYPE_STRING); liststore = gtk_list_store_new (1, G_TYPE_STRING);
g_object_connect (liststore,
"signal::row-inserted",
adblock_preferences_model_row_changed_cb, extension,
"signal::row-changed",
adblock_preferences_model_row_changed_cb, extension,
"signal::row-deleted",
adblock_preferences_model_row_deleted_cb, extension,
NULL);
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (liststore)); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (liststore));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
column = gtk_tree_view_column_new (); column = gtk_tree_view_column_new ();
@ -492,6 +484,14 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
NULL, i - 1, 0, filters[i -1], -1); NULL, i - 1, 0, filters[i -1], -1);
} }
g_strfreev (filters); g_strfreev (filters);
g_object_connect (liststore,
"signal::row-inserted",
adblock_preferences_model_row_changed_cb, extension,
"signal::row-changed",
adblock_preferences_model_row_changed_cb, extension,
"signal::row-deleted",
adblock_preferences_model_row_deleted_cb, extension,
NULL);
g_object_unref (liststore); g_object_unref (liststore);
vbox = gtk_vbox_new (FALSE, 4); vbox = gtk_vbox_new (FALSE, 4);