]> spindle.queued.net Git - midori/commitdiff
Do not load icons other than in tabs
authorChristian Dywan <christian@twotoasts.de>
Thu, 20 Nov 2008 00:41:58 +0000 (01:41 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 20 Nov 2008 00:41:58 +0000 (01:41 +0100)
katze/katze-arrayaction.c
midori/midori-browser.c
midori/midori-searchaction.c

index fbbdf4055b82b5a843c78660928be76b79548a9f..5ab26c0926b25af66d63e0a868776029315d79fc 100644 (file)
@@ -213,20 +213,6 @@ katze_array_action_menu_item_activate_cb (GtkWidget*        proxy,
     g_signal_emit (array_action, signals[ACTIVATE_ITEM], 0, item);
 }
 
-static void
-katze_array_action_icon_cb (GdkPixbuf* icon,
-                            GtkWidget* widget)
-{
-    GtkWidget* image = gtk_image_new_from_pixbuf (icon);
-    g_object_unref (icon);
-    gtk_widget_show (image);
-    if (GTK_IS_IMAGE_MENU_ITEM (widget))
-        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image);
-    else
-        gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (widget), image);
-    g_object_unref (widget);
-}
-
 static void
 katze_array_action_menu_item_select_cb (GtkWidget*        proxy,
                                         KatzeArrayAction* array_action);
@@ -264,9 +250,7 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
                 GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU, NULL);
         else
             icon = katze_net_load_icon (array_action->net,
-                katze_item_get_uri (item),
-                (KatzeNetIconCb)katze_array_action_icon_cb,
-                proxy, g_object_ref (menuitem));
+                katze_item_get_uri (item), NULL, proxy, NULL);
         image = gtk_image_new_from_pixbuf (icon);
         g_object_unref (icon);
         gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
@@ -415,8 +399,7 @@ katze_array_action_item_notify_cb (KatzeItem*   item,
     else if (!KATZE_IS_ARRAY (item) && !strcmp (property, "uri"))
     {
         icon = katze_net_load_icon (array_action->net, katze_item_get_uri (item),
-            (KatzeNetIconCb)katze_array_action_icon_cb,
-            GTK_WIDGET (toolitem), g_object_ref (toolitem));
+            NULL, GTK_WIDGET (toolitem), NULL);
         image = gtk_image_new_from_pixbuf (icon);
         g_object_unref (icon);
         gtk_widget_show (image);
@@ -464,8 +447,7 @@ katze_array_action_create_tool_item_for (KatzeArrayAction* array_action,
             GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU, NULL);
     else
         icon = katze_net_load_icon (array_action->net, uri,
-            (KatzeNetIconCb)katze_array_action_icon_cb,
-            GTK_WIDGET (toolitem), g_object_ref (toolitem));
+            NULL, GTK_WIDGET (toolitem), NULL);
     image = gtk_image_new_from_pixbuf (icon);
     g_object_unref (icon);
     gtk_widget_show (image);
index 903f6716bb7fd7eeacb1670c838c5377a824ee62..76bd6217f4ec3828e432fd80c5882713b6257cf4 100644 (file)
@@ -2598,10 +2598,9 @@ midori_browser_bookmarks_item_render_icon_cb (GtkTreeViewColumn* column,
         pixbuf = gtk_widget_render_icon (treeview, GTK_STOCK_DIRECTORY,
                                          GTK_ICON_SIZE_MENU, NULL);
     else if (katze_item_get_uri (item))
-    /* FIXME: Implement icon_cb */
         pixbuf = katze_net_load_icon (
             MIDORI_BROWSER (gtk_widget_get_toplevel (treeview))->net,
-            katze_item_get_uri (item), NULL, treeview, treeview);
+            katze_item_get_uri (item), NULL, treeview, NULL);
     g_object_set (renderer, "pixbuf", pixbuf, NULL);
     if (pixbuf)
         g_object_unref (pixbuf);
@@ -2694,10 +2693,9 @@ midori_browser_history_render_icon_cb (GtkTreeViewColumn* column,
         pixbuf = gtk_widget_render_icon (treeview, GTK_STOCK_DIRECTORY,
                                          GTK_ICON_SIZE_MENU, NULL);
     else
-        /* FIXME: Implement icon_cb */
         pixbuf = katze_net_load_icon (
             MIDORI_BROWSER (gtk_widget_get_toplevel (treeview))->net,
-            katze_item_get_uri (item), NULL, treeview, treeview);
+            katze_item_get_uri (item), NULL, treeview, NULL);
 
     g_object_set (renderer, "pixbuf", pixbuf, NULL);
 
@@ -3610,7 +3608,8 @@ _location_action_insert_history_item (MidoriLocationAction* action,
         uri = katze_item_get_uri (item);
         pixbuf = katze_net_load_icon (browser->net, katze_item_get_uri (item),
                                       NULL, GTK_WIDGET (browser), NULL);
-        midori_location_action_add_item (action, uri, pixbuf, katze_item_get_name (item));
+        midori_location_action_add_item (action, uri,
+            pixbuf, katze_item_get_name (item));
     }
 }
 
index d13356705561374991e52c00e22ebd6cb8f23f7c..8ebe1bdd5b53995b07de3ce014a29b7884712584 100644 (file)
@@ -439,11 +439,8 @@ midori_search_action_icon_released_cb (GtkWidget*           entry,
             menuitem = gtk_image_menu_item_new_with_label (
                 katze_item_get_name (item));
             image = gtk_image_new ();
-            /* FIXME: Implement icon_cb */
             icon = katze_net_load_icon (MIDORI_SEARCH_ACTION (action)->net,
-                katze_item_get_uri (item),
-                NULL /*(KatzeNetIconCb)midori_browser_bookmark_icon_cb*/,
-                entry, NULL /*g_object_ref (image)*/);
+                katze_item_get_uri (item), NULL, entry, NULL);
             gtk_image_set_from_pixbuf (GTK_IMAGE (image), icon);
             g_object_unref (icon);
             gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
@@ -496,11 +493,9 @@ midori_search_action_set_entry_icon (MidoriSearchAction* search_action,
 
     if (search_action->current_item)
     {
-        /* FIXME: Implement icon_cb */
         icon = katze_net_load_icon (search_action->net,
             katze_item_get_uri (search_action->current_item),
-            NULL /*(KatzeNetIconCb)midori_browser_bookmark_icon_cb*/,
-            entry, NULL /*g_object_ref (entry)*/);
+            NULL, entry, NULL);
         gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
                                              GTK_ICON_ENTRY_PRIMARY, icon);
         g_object_unref (icon);
@@ -736,10 +731,8 @@ midori_search_action_dialog_render_icon_cb (GtkTreeViewColumn* column,
 
     /* FIXME: Use the net of the MidoriSearchAction */
     net = katze_net_new ();
-    /* FIXME: Implement icon_cb */
     icon = katze_net_load_icon (net, katze_item_get_uri (item),
-        NULL /*(KatzeNetIconCb)midori_search_action_dialog_icon_cb*/,
-        treeview, NULL /*g_object_ref (treeview)*/);
+        NULL, treeview, NULL);
     g_object_set (renderer, "pixbuf", icon, NULL);
     g_object_unref (icon);
     g_object_unref (net);