[libgdata] [core] Added GNOME support for automagical proxy use



commit 3cd11c1bbc1e4f6e9ddbb62505f32f012efbd86a
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed May 6 21:16:43 2009 +0100

    [core] Added GNOME support for automagical proxy use
---
 configure.in          |   13 +++++++++++++
 gdata/Makefile.am     |    2 ++
 gdata/gdata-service.c |    8 ++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 8548332..8f4f031 100644
--- a/configure.in
+++ b/configure.in
@@ -55,6 +55,19 @@ PKG_CHECK_MODULES(GDATA, [$pkg_modules])
 AC_SUBST(GDATA_CFLAGS)
 AC_SUBST(GDATA_LIBS)
 
+# GNOME support, which pulls in libsoup-gnome-2.4 to provide transparent proxy support
+AC_MSG_CHECKING(whether to build with GNOME support)
+AC_ARG_ENABLE(gnome, AS_HELP_STRING([--enable-gnome], [Whether to enable GNOME support]),, enable_gnome=yes)
+AC_MSG_RESULT($enable_gnome)
+
+if test "x$enable_gnome" = "xyes"; then
+	AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
+	PKG_CHECK_MODULES(GNOME, [libsoup-gnome-2.4])
+fi
+
+AC_SUBST(GNOME_CFLAGS)
+AC_SUBST(GNOME_LIBS)
+
 GNOME_COMMON_INIT
 GNOME_DEBUG_CHECK
 GNOME_COMPILE_WARNINGS([maximum])
diff --git a/gdata/Makefile.am b/gdata/Makefile.am
index e3b3f4d..8551fdc 100644
--- a/gdata/Makefile.am
+++ b/gdata/Makefile.am
@@ -80,12 +80,14 @@ libgdata_la_CPPFLAGS = \
 
 libgdata_la_CFLAGS = \
 	$(GDATA_CFLAGS)			\
+	$(GNOME_CFLAGS)			\
 	$(WARN_CFLAGS)			\
 	$(AM_CFLAGS)			\
 	-D_GNU_SOURCE
 
 libgdata_la_LIBADD = \
 	$(GDATA_LIBS)	\
+	$(GNOME_LIBS)	\
 	services/youtube/libgdatayoutube.la	\
 	services/calendar/libgdatacalendar.la	\
 	services/contacts/libgdatacontacts.la
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 0087314..b883d91 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -34,6 +34,10 @@
 #include <libsoup/soup.h>
 #include <string.h>
 
+#ifdef HAVE_GNOME
+#include <libsoup/soup-gnome-features.h>
+#endif /* HAVE_GNOME */
+
 #include "gdata-service.h"
 #include "gdata-private.h"
 #include "gdata-marshal.h"
@@ -195,6 +199,10 @@ gdata_service_init (GDataService *self)
 	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_SERVICE, GDataServicePrivate);
 	self->priv->session = soup_session_sync_new ();
 
+#ifdef HAVE_GNOME
+	soup_session_add_feature_by_type (self->priv->session, SOUP_TYPE_GNOME_FEATURES_2_26);
+#endif /* HAVE_GNOME */
+
 	/* Proxy the SoupSession's proxy-uri property */
 	g_signal_connect (self->priv->session, "notify::proxy-uri", (GCallback) notify_proxy_uri_cb, self);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]