[epiphany] PDF: Do not add documents in document mode to download manager



commit 20a10382aee3176810f54b34f44daec66bca9dc4
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Fri Jan 18 17:50:47 2019 +0100

    PDF: Do not add documents in document mode to download manager

 embed/ephy-embed-shell.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 50a821d49..86fddfa68 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -1158,8 +1158,8 @@ download_started_cb (WebKitWebContext *web_context,
   EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
   EphyDownload *ephy_download;
   EphyEmbed *embed;
-  GtkWindow *window;
   gboolean ephy_download_set;
+  WebKitWebView *web_view;
 
   /* Is download locked down? */
   if (g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
@@ -1179,12 +1179,13 @@ download_started_cb (WebKitWebContext *web_context,
 
   ephy_download = ephy_download_new (download);
 
-  window = gtk_application_get_active_window (GTK_APPLICATION (shell));
-  embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  if (embed != NULL)
-    ephy_embed_download_started (embed, ephy_download);
+  web_view = webkit_download_get_web_view (download);
+  embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (web_view);
+  ephy_embed_download_started (embed, ephy_download);
+
+  if (ephy_embed_get_mode (embed) != EPHY_EMBED_MODE_EVINCE_DOCUMENT)
+    ephy_downloads_manager_add_download (priv->downloads_manager, ephy_download);
 
-  ephy_downloads_manager_add_download (priv->downloads_manager, ephy_download);
   g_object_unref (ephy_download);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]