From 52374325464ffda9fb7fd1381362490d3bafba4b Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Tue, 27 Dec 2005 03:45:05 +0000 Subject: [PATCH] Bug 280742 ignore_host GCONF key is not read in firefox proxy settings patch by alfred.peng@sun.com r=timeless sr=roc --- .../system-pref/src/gconf/gconf_pref_list.inc | 2 +- .../src/gconf/nsSystemPrefService.cpp | 37 ++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc b/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc index 25b07430f53..4e4973c6980 100644 --- a/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc +++ b/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc @@ -13,7 +13,7 @@ {"network.proxy.ssl_port", "/system/proxy/secure_port"}, {"network.proxy.socks", "/system/proxy/socks_host"}, {"network.proxy.socks_port", "/system/proxy/socks_port"}, - {"network.proxy.no_proxies_on", "/system/proxy/ignore_hosts"}, + {"network.proxy.no_proxies_on", "/system/http_proxy/ignore_hosts"}, {"network.proxy.autoconfig_url", "/system/proxy/autoconfig_url"}, {"network.proxy.type", "/system/proxy/mode"}, {"config.use_system_prefs.accessibility", "/desktop/gnome/interface/accessibility"}, diff --git a/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp b/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp index efac6dd21b8..cba8b4948eb 100644 --- a/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp +++ b/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp @@ -87,6 +87,9 @@ extern "C" { GError **err); typedef PRInt32 (*GConfClientGetIntType) (void *client, const gchar *key, GError **err); + typedef GSList* (*GConfClientGetListType) (void *client, const gchar *key, + GConfValueType list_type, + GError **err); typedef void (*GConfClientNotifyFuncType) (void* client, guint cnxn_id, void *entry, gpointer user_data); @@ -170,6 +173,7 @@ private: GConfClientGetBoolType GConfClientGetBool; GConfClientGetStringType GConfClientGetString; GConfClientGetIntType GConfClientGetInt; + GConfClientGetListType GConfClientGetList; GConfClientNotifyAddType GConfClientNotifyAdd; GConfClientNotifyRemoveType GConfClientNotifyRemove; GConfClientAddDirType GConfClientAddDir; @@ -563,6 +567,7 @@ GCONF_FUNCS_POINTER_BEGIN GCONF_FUNCS_POINTER_ADD("gconf_value_get_bool") //10 GCONF_FUNCS_POINTER_ADD("gconf_value_get_string") //11 GCONF_FUNCS_POINTER_ADD("gconf_value_get_int") //12 + GCONF_FUNCS_POINTER_ADD("gconf_client_get_list") //13 GCONF_FUNCS_POINTER_END ///////////////////////////////////////////////////////////////////////////// @@ -689,12 +694,30 @@ GConfProxy::GetCharPref(const char *aMozKey, char **retval) { NS_ENSURE_TRUE(mInitialized, NS_ERROR_FAILURE); - gchar *str = GConfClientGetString(mGConfClient, - MozKey2GConfKey(aMozKey), NULL); - if (str) { - *retval = PL_strdup(str); - g_free(str); + const gchar *gconfkey = MozKey2GConfKey(aMozKey); + + if (!strcmp (aMozKey, "network.proxy.no_proxies_on")) { + GSList *s; + nsCString noproxy; + GSList *gslist = GConfClientGetList(mGConfClient, gconfkey, + GCONF_VALUE_STRING, NULL); + + for (s = gslist; s; s = g_slist_next(s)) { + noproxy += (char *)s->data; + noproxy += ", "; + g_free ((char *)s->data); + } + g_slist_free (gslist); + + *retval = PL_strdup(noproxy.get()); + } else { + gchar *str = GConfClientGetString(mGConfClient, gconfkey, NULL); + if (str) { + *retval = PL_strdup(str); + g_free (str); + } } + return NS_OK; } @@ -815,6 +838,10 @@ GConfProxy::InitFuncPtrs() GConfValueGetBool = (GConfValueGetBoolType) sGConfFuncList[10].FuncPtr; GConfValueGetString = (GConfValueGetStringType) sGConfFuncList[11].FuncPtr; GConfValueGetInt = (GConfValueGetIntType) sGConfFuncList[12].FuncPtr; + + //gconf client list func + GConfClientGetList = + (GConfClientGetListType) sGConfFuncList[13].FuncPtr; } void