]> spindle.queued.net Git - midori/commitdiff
Fixup the bookmark panel initialization
authorAlexander Butenko <a.butenka@gmail.com>
Sun, 13 Jun 2010 03:06:27 +0000 (23:06 -0400)
committerChristian Dywan <christian@twotoasts.de>
Wed, 16 Jun 2010 18:57:08 +0000 (20:57 +0200)
panels/midori-bookmarks.c

index fdc7080def877529d4103aa61cf9849f719b5ad2..e5deb9cb19cba7114f10ce69f877ae9dad78e460 100644 (file)
@@ -531,14 +531,11 @@ midori_bookmarks_set_app (MidoriBookmarks* bookmarks,
 {
     GtkTreeModel* model;
 
+    model = gtk_tree_view_get_model (GTK_TREE_VIEW (bookmarks->treeview));
     if (bookmarks->array)
     {
         g_object_unref (bookmarks->array);
-        model = gtk_tree_view_get_model (GTK_TREE_VIEW (bookmarks->treeview));
         gtk_tree_store_clear (GTK_TREE_STORE (model));
-        #if HAVE_SQLITE
-        midori_bookmarks_read_from_db (bookmarks, GTK_TREE_STORE (model), NULL, "");
-        #endif
     }
     katze_assign (bookmarks->app, app);
     if (!app)
@@ -546,6 +543,10 @@ midori_bookmarks_set_app (MidoriBookmarks* bookmarks,
 
     g_object_ref (app);
     bookmarks->array = katze_object_get_object (app, "bookmarks");
+
+    #if HAVE_SQLITE
+    midori_bookmarks_read_from_db (bookmarks, GTK_TREE_STORE (model), NULL, "");
+    #endif
 }
 
 static void