aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-download.c
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2013-07-06 14:59:13 +0800
committerLAN-TW <lantw44@gmail.com>2013-09-16 22:04:47 +0800
commit6312d03df0a10a59c8c71f695d1ae574930fc771 (patch)
tree52909442f31c8a2b0460bbda41989c305d995d25 /embed/ephy-download.c
parent1a5eb4d9c9e9a8ed9c0ac18069a983cd712a9dc5 (diff)
downloadgsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar.gz
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar.bz2
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar.lz
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar.xz
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.tar.zst
gsoc2013-epiphany-6312d03df0a10a59c8c71f695d1ae574930fc771.zip
Add gsettings key "extract-downloaded-archives"
Diffstat (limited to 'embed/ephy-download.c')
-rw-r--r--embed/ephy-download.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index b3a7ad3a1..822ae4822 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -36,6 +36,8 @@
#include <errno.h>
#include <glib/gi18n.h>
#include <string.h>
+#include <archive.h>
+#include <archive_entry.h>
G_DEFINE_TYPE (EphyDownload, ephy_download, G_TYPE_OBJECT)
@@ -631,6 +633,21 @@ ephy_download_do_download_action (EphyDownload *download,
return ret;
}
+/**
+ * ephy_download_do_extract_archive:
+ * @download: an #EphyDownload
+ *
+ * Extract downloaded archives for @download.
+ *
+ * Returns: %TRUE if the extraction succeeded.
+ *
+ **/
+gboolean
+ephy_download_do_extract_archive (EphyDownload *download)
+{
+ return TRUE;
+}
+
static void
ephy_download_dispose (GObject *object)
{
@@ -891,6 +908,10 @@ download_finished_cb (WebKitDownload *wk_download,
g_signal_emit_by_name (download, "completed");
+ if(g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_EXTRACT_DOWNLOADED_ARCHIVES)){
+ ephy_download_do_extract_archive (download);
+ }
+
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);