From 7860357ed29d26177e7c729d691990e9c88aaa1c Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 22 Jun 2009 23:13:23 +0200 Subject: [PATCH] Remove views from the tab panel as they are removed from the browser --- extensions/tab-panel.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/extensions/tab-panel.c b/extensions/tab-panel.c index 1960e55d..ca6f1004 100644 --- a/extensions/tab-panel.c +++ b/extensions/tab-panel.c @@ -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 -- 2.39.5