]> spindle.queued.net Git - midori/commitdiff
Add cookie manager to existing browsers and fill the tree at once
authorEnrico Tröger <enrico.troeger@uvena.de>
Thu, 26 Mar 2009 21:27:06 +0000 (22:27 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 26 Mar 2009 21:27:06 +0000 (22:27 +0100)
extensions/cookie-manager.c

index d4515b74377bf98480a40cf22fb06cf0a202e33d..3fcb1e19a0ded3f9f7fffee5f1bc235fb7aed591 100644 (file)
@@ -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);
 }