[gtkhtml] ** BUGFIX:584762 - support cookies if libsoup>2.26



commit 1e95a4e609cce84563ce88bd44d19e54dd23b299
Author: Denis Pauk <pauk denis gmail com>
Date:   Mon Jun 15 11:11:08 2009 +0530

    ** BUGFIX:584762 - support cookies if libsoup>2.26
    
    Add support cookies if installed soup > 2.26
    * Makefile.am: add option HAVE_NEWSOUP
    * testgtkhtml.c: ifdef HAVE_NEWSOUP
    		enable support cookies in soup

 configure.ac          |   41 +++++++++++++++++++++++++++++++++++++----
 gtkhtml/ChangeLog     |    8 ++++++++
 gtkhtml/Makefile.am   |    9 ++++++---
 gtkhtml/testgtkhtml.c |    8 ++++++++
 4 files changed, 59 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ef983aa..a4cb00e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,27 @@ AC_SUBST(WARNING_FLAGS)
 
 CFLAGS="$CFLAGS $WARNING_FLAGS"
 
+AC_C_INLINE
+AC_FUNC_ALLOCA
+AC_FUNC_MALLOC
+AC_PROG_CXX
+AC_PROG_RANLIB
+AC_TYPE_SIZE_T
+
+AC_CHECK_FUNCS([memchr])
+AC_CHECK_FUNCS([memmove])
+AC_CHECK_FUNCS([memset])
+AC_CHECK_FUNCS([regcomp])
+AC_CHECK_FUNCS([setlocale])
+AC_CHECK_FUNCS([strchr])
+AC_CHECK_FUNCS([strcspn])
+AC_CHECK_FUNCS([strrchr])
+AC_CHECK_FUNCS([strstr])
+AC_CHECK_FUNCS([strtol])
+AC_CHECK_FUNCS([strtoull])
+AC_CHECK_HEADERS([fcntl.h])
+AC_CHECK_HEADERS([libintl.h])
+
 AC_ISC_POSIX
 AC_PROG_CC
 AC_STDC_HEADERS
@@ -131,10 +152,21 @@ dnl **********************************
 dnl soup for testgtkhtml
 dnl **********************************
 
-PKG_CHECK_MODULES(SOUP, libsoup-2.4, have_soup="yes", have_soup="no")
+HAVE_NEWSOUP="no"
+have_newsoup="no"
+PKG_CHECK_MODULES(SOUP, libsoup-2.4  >= 2.26.0,
+  [
+    HAVE_NEWSOUP="yes"
+    have_soup="yes"
+  ],
+  [
+    PKG_CHECK_MODULES(SOUP, libsoup-2.4,
+	have_soup="yes",
+	have_soup="no")
+  ])
+AC_SUBST(HAVE_NEWSOUP)
 AM_CONDITIONAL(HAVE_SOUP, test x$have_soup != xno)
-AC_SUBST(SOUP_CFLAGS)
-AC_SUBST(SOUP_LIBS)
+AM_CONDITIONAL(HAVE_NEWSOUP, test x$HAVE_NEWSOUP != xno)
 
 dnl **************************************************
 dnl * Gnome Icon Theme
@@ -244,5 +276,6 @@ echo "
 
 Configuration:
 
-	Editor component type:		${GNOME_GTKHTML_EDITOR_TYPE}
+	Cookies support in soup :		${HAVE_NEWSOUP}
+	Editor component type   :		${GNOME_GTKHTML_EDITOR_TYPE}
 "
diff --git a/gtkhtml/ChangeLog b/gtkhtml/ChangeLog
index ca45a91..911ff69 100644
--- a/gtkhtml/ChangeLog
+++ b/gtkhtml/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-04  Denis Pauk  <pauk denis gmail com>
+
+	** Fix for bug #584762
+
+	* Makefile.am: add option HAVE_NEWSOUP
+	* testgtkhtml.c: ifdef HAVE_NEWSOUP 
+		enable support cookies in soup 
+	
 2009-04-10  Milan Crha  <mcrha redhat com>
 
 	** Fix for bug #494986
diff --git a/gtkhtml/Makefile.am b/gtkhtml/Makefile.am
index 26372cc..f9de6fa 100644
--- a/gtkhtml/Makefile.am
+++ b/gtkhtml/Makefile.am
@@ -7,7 +7,10 @@ endif
 NULL=
 
 gtkhtml_data = $(datadir)/gtkhtml- GTKHTML_API_VERSION@
-gladedir = $(gtkhtml_data)
+
+if HAVE_NEWSOUP
+have_new_soup = -DHAVE_NEWSOUP
+endif
 
 INCLUDES = 				\
 	-I$(top_srcdir)			\
@@ -16,7 +19,8 @@ INCLUDES = 				\
 	$(GTKHTML_CFLAGS)		\
 	$(SOUP_CFLAGS)			\
 	$(I18N_LIB_CFLAGS)		\
-	-DG_LOG_DOMAIN=\"gtkhtml\"
+	-DG_LOG_DOMAIN=\"gtkhtml\"	\
+	${have_new_soup}
 
 AM_CFLAGS = 						\
 	-DPREFIX=\""$(prefix)"\"			\
@@ -25,7 +29,6 @@ AM_CFLAGS = 						\
 	-DSYSCONFDIR=\""$(sysconfdir)"\"		\
 	-DICONDIR=\"$(gtkhtml_data)/icons\"		\
 	-DGTKHTML_DATADIR=\""$(gtkhtml_data)"\"		\
-	-DGLADE_DATADIR=\"$(gladedir)\"			\
 	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
 
 lib_LTLIBRARIES = libgtkhtml-3.14.la
diff --git a/gtkhtml/testgtkhtml.c b/gtkhtml/testgtkhtml.c
index e4cf650..c8a0aaf 100644
--- a/gtkhtml/testgtkhtml.c
+++ b/gtkhtml/testgtkhtml.c
@@ -1182,6 +1182,9 @@ main (gint argc, gchar *argv[])
 	GtkActionGroup *action_group;
 	GtkUIManager *merge;
 	GError *error = NULL;
+#ifdef HAVE_NEWSOUP
+	SoupCookieJar *cookie_jar;
+#endif
 
 #ifdef MEMDEBUG
 	gpointer p = malloc (1024);	/* to make linker happy with ccmalloc */
@@ -1311,6 +1314,11 @@ main (gint argc, gchar *argv[])
 
 	session = soup_session_async_new ();
 
+#ifdef HAVE_NEWSOUP
+	cookie_jar = soup_cookie_jar_text_new ("./cookies.txt", FALSE);
+	soup_session_add_feature (session, SOUP_SESSION_FEATURE (cookie_jar));
+#endif
+
 	if (argc > 1 && *argv [argc - 1] != '-')
 		goto_url (argv [argc - 1], 0);
 



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