[glib-networking] gnome: improve session detection.



commit 1b1e3334e5962d0afb97b86e09ba14919223dae9
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat May 18 23:57:55 2013 +0200

    gnome: improve session detection.
    
    Detect anything beginning with "gnome". Handles gnome-classic,
    and custom gnome-jhbuild or similar sessions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700607

 proxy/gnome/gproxyresolvergnome.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c
index 724455f..3a7e82e 100644
--- a/proxy/gnome/gproxyresolvergnome.c
+++ b/proxy/gnome/gproxyresolvergnome.c
@@ -313,8 +313,14 @@ update_settings (GProxyResolverGnome *resolver)
 static gboolean
 g_proxy_resolver_gnome_is_supported (GProxyResolver *object)
 {
-  return !g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "gnome") ||
-         !g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "ubuntu");
+  const char *session;
+
+  session = g_getenv ("DESKTOP_SESSION");
+  if (session == NULL)
+    return FALSE;
+
+  return g_str_has_prefix (session, "gnome") ||
+         strcmp (session, "ubuntu") == 0;
 }
 
 static inline gchar **


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