aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-12 04:12:48 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-12 04:12:48 +0800
commit594097cc0181cfea7e8205448a7b6e315e311a36 (patch)
tree8401a7431661f52e384a69bf9ce5cfc03e60a464 /src/ephy-tab.c
parent67a3a6a3e873bf7972d76cee8396b8dec08fdcae (diff)
downloadgsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar.gz
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar.bz2
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar.lz
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar.xz
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.tar.zst
gsoc2013-epiphany-594097cc0181cfea7e8205448a7b6e315e311a36.zip
Reimplement favicons. Now all exit crashes related to connections left
2003-01-11 Marco Pesenti Gritti <marco@it.gnome.org> * embed/Makefile.am: * embed/ephy-embed-favicon.c: * embed/ephy-embed-favicon.h: * embed/ephy-embed-shell.c: (ephy_embed_shell_get_favicon_cache): * embed/ephy-favicon-cache.c: (ephy_favicon_cache_class_init), (ephy_favicon_cache_new), (ephy_favicon_cache_load), (icon_is_obsolete), (icons_added_cb), (icons_removed_cb), (remove_obsolete_icons), (ephy_favicon_cache_save), (ephy_favicon_cache_init), (kill_download), (cleanup_downloads_hash), (ephy_favicon_cache_finalize), (favicon_name_build), (favicon_download_completed_cb), (ephy_favicon_cache_download), (ephy_favicon_cache_get): * embed/ephy-favicon-cache.h: * embed/ephy-favicon.c: * embed/ephy-favicon.h: * embed/mozilla/mozilla-embed-shell.cpp: * src/ephy-tab.c: (ephy_tab_init), (ephy_tab_favicon_cb), (ephy_tab_location_cb), (ephy_tab_get_location), (ephy_tab_get_favicon_url): * src/ephy-tab.h: * src/ephy-window.c: (update_favicon_control): * src/toolbar.c: (toolbar_setup_favicon_ebox), (toolbar_update_favicon): Reimplement favicons. Now all exit crashes related to connections left open by favicons should be fixed.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 170ae3846..6430f025a 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -53,6 +53,7 @@ struct EphyTabPrivate
TabLoadStatus load_status;
char status_message[255];
char link_message[255];
+ char favicon_url[255];
char *title;
char *location;
int load_percent;
@@ -77,6 +78,10 @@ enum
};
static void
+ephy_tab_favicon_cb (EphyEmbed *embed,
+ const char *url,
+ EphyTab *tab);
+static void
ephy_tab_link_message_cb (EphyEmbed *embed,
const char *message,
EphyTab *tab);
@@ -199,6 +204,7 @@ ephy_tab_init (EphyTab *tab)
tab->priv->is_active = FALSE;
*tab->priv->status_message = '\0';
*tab->priv->link_message = '\0';
+ *tab->priv->favicon_url = '\0';
tab->priv->load_status = TAB_LOAD_NONE;
tab->priv->load_percent = 0;
tab->priv->title = NULL;
@@ -260,6 +266,9 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect (embed, "ge_security_change",
GTK_SIGNAL_FUNC (ephy_tab_security_change_cb),
tab);
+ g_signal_connect (embed, "ge_favicon",
+ GTK_SIGNAL_FUNC (ephy_tab_favicon_cb),
+ tab);
}
/* Destructor */
@@ -424,6 +433,20 @@ ephy_tab_set_visibility (EphyTab *tab,
/* Private callbacks for embed signals */
static void
+ephy_tab_favicon_cb (EphyEmbed *embed,
+ const char *url,
+ EphyTab *tab)
+{
+ g_strlcpy (tab->priv->favicon_url,
+ url, 255);
+
+ if (!tab->priv->is_active) return;
+
+ ephy_window_update_control (tab->priv->window,
+ FaviconControl);
+}
+
+static void
ephy_tab_link_message_cb (EphyEmbed *embed,
const char *message,
EphyTab *tab)
@@ -444,6 +467,7 @@ ephy_tab_location_cb (EphyEmbed *embed, EphyTab *tab)
ephy_embed_get_location (embed, TRUE,
&tab->priv->location);
tab->priv->link_message[0] = '\0';
+ tab->priv->favicon_url[0] = '\0';
if (tab->priv->is_active)
{
@@ -906,6 +930,19 @@ ephy_tab_get_location (EphyTab *tab)
return tab->priv->location;
}
+const char *
+ephy_tab_get_favicon_url (EphyTab *tab)
+{
+ if (tab->priv->favicon_url[0] == '\0')
+ {
+ return NULL;
+ }
+ else
+ {
+ return tab->priv->favicon_url;
+ }
+}
+
void
ephy_tab_set_location (EphyTab *tab,
char *location)