[epiphany] Use new libsoup APIs



commit 6e16272c9bbe3f91ceb0d5656a6f913a59a0d29a
Author: Xan Lopez <xan igalia com>
Date:   Wed Dec 19 13:28:07 2012 +0100

    Use new libsoup APIs
    
    Drops dependency on libsoup-gnome, we now depend on libsoup 2.41.3

 configure.ac                |    4 ++--
 embed/ephy-embed-single.c   |   18 +++---------------
 embed/ephy-web-view.c       |    1 -
 lib/ephy-profile-migrator.c |    3 +--
 lib/ephy-web-app-utils.c    |    3 +--
 5 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2bbb34e..a1fc805 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,7 +87,7 @@ GTK_REQUIRED=3.5.2
 LIBXML_REQUIRED=2.6.12
 LIBXSLT_REQUIRED=1.1.7
 WEBKIT_GTK_REQUIRED=1.11.2
-LIBSOUP_GNOME_REQUIRED=2.39.6
+LIBSOUP_REQUIRED=2.41.3
 GNOME_DESKTOP_REQUIRED=2.91.2
 GNOME_KEYRING_REQUIRED=2.26.0
 GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
@@ -129,7 +129,7 @@ PKG_CHECK_MODULES([DEPENDENCIES], [
 		  libxml-2.0 >= $LIBXML_REQUIRED
 		  libxslt >= $LIBXSLT_REQUIRED
 		  $WEBKIT_GTK_PC_NAME >= $WEBKIT_GTK_REQUIRED
-		  libsoup-gnome-2.4 >= $LIBSOUP_GNOME_REQUIRED
+		  libsoup-2.4 >= $LIBSOUP_REQUIRED
 		  gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
 		  gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED
 		  gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index 67cdaac..425ee04 100644
--- a/embed/ephy-embed-single.c
+++ b/embed/ephy-embed-single.c
@@ -18,11 +18,6 @@
  *
  */
 
-/* These defines need to go at the top because config.h or ephy-embed-single.h
- * may include soup.
- */
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
-
 #include "config.h"
 #include "ephy-embed-single.h"
 
@@ -41,9 +36,6 @@
 
 #include <glib/gi18n.h>
 #include <gnome-keyring.h>
-#include <libsoup/soup-cache.h>
-#include <libsoup/soup-gnome.h>
-#include <libsoup/soup-requester.h>
 #ifdef HAVE_WEBKIT2
 #include <webkit2/webkit2.h>
 #else
@@ -444,7 +436,6 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
   char *cache_dir;
   char *favicon_db_path;
   EphyEmbedSinglePrivate *priv = single->priv;
-  SoupSessionFeature *requester;
   EphyEmbedShellMode mode;
 
   /* Initialise nspluginwrapper's plugins if available */
@@ -461,7 +452,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
 
   /* Store cookies in moz-compatible SQLite format */
   filename = g_build_filename (ephy_dot_dir (), "cookies.sqlite", NULL);
-  jar = soup_cookie_jar_sqlite_new (filename, FALSE);
+  jar = soup_cookie_jar_db_new (filename, FALSE);
   g_free (filename);
   cookie_policy = g_settings_get_string (EPHY_SETTINGS_WEB,
                                          EPHY_PREFS_WEB_COOKIES_POLICY);
@@ -471,8 +462,8 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
   soup_session_add_feature (session, SOUP_SESSION_FEATURE (jar));
   g_object_unref (jar);
 
-  /* Use GNOME proxy settings through libproxy */
-  soup_session_add_feature_by_type (session, SOUP_TYPE_PROXY_RESOLVER_GNOME);
+  /* Use GNOME proxy settings through libproxy. */
+  soup_session_add_feature_by_type (session, SOUP_TYPE_PROXY_RESOLVER_DEFAULT);
 
   mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
 
@@ -494,10 +485,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
                     single);
 
   /* about: URIs handler */
-  requester = SOUP_SESSION_FEATURE (soup_requester_new());
-  soup_session_add_feature (session, requester);
   soup_session_add_feature_by_type (session, EPHY_TYPE_REQUEST_ABOUT);
-  g_object_unref (requester);
 
   /* Initialize the favicon cache. */
   favicon_db_path = g_build_filename (g_get_user_data_dir (), g_get_prgname (), NULL);
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 332b9d4..e490c5d 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -51,7 +51,6 @@
 #include <glib/gstdio.h>
 #include <gnome-keyring.h>
 #include <gtk/gtk.h>
-#include <libsoup/soup-gnome.h>
 
 /**
  * SECTION:ephy-web-view
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index e757cbd..afa87c9 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -47,7 +47,6 @@
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 #include <gnome-keyring.h>
-#include <libsoup/soup-gnome.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
@@ -105,7 +104,7 @@ migrate_cookies (void)
     SoupCookieJar *txt, *sqlite;
 
     txt = soup_cookie_jar_text_new (src_txt, TRUE);
-    sqlite = soup_cookie_jar_sqlite_new (dest, FALSE);
+    sqlite = soup_cookie_jar_db_new (dest, FALSE);
     cookies = soup_cookie_jar_all_cookies (txt);
 
     for (p = cookies; p; p = p->next) {
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 203a771..e315174 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -26,7 +26,6 @@
 #include "ephy-file-helpers.h"
 
 #include <glib/gstdio.h>
-#include <libsoup/soup-gnome.h>
 #ifdef HAVE_WEBKIT2
 #include <webkit2/webkit2.h>
 #else
@@ -525,7 +524,7 @@ create_cookie_jar_for_domain (const char *address, const char *directory)
 
   /* Create the new cookie jar */
   filename = g_build_filename (directory, "cookies.sqlite", NULL);
-  new_jar = (SoupCookieJar*)soup_cookie_jar_sqlite_new (filename, FALSE);
+  new_jar = (SoupCookieJar*)soup_cookie_jar_db_new (filename, FALSE);
   g_free (filename);
 
   /* The app domain for the current view */



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