aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2011-07-17 07:46:09 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2011-07-17 08:29:07 +0800
commit93507fc66f9f8cc456519936284220ab4e6f6cfd (patch)
tree668787cfda1cb5d6d7b09f9d10e5df944446ff2e
parent2c8c5b280c0e84c264ea3bdbbabdead0046cd00a (diff)
downloadgsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar.gz
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar.bz2
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar.lz
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar.xz
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.tar.zst
gsoc2013-epiphany-93507fc66f9f8cc456519936284220ab4e6f6cfd.zip
ephy-window: clear finished downloads when closing the downloads bar
When a download finishes but you don't 'activate' it (open or browsing) the widget stays alive on the downloads-bar, worse, if open or browse actions fail, the download can't be removed from the bar. This commit clears finished downloads from the downloads-bar when it is closed (with the X button). Hiding it will *not* trigger this cleanup. Bug #653918
-rw-r--r--src/ephy-window.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 73a885e25..f5ee4b2a9 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3261,6 +3261,28 @@ downloads_removed_cb (GtkContainer *container,
static void
downloads_close_cb (GtkButton *button, EphyWindow *window)
{
+ GList *l, *downloads;
+
+ downloads = gtk_container_get_children (GTK_CONTAINER (window->priv->downloads_box));
+
+ for (l = downloads; l != NULL; l = l->next)
+ {
+ EphyDownload *download;
+ WebKitDownloadStatus status;
+
+ if (EPHY_IS_DOWNLOAD_WIDGET (l->data) != TRUE)
+ continue;
+
+ download = ephy_download_widget_get_download (EPHY_DOWNLOAD_WIDGET (l->data));
+ status = webkit_download_get_status (ephy_download_get_webkit_download (download));
+
+ if (status == WEBKIT_DOWNLOAD_STATUS_FINISHED)
+ {
+ gtk_widget_destroy (GTK_WIDGET (l->data));
+ }
+ }
+ g_list_free (downloads);
+
ephy_window_set_downloads_box_visibility (window, FALSE);
}