aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-06-22 16:48:45 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-06-25 23:51:30 +0800
commitfb062ec392862e2f14ca3b6466e200a31dee2737 (patch)
tree9901793c294d43c7062f2ebdd8666cf53ae17a45 /src/ephy-window.c
parent5e3aa77ad8a6293f31f548366c87a7cd50c861fb (diff)
downloadgsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar.gz
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar.bz2
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar.lz
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar.xz
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.tar.zst
gsoc2013-epiphany-fb062ec392862e2f14ca3b6466e200a31dee2737.zip
ephy-download-widget: add ephy_download_widget_download_finished()
It makes easier to check whether download finished, and it's compatible with WebKit2.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 8ebaa7e07..e5e9c04ce 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -948,24 +948,14 @@ window_has_ongoing_downloads (EphyWindow *window)
for (l = downloads; l != NULL; l = l->next)
{
-#ifdef HAVE_WEBKIT2
- /* TODO: Downloads */
-#else
- 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_STARTED)
+ if (!ephy_download_widget_download_is_finished (EPHY_DOWNLOAD_WIDGET (l->data)))
{
downloading = TRUE;
break;
}
-#endif
}
g_list_free (downloads);
@@ -3156,23 +3146,13 @@ downloads_close_cb (GtkButton *button, EphyWindow *window)
for (l = downloads; l != NULL; l = l->next)
{
- EphyDownload *download;
-#ifdef HAVE_WEBKIT2
- /* TODO: Downloads */
-#else
- 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)
+ if (ephy_download_widget_download_is_finished (EPHY_DOWNLOAD_WIDGET (l->data)))
{
gtk_widget_destroy (GTK_WIDGET (l->data));
}
-#endif
}
g_list_free (downloads);