diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2011-01-19 00:10:11 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2011-03-08 04:34:52 +0800 |
commit | b9f9bf1a0763492f8bf41b8856bbd1149c5871a9 (patch) | |
tree | 92ad55101bff9eabcbc17afdba4a398ce4c4b709 /src/ephy-session.c | |
parent | 7f7826a163f31bb662247ac4486dca0d01df35f6 (diff) | |
download | gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar.gz gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar.bz2 gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar.lz gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar.xz gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.tar.zst gsoc2013-epiphany-b9f9bf1a0763492f8bf41b8856bbd1149c5871a9.zip |
ephy-download: add the new EphyDownload object
EphyDownload is a wrapper object around WebKitDownload that handles common
behavior in downloads: auto-destination, default action for the MIME type.
It can be used to wrap a WebKitDownload coming from a WebKitView or to download
a url: ephy_download_new_for_uri and ephy_download_new_for_download are
provided.
Its lifetime is not automagic like EphyEmbedPersist, so you have to unref it
when you no longer need it.
This new object replaces EphyEmbedPersist and enables us to use a single
codepath for downloads in all Epiphany.
Bug #618443
Diffstat (limited to 'src/ephy-session.c')
-rw-r--r-- | src/ephy-session.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c index cee9e490e..65ca3d228 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -167,7 +167,6 @@ confirm_shutdown_dialog_weak_ref_cb (InteractData *data, EphySessionPrivate *priv = data->session->priv; EggSMClient *sm_client = data->sm_client; EphyShell *shell; - GObject *dv; gboolean will_quit; LOG ("confirm_shutdown_dialog_weak_ref_cb response %d", data->response); @@ -180,14 +179,6 @@ confirm_shutdown_dialog_weak_ref_cb (InteractData *data, g_object_weak_unref (G_OBJECT (shell), (GWeakNotify) confirm_shutdown_dialog_accept_cb, data); - - dv = ephy_embed_shell_get_downloader_view_nocreate (ephy_embed_shell_get_default ()); - if (dv != NULL) - { - g_object_weak_unref (dv, - (GWeakNotify) confirm_shutdown_dialog_accept_cb, - data); - } } if (data->timeout_id != 0) @@ -208,15 +199,16 @@ client_quit_requested_cb (EggSMClient *sm_client, EphySession *session) { EphySessionPrivate *priv = session->priv; - GObject *dv; GtkWidget *dialog, *box; InteractData *data; + GList *downloads; /* If we're shutting down, check if there are downloads * remaining, since they can't be restarted. */ - if (ephy_shell_get_default () == NULL || - (dv = ephy_embed_shell_get_downloader_view_nocreate (ephy_embed_shell_get_default ())) == NULL) + + downloads = ephy_embed_shell_get_downloads (embed_shell); + if (ephy_shell_get_default () == NULL || g_list_length (downloads) == 0) { egg_sm_client_will_quit (sm_client, TRUE); return; @@ -271,11 +263,6 @@ client_quit_requested_cb (EggSMClient *sm_client, (GWeakNotify) confirm_shutdown_dialog_accept_cb, data); - /* When the download finishes, un-veto the shutdown */ - g_object_weak_ref (dv, - (GWeakNotify) confirm_shutdown_dialog_accept_cb, - data); - g_signal_connect (dialog, "response", G_CALLBACK (confirm_shutdown_dialog_response_cb), data); g_object_weak_ref (G_OBJECT (dialog), |