]> spindle.queued.net Git - midori/commitdiff
Remove views from the tab panel as they are removed from the browser
authorChristian Dywan <christian@twotoasts.de>
Mon, 22 Jun 2009 21:13:23 +0000 (23:13 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 22 Jun 2009 21:13:23 +0000 (23:13 +0200)
extensions/tab-panel.c

index 1960e55d204e3fd8b55dfde3d79a0c90da87c487..ca6f1004bfa03915799a21fd241b0824b8de69ec 100644 (file)
@@ -255,7 +255,27 @@ tab_panel_browser_remove_tab_cb (MidoriBrowser*   browser,
                                  MidoriView*      view,
                                  MidoriExtension* extension)
 {
+    GtkTreeModel* model = g_object_get_data (G_OBJECT (extension), "treemodel");
+    guint i;
+    GtkTreeIter iter;
+
+    i = 0;
+    while (gtk_tree_model_iter_nth_child (model, &iter, NULL, i))
+    {
+        MidoriView* view_;
 
+        gtk_tree_model_get (model, &iter, 0, &view_, -1);
+
+        if (view == view_)
+        {
+            gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
+            g_object_unref (view_);
+            break;
+        }
+
+        g_object_unref (view_);
+        i++;
+    }
 }
 
 static void