(GClosureNotify)g_free, 0);
#endif
}
-#endif
-#if HAVE_LIBSOUP
static void
authentication_dialog_response_cb (GtkWidget* dialog,
gint response,
gchar* uri;
KatzeItem* item;
gchar* uri_ready;
+ #if HAVE_LIBSOUP
+ GObjectClass* webkit_class;
+ KatzeNet* net;
+ SoupSession* s_session;
+ #endif
#ifdef HAVE_SQLITE
sqlite3* db;
gint max_history_age;
}
#if HAVE_LIBSOUP
+ webkit_class = g_type_class_ref (WEBKIT_TYPE_WEB_VIEW);
+ if (!g_object_class_find_property (webkit_class, "session"))
+ {
/* This is a nasty trick that allows us to manipulate cookies
even without having a pointer to the jar. */
soup_cookie_jar_get_type ();
old_jar_constructed_cb = G_OBJECT_CLASS (jar_class)->constructed;
G_OBJECT_CLASS (jar_class)->constructed = cookie_jar_constructed_cb;
}
- #endif
- #if HAVE_LIBSOUP
/* This is a nasty trick that allows us to manipulate preferences
even without having a pointer to the session. */
soup_session_get_type ();
old_session_constructed_cb = G_OBJECT_CLASS (session_class)->constructed;
G_OBJECT_CLASS (session_class)->constructed = soup_session_constructed_cb;
}
+ }
#endif
/* Load configuration files */
}
g_string_free (error_messages, TRUE);
+ #if HAVE_LIBSOUP
+ webkit_class = g_type_class_ref (WEBKIT_TYPE_WEB_VIEW);
+ if (g_object_class_find_property (webkit_class, "session"))
+ {
+ net = katze_net_new ();
+ s_session = katze_net_get_session (net);
+ soup_session_settings_notify_http_proxy_cb (settings, NULL, s_session);
+ soup_session_settings_notify_ident_string_cb (settings, NULL, s_session);
+ g_signal_connect (settings, "notify::http-proxy",
+ G_CALLBACK (soup_session_settings_notify_http_proxy_cb), s_session);
+ g_signal_connect (settings, "notify::ident-string",
+ G_CALLBACK (soup_session_settings_notify_ident_string_cb), s_session);
+ g_signal_connect (s_session, "authenticate",
+ G_CALLBACK (soup_session_authenticate_cb), app);
+ g_object_unref (net);
+ }
+ #endif
+
/* Open as many tabs as we have uris, seperated by pipes */
i = 0;
while (uris && uris[i])
GtkWidget* entry;
GtkWidget* hbox;
gint icon_width, icon_height;
+ #if HAVE_LIBSOUP
+ GObjectClass* webkit_class;
+ #endif
g_return_if_fail (MIDORI_IS_PREFERENCES (preferences));
g_return_if_fail (MIDORI_IS_WEB_SETTINGS (settings));
/* Page "Network" */
#if HAVE_LIBSOUP
+ webkit_class = g_type_class_ref (WEBKIT_TYPE_WEB_VIEW);
+ if (g_object_class_find_property (webkit_class, "session") ||
/* If a cookie jar was created, WebKit is using Soup */
- if (g_type_get_qdata (SOUP_TYPE_COOKIE_JAR,
+ g_type_get_qdata (SOUP_TYPE_COOKIE_JAR,
g_quark_from_static_string ("midori-has-jar")))
{
PAGE_NEW (GTK_STOCK_NETWORK, _("Network"));
/* Page "Privacy" */
PAGE_NEW (GTK_STOCK_INDEX, _("Privacy"));
#if HAVE_LIBSOUP_2_25_2
+ if (g_object_class_find_property (webkit_class, "session") ||
/* If a cookie jar was created, WebKit is using Soup */
- if (g_type_get_qdata (SOUP_TYPE_COOKIE_JAR,
+ g_type_get_qdata (SOUP_TYPE_COOKIE_JAR,
g_quark_from_static_string ("midori-has-jar")))
{
FRAME_NEW (_("Web Cookies"));