aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-favicon-cache.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-07-04 20:22:41 +0800
committerChristian Persch <chpe@src.gnome.org>2005-07-04 20:22:41 +0800
commit553cf8c4a065086212d22d52715333ee166b85b5 (patch)
tree3927b984675f82fd3488def5827247166be9a3e3 /embed/ephy-favicon-cache.c
parent0e935c597fe2e3e00f672b98f77eaebf48660857 (diff)
downloadgsoc2013-epiphany-553cf8c4a065086212d22d52715333ee166b85b5.tar.gz
gsoc2013-epiphany-553cf8c4a065086212d22d52715333ee166b85b5.tar.zst
gsoc2013-epiphany-553cf8c4a065086212d22d52715333ee166b85b5.zip
Better fix for bug #151037 to make session shutdown work again. Also fix
2005-07-04 Christian Persch <chpe@cvs.gnome.org> * embed/downloader-view.c: (remove_download), (prepare_close_cb), (downloader_view_init), (downloader_view_finalize), (downloader_view_remove_download), (download_dialog_delete_cb): * embed/ephy-embed-shell.c: (ephy_embed_shell_prepare_close), (ephy_embed_shell_class_init): * embed/ephy-embed-shell.h: * embed/ephy-favicon-cache.c: (prepare_close_cb), (ephy_favicon_cache_init), (kill_download): * embed/mozilla/mozilla-embed-find.cpp: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-notifiers.cpp: * embed/mozilla/mozilla-notifiers.h: * src/ephy-session.c: (ephy_session_init), (ephy_session_dispose), (ephy_session_autoresume), (close_dialog), (ephy_session_close): * src/ephy-shell.c: (ephy_shell_startup), (toolwindow_hide_cb): * src/ephy-window.c: (ephy_window_finalize): Better fix for bug #151037 to make session shutdown work again. Also fix session shutdown while resuming, and preserve the session in this case.
Diffstat (limited to 'embed/ephy-favicon-cache.c')
-rw-r--r--embed/ephy-favicon-cache.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index 83c14ffad..034ec305d 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -29,6 +29,7 @@
#include <time.h>
#include <sys/stat.h>
+#include "ephy-embed-shell.h"
#include "ephy-embed-persist.h"
#include "ephy-embed-factory.h"
#include "ephy-file-helpers.h"
@@ -44,6 +45,7 @@
static void ephy_favicon_cache_class_init (EphyFaviconCacheClass *klass);
static void ephy_favicon_cache_init (EphyFaviconCache *cache);
static void ephy_favicon_cache_finalize (GObject *object);
+static gboolean kill_download (const char*, EphyEmbedPersist*, EphyFaviconCache*);
#define EPHY_FAVICON_CACHE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_FAVICON_CACHE, EphyFaviconCachePrivate))
@@ -205,6 +207,16 @@ remove_obsolete_icons (EphyFaviconCache *eb)
}
static void
+prepare_close_cb (EphyEmbedShell *shell,
+ EphyFaviconCache *cache)
+{
+ EphyFaviconCachePrivate *priv = cache->priv;
+
+ g_hash_table_foreach_remove (priv->downloads_hash,
+ (GHRFunc) kill_download, cache);
+}
+
+static void
ephy_favicon_cache_init (EphyFaviconCache *cache)
{
EphyNodeDb *db;
@@ -251,10 +263,14 @@ ephy_favicon_cache_init (EphyFaviconCache *cache)
ephy_node_db_load_from_file (cache->priv->db, cache->priv->xml_file,
EPHY_FAVICON_CACHE_XML_ROOT,
EPHY_FAVICON_CACHE_XML_VERSION);
+
+ /* listen to prepare-close on the shell */
+ g_signal_connect_object (embed_shell, "prepare-close",
+ G_CALLBACK (prepare_close_cb), cache, 0);
}
static gboolean
-kill_download (char *key,
+kill_download (const char *key,
EphyEmbedPersist *persist,
EphyFaviconCache *cache)
{