#include "katze-net.h"
#include <libsoup/soup.h>
+#include <webkit/webkit.h>
struct _KatzeNet
{
static void
katze_net_init (KatzeNet* net)
{
- static SoupSession* session = NULL;
-
net->memory = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, katze_net_object_maybe_unref);
net->cache_path = g_build_filename (g_get_user_cache_dir (),
PACKAGE_NAME, NULL);
- if (!session)
- session = soup_session_async_new ();
- net->session = session;
+ net->session = webkit_get_default_session ();
}
static void
obj.includes = '. ../.'
obj.find_sources_in_dirs ('.')
obj.add_marshal_file ('marshal.list', 'katze_cclosure_marshal')
-obj.uselib = 'M GMODULE LIBSOUP GTK LIBXML'
+obj.uselib = 'M GMODULE LIBSOUP GTK LIBXML WEBKIT'
obj.install_path = None
{
MidoriWebSettings* settings = MIDORI_WEB_SETTINGS (data);
SoupSession* webkit_session;
- KatzeNet* net;
- SoupSession* s_session;
SoupCookieJar* jar;
webkit_session = webkit_get_default_session ();
- net = katze_net_new ();
- s_session = katze_net_get_session (net);
jar = soup_cookie_jar_new ();
g_object_set_data (G_OBJECT (jar), "midori-settings", settings);
- midori_soup_session_prepare (s_session, jar, settings);
midori_soup_session_prepare (webkit_session, jar, settings);
g_object_unref (jar);
- g_object_unref (net);
return FALSE;
}
return 1;
}
- /* libSoup uses threads, therefore if WebKit is built with libSoup
- or Midori is using it, we need to initialize threads. */
+ /* libSoup uses threads, so we need to initialize threads. */
if (!g_thread_supported ()) g_thread_init (NULL);
sokoke_register_stock_items ();
g_set_application_name (_("Midori"));