[frogr] Stop using libsoup-gnome to allow using the default proxy



commit ccc81ddefbaf4b6939da53d2a9b47453a600371e
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat May 24 21:22:48 2014 +0900

    Stop using libsoup-gnome to allow using the default proxy
    
    Since libsoup 2.34, there's no need to use libsoup-gnome (which is
    now deprecated) to use the system proxy, so we don't need to include
    this headers nor to link against this library anymore.

 configure.ac                |   45 ++++--------------------------------------
 debian/control              |    2 +-
 src/flicksoup/fsp-parser.c  |    5 ----
 src/flicksoup/fsp-session.c |   19 ------------------
 src/frogr-config.c          |   11 ----------
 src/frogr-controller.c      |    2 +
 src/frogr-settings-dialog.c |   18 +----------------
 7 files changed, 9 insertions(+), 93 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 71ffb5c..2665ee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,11 @@ PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= $GTK3_MIN_VERSION)
 FROGR_CFLAGS=$GTK3_CFLAGS
 FROGR_LIBS=$GTK3_LIBS
 
+LIBSOUP_MIN_VERSION=2.34
+PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_MIN_VERSION])
+FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
+FROGR_LIBS="$FROGR_LIBS $LIBSOUP_LIBS"
+
 EXIF_MIN_VERSION=0.6.14
 PKG_CHECK_MODULES(EXIF, libexif >= $EXIF_MIN_VERSION)
 FROGR_CFLAGS="$FROGR_CFLAGS $EXIF_CFLAGS"
@@ -60,45 +65,6 @@ else
 fi
 AM_CONDITIONAL([PLATFORM_MAC],[test "x$osx" = "xyes"])
 
-# Decide whether to use libsoup or libsoup-gnome (if available)
-LIBSOUP_MIN_VERSION=2.34
-if test "x$platform" = "xGNOME"; then
-   # For the GNOME platform allow using libsoup-gnome, if available
-   AC_ARG_WITH([libsoup],
-           [AS_HELP_STRING([--with-libsoup=plain|gnome], [libsoup variant to use (default: gnome)])],
-           [case "$with_libsoup" in
-           plain|gnome) ;;
-           *) AC_MSG_ERROR([Wrong libsoup variant]) ;;
-           esac],
-           [with_libsoup=gnome])
-else
-   # Other non-GNOME platforms (e.g. MacOSX) to support plain libsoup only
-   with_libsoup=plain
-fi
-
-if test "x$with_libsoup" = "xgnome"; then
-   AC_MSG_CHECKING([libsoup variant to use])
-   PKG_CHECK_MODULES(LIBSOUP_GNOME,
-                     [libsoup-gnome-2.4 >= $LIBSOUP_MIN_VERSION],
-                     [have_libsoup_gnome="yes"], [have_libsoup_gnome="no"])
-
-   if test "x$have_libsoup_gnome" = "xyes"; then
-      LIBSOUP_CFLAGS="$LIBSOUP_GNOME_CFLAGS"
-      LIBSOUP_LIBS="$LIBSOUP_GNOME_LIBS"
-
-      AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Have libsoup-gnome])
-   else
-      with_libsoup=plain
-   fi
-fi
-
-if test "x$with_libsoup" = "xplain"; then
-   PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_MIN_VERSION])
-fi
-
-FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
-FROGR_LIBS="$FROGR_LIBS $LIBSOUP_LIBS"
-
 # Debug mode
 AC_MSG_CHECKING([Checking whether to enable debug output])
 AC_ARG_ENABLE(debug,
@@ -180,7 +146,6 @@ echo ""
 echo "Build configuration:"
 echo "  Platform              : $platform"
 echo "  Debug symbols         : $enable_debug"
-echo "  Using libsoup variant : $with_libsoup"
 echo ""
 echo "Optional features:"
 echo "  Enable video uploads  : $video_feature"
diff --git a/debian/control b/debian/control
index aa12b15..cc5c0ed 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: frogr
 Section: graphics
 Priority: optional
 Maintainer: Mario Sanchez Prada <msanchez gnome org>
-Build-Depends: cdbs, debhelper (>= 5), yelp-tools, intltool, libexif-dev (>= 0.6.14), libgcrypt11-dev, 
libglib2.0-dev (>= 2.32), libgstreamer0.10-dev | libgstreamer1.0-dev, libgtk-3-dev (>= 3.4), libjson-glib-dev 
(>= 0.12), libsoup-gnome2.4-dev (>= 2.34), libsoup2.4-dev (>= 2.34), libxml2-dev (>= 2.6.8)
+Build-Depends: cdbs, debhelper (>= 5), yelp-tools, intltool, libexif-dev (>= 0.6.14), libgcrypt11-dev, 
libglib2.0-dev (>= 2.32), libgstreamer0.10-dev | libgstreamer1.0-dev, libgtk-3-dev (>= 3.4), libjson-glib-dev 
(>= 0.12), libsoup2.4-dev (>= 2.34), libxml2-dev (>= 2.6.8)
 Standards-Version: 3.7.3
 Homepage: http://live.gnome.org/Apps/Frogr
 
diff --git a/src/flicksoup/fsp-parser.c b/src/flicksoup/fsp-parser.c
index 5dcad51..35a28a4 100644
--- a/src/flicksoup/fsp-parser.c
+++ b/src/flicksoup/fsp-parser.c
@@ -22,12 +22,7 @@
 
 #include "fsp-error.h"
 
-#ifdef HAVE_LIBSOUP_GNOME
-#include <libsoup/soup-gnome.h>
-#else
 #include <libsoup/soup.h>
-#endif
-
 #include <libxml/parser.h>
 #include <libxml/xpath.h>
 
diff --git a/src/flicksoup/fsp-session.c b/src/flicksoup/fsp-session.c
index 787f86c..7f5399b 100644
--- a/src/flicksoup/fsp-session.c
+++ b/src/flicksoup/fsp-session.c
@@ -27,13 +27,7 @@
 
 #include <config.h>
 #include <gcrypt.h>
-
-#ifdef HAVE_LIBSOUP_GNOME
-#include <libsoup/soup-gnome.h>
-#else
 #include <libsoup/soup.h>
-#endif
-
 #include <stdarg.h>
 #include <string.h>
 
@@ -1659,14 +1653,10 @@ fsp_session_set_http_proxy              (FspSession *self,
                                          const char *username, const char *password)
 {
   SoupURI *proxy_uri = NULL;
-
-#ifdef HAVE_LIBSOUP_GNOME
   gboolean using_gnome_proxy_before = FALSE;
-#endif
 
   g_return_val_if_fail (FSP_IS_SESSION (self), FALSE);
 
-#ifdef HAVE_LIBSOUP_GNOME
   /* We're gonna need this to make a good decision later */
   using_gnome_proxy_before = self->priv->using_gnome_proxy;
 
@@ -1683,10 +1673,6 @@ fsp_session_set_http_proxy              (FspSession *self,
                          SOUP_TYPE_PROXY_RESOLVER_DEFAULT);
     }
   self->priv->using_gnome_proxy = use_gnome_proxy;
-#else
-  /* Just ignore the using_gnome_proxy parameter in this case */
-  self->priv->using_gnome_proxy = FALSE;
-#endif
 
   if (!self->priv->using_gnome_proxy)
     {
@@ -1744,12 +1730,7 @@ fsp_session_set_http_proxy              (FspSession *self,
       return TRUE;
     }
 
-#ifdef HAVE_LIBSOUP_GNOME
   return using_gnome_proxy_before != use_gnome_proxy;
-#else
-  /* Proxy configuration has not changed */
-  return FALSE;
-#endif
 }
 
 const gchar *
diff --git a/src/frogr-config.c b/src/frogr-config.c
index a3f7cec..95a2270 100644
--- a/src/frogr-config.c
+++ b/src/frogr-config.c
@@ -1525,13 +1525,7 @@ frogr_config_set_use_gnome_proxy (FrogrConfig *self, gboolean value)
   g_return_if_fail (FROGR_IS_CONFIG (self));
 
   priv = FROGR_CONFIG_GET_PRIVATE (self);
-
-#ifdef HAVE_LIBSOUP_GNOME
   priv->use_gnome_proxy = value;
-#else
-  /* Always set it to false if not using libsoup */
-  priv->use_gnome_proxy = FALSE;
-#endif
 }
 
 gboolean
@@ -1541,11 +1535,6 @@ frogr_config_get_use_gnome_proxy (FrogrConfig *self)
 
   g_return_val_if_fail (FROGR_IS_CONFIG (self), FALSE);
 
-#ifndef HAVE_LIBSOUP_GNOME
-  /* Always return false if not using libsoup */
-  return FALSE;
-#endif
-
   priv = FROGR_CONFIG_GET_PRIVATE (self);
   return priv->use_gnome_proxy;
 }
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 14a887b..108f618 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -373,6 +373,8 @@ _g_application_startup_cb (GApplication *app, gpointer data)
       frogr_controller_set_proxy (self, use_gnome_proxy,
                                   host, port, username, password);
     }
+  else
+      frogr_controller_set_proxy (self, FALSE, NULL, NULL, NULL, NULL);
 }
 
 static void
diff --git a/src/frogr-settings-dialog.c b/src/frogr-settings-dialog.c
index 90dd4d5..7c56b13 100644
--- a/src/frogr-settings-dialog.c
+++ b/src/frogr-settings-dialog.c
@@ -426,15 +426,12 @@ _add_connection_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
   gtk_grid_attach (GTK_GRID (grid), entry, 1, 3, 1, 1);
   priv->proxy_password_entry = entry;
 
-#ifdef HAVE_LIBSOUP_GNOME
-
   /* Use GNOME General Proxy Settings */
 
   cbutton = gtk_check_button_new_with_mnemonic (_("_Use GNOME General Proxy Settings"));
   gtk_widget_set_hexpand (GTK_WIDGET (cbutton), TRUE);
   gtk_grid_attach (GTK_GRID (grid), cbutton, 1, 4, 1, 1);
   priv->use_gnome_proxy_cb = cbutton;
-#endif
 
   gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
 
@@ -443,11 +440,9 @@ _add_connection_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
                     G_CALLBACK (_on_button_toggled),
                     self);
 
-#ifdef HAVE_LIBSOUP_GNOME
   g_signal_connect (G_OBJECT (priv->use_gnome_proxy_cb), "toggled",
                     G_CALLBACK (_on_button_toggled),
                     self);
-#endif
 
   g_signal_connect (G_OBJECT (priv->proxy_port_entry), "insert-text",
                     G_CALLBACK (_proxy_port_inserted_cb),
@@ -529,9 +524,7 @@ _fill_dialog_with_data (FrogrSettingsDialog *self)
   priv->import_tags = frogr_config_get_import_tags_from_metadata (priv->config);
   priv->use_dark_theme = frogr_config_get_use_dark_theme (priv->config);
   priv->use_proxy = frogr_config_get_use_proxy (priv->config);
-#ifdef HAVE_LIBSOUP_GNOME
   priv->use_gnome_proxy = frogr_config_get_use_gnome_proxy (priv->config);
-#endif
 
   g_free (priv->proxy_host);
   priv->proxy_host = g_strdup (frogr_config_get_proxy_host (priv->config));
@@ -597,10 +590,8 @@ _fill_dialog_with_data (FrogrSettingsDialog *self)
                                 priv->use_dark_theme);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->use_proxy_cb),
                                 priv->use_proxy);
-#ifdef HAVE_LIBSOUP_GNOME
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->use_gnome_proxy_cb),
                                 priv->use_gnome_proxy);
-#endif
 
   if (priv->proxy_host)
     gtk_entry_set_text (GTK_ENTRY (priv->proxy_host_entry), priv->proxy_host);
@@ -641,9 +632,7 @@ _save_data (FrogrSettingsDialog *self)
   frogr_config_set_use_dark_theme (priv->config, priv->use_dark_theme);
 
   frogr_config_set_use_proxy (priv->config, priv->use_proxy);
-#ifdef HAVE_LIBSOUP_GNOME
   frogr_config_set_use_gnome_proxy (priv->config, priv->use_gnome_proxy);
-#endif
 
   g_free (priv->proxy_host);
   priv->proxy_host = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->proxy_host_entry)));
@@ -691,11 +680,8 @@ _update_ui (FrogrSettingsDialog *self)
 
   /* Sensititveness of proxy settings related widgets */
 
-#ifdef HAVE_LIBSOUP_GNOME
-  gtk_widget_set_sensitive (priv->use_gnome_proxy_cb, priv->use_proxy);
-#endif
-
   using_manual_proxy = priv->use_proxy && !priv->use_gnome_proxy;
+  gtk_widget_set_sensitive (priv->use_gnome_proxy_cb, priv->use_proxy);
   gtk_widget_set_sensitive (priv->proxy_host_label, using_manual_proxy);
   gtk_widget_set_sensitive (priv->proxy_host_entry, using_manual_proxy);
   gtk_widget_set_sensitive (priv->proxy_port_label, using_manual_proxy);
@@ -813,13 +799,11 @@ _on_button_toggled (GtkToggleButton *button, gpointer data)
       DEBUG ("Enable HTTP Proxy: %s", active ? "YES" : "NO");
     }
 
-#ifdef HAVE_LIBSOUP_GNOME
   if (GTK_WIDGET (button) == priv->use_gnome_proxy_cb)
     {
       priv->use_gnome_proxy = active;
       DEBUG ("Use GNOME General Proxy Settings: %s", active ? "YES" : "NO");
     }
-#endif
 
   _update_ui (self);
 }


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