[glib-networking] proxy: Use child schemas to get the proxy settings
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] proxy: Use child schemas to get the proxy settings
- Date: Thu, 25 Aug 2011 21:46:46 +0000 (UTC)
commit c1e734c0bee7b30f48ed612d25a0a515c74f7403
Author: Christian Persch <chpe gnome org>
Date: Mon Mar 21 19:26:24 2011 +0100
proxy: Use child schemas to get the proxy settings
Instead of constructing the schemas directly, use g_settings_get_child().
Bug #645436.
proxy/gnome/gproxyresolvergnome.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c
index b49a32f..fadc111 100644
--- a/proxy/gnome/gproxyresolvergnome.c
+++ b/proxy/gnome/gproxyresolvergnome.c
@@ -33,7 +33,7 @@
#define GNOME_PROXY_IGNORE_HOSTS_KEY "ignore-hosts"
#define GNOME_PROXY_USE_SAME_PROXY_KEY "use-same-proxy"
-#define GNOME_PROXY_HTTP_SETTINGS_SCHEMA "org.gnome.system.proxy.http"
+#define GNOME_PROXY_HTTP_CHILD_SCHEMA "http"
#define GNOME_PROXY_HTTP_ENABLED_KEY "enabled"
#define GNOME_PROXY_HTTP_HOST_KEY "host"
#define GNOME_PROXY_HTTP_PORT_KEY "port"
@@ -41,15 +41,15 @@
#define GNOME_PROXY_HTTP_USER_KEY "authentication-user"
#define GNOME_PROXY_HTTP_PASSWORD_KEY "authentication-password"
-#define GNOME_PROXY_HTTPS_SETTINGS_SCHEMA "org.gnome.system.proxy.https"
+#define GNOME_PROXY_HTTPS_CHILD_SCHEMA "https"
#define GNOME_PROXY_HTTPS_HOST_KEY "host"
#define GNOME_PROXY_HTTPS_PORT_KEY "port"
-#define GNOME_PROXY_FTP_SETTINGS_SCHEMA "org.gnome.system.proxy.ftp"
+#define GNOME_PROXY_FTP_CHILD_SCHEMA "ftp"
#define GNOME_PROXY_FTP_HOST_KEY "host"
#define GNOME_PROXY_FTP_PORT_KEY "port"
-#define GNOME_PROXY_SOCKS_SETTINGS_SCHEMA "org.gnome.system.proxy.socks"
+#define GNOME_PROXY_SOCKS_CHILD_SCHEMA "socks"
#define GNOME_PROXY_SOCKS_HOST_KEY "host"
#define GNOME_PROXY_SOCKS_PORT_KEY "port"
@@ -172,16 +172,20 @@ g_proxy_resolver_gnome_init (GProxyResolverGnome *resolver)
resolver->proxy_settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
g_signal_connect (resolver->proxy_settings, "changed",
G_CALLBACK (gsettings_changed), resolver);
- resolver->http_settings = g_settings_new (GNOME_PROXY_HTTP_SETTINGS_SCHEMA);
+ resolver->http_settings = g_settings_get_child (resolver->proxy_settings,
+ GNOME_PROXY_HTTP_CHILD_SCHEMA);
g_signal_connect (resolver->http_settings, "changed",
G_CALLBACK (gsettings_changed), resolver);
- resolver->https_settings = g_settings_new (GNOME_PROXY_HTTPS_SETTINGS_SCHEMA);
+ resolver->https_settings = g_settings_get_child (resolver->proxy_settings,
+ GNOME_PROXY_HTTPS_CHILD_SCHEMA);
g_signal_connect (resolver->https_settings, "changed",
G_CALLBACK (gsettings_changed), resolver);
- resolver->ftp_settings = g_settings_new (GNOME_PROXY_FTP_SETTINGS_SCHEMA);
+ resolver->ftp_settings = g_settings_get_child (resolver->proxy_settings,
+ GNOME_PROXY_FTP_CHILD_SCHEMA);
g_signal_connect (resolver->ftp_settings, "changed",
G_CALLBACK (gsettings_changed), resolver);
- resolver->socks_settings = g_settings_new (GNOME_PROXY_SOCKS_SETTINGS_SCHEMA);
+ resolver->socks_settings = g_settings_get_child (resolver->proxy_settings,
+ GNOME_PROXY_SOCKS_CHILD_SCHEMA);
g_signal_connect (resolver->socks_settings, "changed",
G_CALLBACK (gsettings_changed), resolver);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]