Perform more fine grained libSoup version checks

This commit is contained in:
Christian Dywan 2008-12-09 20:04:04 +01:00
parent 89ac82d0d6
commit 270822a0c4
3 changed files with 9 additions and 3 deletions

View file

@ -1276,7 +1276,7 @@ cookie_jar_changed_cb (SoupCookieJar* jar,
} }
#endif #endif
#if HAVE_LIBSOUP #if HAVE_LIBSOUP_2_23_1
/* The following code hooks up to any created cookie jar in order to /* The following code hooks up to any created cookie jar in order to
load and save cookies. This is *not* a generally advisable technique load and save cookies. This is *not* a generally advisable technique
but merely a preliminary workaround until WebKit exposes its but merely a preliminary workaround until WebKit exposes its
@ -1606,7 +1606,7 @@ main (int argc,
return 1; return 1;
} }
#if HAVE_LIBSOUP #if HAVE_LIBSOUP_2_23_1
/* This is a nasty trick that allows us to manipulate cookies /* This is a nasty trick that allows us to manipulate cookies
even without having a pointer to the jar. */ even without having a pointer to the jar. */
soup_cookie_jar_get_type (); soup_cookie_jar_get_type ();
@ -1618,6 +1618,8 @@ main (int argc,
old_jar_constructed_cb = G_OBJECT_CLASS (jar_class)->constructed; old_jar_constructed_cb = G_OBJECT_CLASS (jar_class)->constructed;
G_OBJECT_CLASS (jar_class)->constructed = cookie_jar_constructed_cb; 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 /* This is a nasty trick that allows us to manipulate preferences
even without having a pointer to the session. */ even without having a pointer to the session. */
soup_session_get_type (); soup_session_get_type ();

View file

@ -231,6 +231,7 @@ midori_preferences_notify_preferred_encoding_cb (MidoriWebSettings* settings,
gtk_widget_set_sensitive (entry, preferred_encoding == MIDORI_ENCODING_CUSTOM); gtk_widget_set_sensitive (entry, preferred_encoding == MIDORI_ENCODING_CUSTOM);
} }
#if HAVE_LIBSOUP_2_23_1
static void static void
midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings, midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings,
GParamSpec* pspec, GParamSpec* pspec,
@ -240,6 +241,7 @@ midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings,
gtk_widget_set_sensitive (entry, identify_as == MIDORI_IDENT_CUSTOM); gtk_widget_set_sensitive (entry, identify_as == MIDORI_IDENT_CUSTOM);
} }
#endif
#ifdef HAVE_OSX #ifdef HAVE_OSX
static void static void
@ -510,7 +512,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
WIDGET_ADD (button, 1, 2, 5, 6); WIDGET_ADD (button, 1, 2, 5, 6);
/* Page "Network" */ /* Page "Network" */
#if HAVE_LIBSOUP #if HAVE_LIBSOUP_2_23_1
/* If a cookie jar was created, WebKit is using Soup */ /* If a cookie jar was created, WebKit is using Soup */
if (g_type_get_qdata (SOUP_TYPE_COOKIE_JAR, if (g_type_get_qdata (SOUP_TYPE_COOKIE_JAR,
g_quark_from_static_string ("midori-has-jar"))) g_quark_from_static_string ("midori-has-jar")))

View file

@ -114,6 +114,8 @@ def configure (conf):
if option_enabled ('libsoup'): if option_enabled ('libsoup'):
conf.check_pkg ('libsoup-2.4', destvar='LIBSOUP', mandatory=False) 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', conf.check_pkg ('libsoup-2.4', destvar='LIBSOUP_2_25_2',
vnum='2.25.2', mandatory=False) vnum='2.25.2', mandatory=False)
libsoup = ['not available','yes'][conf.env['HAVE_LIBSOUP'] == 1] libsoup = ['not available','yes'][conf.env['HAVE_LIBSOUP'] == 1]