summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/application.c b/src/application.c
index 1961545..476ad31 100644
--- a/src/application.c
+++ b/src/application.c
@@ -32,6 +32,7 @@
#include "about.h"
#include "config.h"
+#include "download.h"
#include "web-settings.h"
#include "window.h"
@@ -65,6 +66,13 @@ set_webkit_settings(MqApplication *application)
web_context);
}
+static void
+download_started_cb(WebKitWebContext G_GNUC_UNUSED *context,
+ WebKitDownload *download, MqApplication *application)
+{
+ mq_download_new(application->config, download);
+}
+
MqApplication *
mq_application_new(gchar G_GNUC_UNUSED *profile, gboolean G_GNUC_UNUSED private)
{
@@ -86,6 +94,9 @@ mq_application_new(gchar G_GNUC_UNUSED *profile, gboolean G_GNUC_UNUSED private)
set_webkit_settings(application);
+ g_signal_connect(webkit_web_context_get_default(), "download-started",
+ G_CALLBACK(download_started_cb), application);
+
return application;
}