From f7c5ab216b5e97b9aacb3e6b023c24bbde37987e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Thu, 26 Mar 2009 22:27:06 +0100 Subject: [PATCH] Add cookie manager to existing browsers and fill the tree at once --- extensions/cookie-manager.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/cookie-manager.c b/extensions/cookie-manager.c index d4515b74..3fcb1e19 100644 --- a/extensions/cookie-manager.c +++ b/extensions/cookie-manager.c @@ -477,15 +477,6 @@ static void cm_jar_changed_cb(SoupCookieJar *jar, SoupCookie *old, SoupCookie *n } -static void cm_page_realize_cb(GtkWidget *widget, CMData *cmdata) -{ - /* Initially fill the tree view. This gets also called when the alignment of the panel is - * changed but then we don't need to rebuild the tree. */ - if (cmdata->cookies == NULL) - cm_refresh_store(cmdata); -} - - static void cm_app_add_browser_cb(MidoriApp *app, MidoriBrowser *browser, MidoriExtension *ext) { GtkWidget *panel; @@ -572,16 +563,25 @@ static void cm_app_add_browser_cb(MidoriApp *app, MidoriBrowser *browser, Midori cmdata->jar = SOUP_COOKIE_JAR(soup_session_get_feature(session, soup_cookie_jar_get_type())); g_signal_connect(cmdata->jar, "changed", G_CALLBACK(cm_jar_changed_cb), cmdata); + cm_refresh_store(cmdata); + midori_panel_append_widget(MIDORI_PANEL(panel), cmdata->panel_page, STOCK_COOKIE_MANAGER, _("Cookie Manager"), toolbar); - g_signal_connect(cmdata->panel_page, "realize", G_CALLBACK(cm_page_realize_cb), cmdata); g_signal_connect(ext, "deactivate", G_CALLBACK(cm_deactivate_cb), cmdata); } static void cm_activate_cb(MidoriExtension *extension, MidoriApp *app, gpointer data) { + KatzeArray* browsers; + MidoriBrowser* browser; + guint i; + + browsers = katze_object_get_object(app, "browsers"); + i = 0; + while ((browser = katze_array_get_nth_item(browsers, i++))) + cm_app_add_browser_cb(app, browser, extension); g_signal_connect(app, "add-browser", G_CALLBACK(cm_app_add_browser_cb), extension); } -- 2.39.5