[epiphany] ephy-download: add EPHY_DOWNLOAD_ACTION_DO_NOTHING



commit 43a4f898f770c95987becfa2e96a270b756a059e
Author: Diego Escalante Urrelo <diegoe igalia com>
Date:   Thu May 31 21:41:49 2012 -0500

    ephy-download: add EPHY_DOWNLOAD_ACTION_DO_NOTHING
    
    Add a new action instead of abusing NONE. NONE means nothing has been
    set, this will trigger AUTO when auto-downloads preference is TRUE.
    
    DO_NOTHING explicitely asks for no action to be taken.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676128

 embed/ephy-download.c |    9 +++++++--
 embed/ephy-download.h |    3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index a1821f2..5d77c0e 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -674,6 +674,10 @@ ephy_download_do_download_action (EphyDownload *download,
         LOG ("ephy_download_do_download_action: none");
         ret = TRUE;
         break;
+      case EPHY_DOWNLOAD_ACTION_DO_NOTHING:
+        LOG ("ephy_download_do_download_action: nothing");
+        ret = TRUE;
+        break;
       default:
         LOG ("ephy_download_do_download_action: unhandled action");
         ret = FALSE;
@@ -916,10 +920,11 @@ download_status_changed_cb (GObject *object,
   if (status == WEBKIT_DOWNLOAD_STATUS_FINISHED) {
     g_signal_emit_by_name (download, "completed");
 
-    if (g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_AUTO_DOWNLOADS)) {
+    if (g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_AUTO_DOWNLOADS) &&
+        priv->action == EPHY_DOWNLOAD_ACTION_NONE) {
       ephy_download_do_download_action (download, EPHY_DOWNLOAD_ACTION_AUTO);
     } else {
-      ephy_download_do_download_action (download, EPHY_DOWNLOAD_ACTION_NONE);
+      ephy_download_do_download_action (download, priv->action);
     }
 
     ephy_embed_shell_remove_download (embed_shell, download);
diff --git a/embed/ephy-download.h b/embed/ephy-download.h
index 34cbbca..a4592b8 100644
--- a/embed/ephy-download.h
+++ b/embed/ephy-download.h
@@ -74,7 +74,8 @@ typedef enum
   EPHY_DOWNLOAD_ACTION_NONE,
   EPHY_DOWNLOAD_ACTION_AUTO,
   EPHY_DOWNLOAD_ACTION_BROWSE_TO,
-  EPHY_DOWNLOAD_ACTION_OPEN
+  EPHY_DOWNLOAD_ACTION_OPEN,
+  EPHY_DOWNLOAD_ACTION_DO_NOTHING
 } EphyDownloadActionType;
 
 GType         ephy_download_get_type              (void) G_GNUC_CONST;



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