From 110be671322a06930c86f0ac68b4e898a4664913 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 1 Aug 2005 15:57:48 +0000 Subject: Add a ::icon property to EphyTab, and use that everywhere instead of 2005-08-01 Christian Persch * src/ephy-location-action.c: (sync_icon), (ephy_location_action_set_property), (ephy_location_action_get_property), (ephy_location_action_class_init), (ephy_location_action_init), (ephy_location_action_finalize): * src/ephy-notebook.c: (sync_icon): * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_get_property), (ephy_tab_class_init), (ephy_tab_finalize), (ephy_tab_load_icon), (ephy_tab_icon_cache_changed_cb), (ephy_tab_set_icon_address), (ephy_tab_get_icon), (ephy_tab_init): * src/ephy-tab.h: * src/ephy-toolbar.c: (ephy_toolbar_set_favicon): * src/ephy-toolbar.h: * src/ephy-window.c: (sync_tab_icon): Add a ::icon property to EphyTab, and use that everywhere instead of querying the icon cache, thus saving memory. --- src/ephy-window.c | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 7ab8cf956..949077ca3 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -49,7 +49,6 @@ #include "ephy-tabs-menu.h" #include "ephy-stock-icons.h" #include "ephy-extension.h" -#include "ephy-favicon-cache.h" #include "ephy-link.h" #include "ephy-gui.h" #include "ephy-notebook.h" @@ -1193,33 +1192,19 @@ sync_tab_document_type (EphyTab *tab, } static void -sync_tab_icon (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) +sync_tab_icon (EphyTab *tab, + GParamSpec *pspec, + EphyWindow *window) { - const char *address; - EphyFaviconCache *cache; - GdkPixbuf *pixbuf = NULL; - - if (window->priv->closing) return; - - cache = EPHY_FAVICON_CACHE - (ephy_embed_shell_get_favicon_cache - (EPHY_EMBED_SHELL (ephy_shell))); - - address = ephy_tab_get_icon_address (tab); - - if (address) - { - pixbuf = ephy_favicon_cache_get (cache, address); - } + EphyWindowPrivate *priv = window->priv; + GdkPixbuf *icon; - gtk_window_set_icon (GTK_WINDOW (window), pixbuf); + if (priv->closing) return; - ephy_toolbar_set_favicon (window->priv->toolbar, address); + icon = ephy_tab_get_icon (tab); - if (pixbuf) - { - g_object_unref (pixbuf); - } + gtk_window_set_icon (GTK_WINDOW (window), icon); + ephy_toolbar_set_favicon (priv->toolbar, icon); } static void -- cgit v1.2.3