]> spindle.queued.net Git - midori/commitdiff
Only connect liststore after populating the model with filters
authorAlexander Butenko <a.butenka@gmail.com>
Wed, 3 Feb 2010 17:30:48 +0000 (18:30 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 3 Feb 2010 17:30:48 +0000 (18:30 +0100)
We don't want to reload the rules for each row.

extensions/adblock.c

index c04a8ce88f3dc611469c458d71ecfb2709b1a4be..5035e33b5a3af039a3e183fe7f78cdc2f0b434aa 100644 (file)
@@ -446,14 +446,6 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
     entry = gtk_entry_new ();
     gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 4);
     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));
     gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
     column = gtk_tree_view_column_new ();
@@ -492,6 +484,14 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
                                                NULL, i - 1, 0, filters[i -1], -1);
     }
     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);
     vbox = gtk_vbox_new (FALSE, 4);