aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-06-01 10:41:49 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-06-23 08:06:48 +0800
commit43a4f898f770c95987becfa2e96a270b756a059e (patch)
treea612a5f046e7b02d07d19c153633708453ded1b8 /embed
parentb274c83f91a2f267ddfedd11656f1b0a328f227f (diff)
downloadgsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar.gz
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar.bz2
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar.lz
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar.xz
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.tar.zst
gsoc2013-epiphany-43a4f898f770c95987becfa2e96a270b756a059e.zip
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
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-download.c9
-rw-r--r--embed/ephy-download.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index a1821f208..5d77c0e29 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 34cbbca83..a4592b806 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;