[epiphany] ephy-embed: fix download button action



commit 49916720de793de370a6aa8f44e2264078599451
Author: Diego Escalante Urrelo <diegoe gnome org>
Date:   Tue Dec 29 00:33:12 2009 -0500

    ephy-embed: fix download button action
    
    Sometimes downloads can have a mime_description but a NULL helper_app
    in that case action is never changed so DOWNLOAD_ACTION_DOWNLOAD remains
    as action value. This is the same response value as Save as...
    button, which is wrong for the Download button.
    
    Bug #605091

 embed/ephy-embed.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 393d822..f446947 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -685,6 +685,14 @@ confirm_action_from_mime (WebKitWebView *web_view,
     action = DOWNLOAD_ACTION_OPEN_LOCATION;
   }
 
+  /* Sometimes downloads can have a mime_description but a NULL helper_app
+   * in that case action is never changed so DOWNLOAD_ACTION_DOWNLOAD remains
+   * as action value. This is the same response value as Save as...
+   * button, which is wrong for the Download button.
+   */
+  if (helper_app == NULL)
+    action = DOWNLOAD_ACTION_OPEN_LOCATION;
+
   action_label = (action == DOWNLOAD_ACTION_OPEN) ? GTK_STOCK_OPEN : STOCK_DOWNLOAD;
   suggested_filename = webkit_download_get_suggested_filename (download);
 



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