From 270822a0c49e3984c48722b418f1f50d8bca4eb9 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 9 Dec 2008 20:04:04 +0100 Subject: [PATCH] Perform more fine grained libSoup version checks --- midori/main.c | 6 ++++-- midori/midori-preferences.c | 4 +++- wscript | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/midori/main.c b/midori/main.c index 7a330ef3..4a268f59 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1276,7 +1276,7 @@ cookie_jar_changed_cb (SoupCookieJar* jar, } #endif -#if HAVE_LIBSOUP +#if HAVE_LIBSOUP_2_23_1 /* The following code hooks up to any created cookie jar in order to load and save cookies. This is *not* a generally advisable technique but merely a preliminary workaround until WebKit exposes its @@ -1606,7 +1606,7 @@ main (int argc, return 1; } - #if HAVE_LIBSOUP + #if HAVE_LIBSOUP_2_23_1 /* This is a nasty trick that allows us to manipulate cookies even without having a pointer to the jar. */ soup_cookie_jar_get_type (); @@ -1618,6 +1618,8 @@ main (int argc, 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 (); diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 7f419941..fc6d2aa3 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -231,6 +231,7 @@ midori_preferences_notify_preferred_encoding_cb (MidoriWebSettings* settings, gtk_widget_set_sensitive (entry, preferred_encoding == MIDORI_ENCODING_CUSTOM); } +#if HAVE_LIBSOUP_2_23_1 static void midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings, GParamSpec* pspec, @@ -240,6 +241,7 @@ midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings, gtk_widget_set_sensitive (entry, identify_as == MIDORI_IDENT_CUSTOM); } +#endif #ifdef HAVE_OSX static void @@ -510,7 +512,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, WIDGET_ADD (button, 1, 2, 5, 6); /* Page "Network" */ - #if HAVE_LIBSOUP + #if HAVE_LIBSOUP_2_23_1 /* If a cookie jar was created, WebKit is using Soup */ if (g_type_get_qdata (SOUP_TYPE_COOKIE_JAR, g_quark_from_static_string ("midori-has-jar"))) diff --git a/wscript b/wscript index 3ea523e0..441afc20 100644 --- a/wscript +++ b/wscript @@ -114,6 +114,8 @@ def configure (conf): if option_enabled ('libsoup'): conf.check_pkg ('libsoup-2.4', destvar='LIBSOUP', mandatory=False) + conf.check_pkg ('libsoup-2.4', destvar='LIBSOUP_2_23_1', + vnum='2.23.1', mandatory=False) conf.check_pkg ('libsoup-2.4', destvar='LIBSOUP_2_25_2', vnum='2.25.2', mandatory=False) libsoup = ['not available','yes'][conf.env['HAVE_LIBSOUP'] == 1]