From 772b990f45f05d2a77351870b5be90cf8336d722 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 29 Oct 2017 14:51:45 -0400 Subject: MqApplication: Handle started downloads --- 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; } -- cgit v0.9.1