Bug 280742 ignore_host GCONF key is not read in firefox proxy settings

patch by alfred.peng@sun.com r=timeless sr=roc
This commit is contained in:
timeless%mozdev.org 2005-12-27 03:45:05 +00:00
Родитель bdd0cf228c
Коммит fd6f59e43e
2 изменённых файлов: 33 добавлений и 6 удалений

Просмотреть файл

@ -13,7 +13,7 @@
{"network.proxy.ssl_port", "/system/proxy/secure_port"}, {"network.proxy.ssl_port", "/system/proxy/secure_port"},
{"network.proxy.socks", "/system/proxy/socks_host"}, {"network.proxy.socks", "/system/proxy/socks_host"},
{"network.proxy.socks_port", "/system/proxy/socks_port"}, {"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.autoconfig_url", "/system/proxy/autoconfig_url"},
{"network.proxy.type", "/system/proxy/mode"}, {"network.proxy.type", "/system/proxy/mode"},
{"config.use_system_prefs.accessibility", "/desktop/gnome/interface/accessibility"}, {"config.use_system_prefs.accessibility", "/desktop/gnome/interface/accessibility"},

Просмотреть файл

@ -87,6 +87,9 @@ extern "C" {
GError **err); GError **err);
typedef PRInt32 (*GConfClientGetIntType) (void *client, const gchar *key, typedef PRInt32 (*GConfClientGetIntType) (void *client, const gchar *key,
GError **err); GError **err);
typedef GSList* (*GConfClientGetListType) (void *client, const gchar *key,
GConfValueType list_type,
GError **err);
typedef void (*GConfClientNotifyFuncType) (void* client, guint cnxn_id, typedef void (*GConfClientNotifyFuncType) (void* client, guint cnxn_id,
void *entry, void *entry,
gpointer user_data); gpointer user_data);
@ -170,6 +173,7 @@ private:
GConfClientGetBoolType GConfClientGetBool; GConfClientGetBoolType GConfClientGetBool;
GConfClientGetStringType GConfClientGetString; GConfClientGetStringType GConfClientGetString;
GConfClientGetIntType GConfClientGetInt; GConfClientGetIntType GConfClientGetInt;
GConfClientGetListType GConfClientGetList;
GConfClientNotifyAddType GConfClientNotifyAdd; GConfClientNotifyAddType GConfClientNotifyAdd;
GConfClientNotifyRemoveType GConfClientNotifyRemove; GConfClientNotifyRemoveType GConfClientNotifyRemove;
GConfClientAddDirType GConfClientAddDir; 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_bool") //10
GCONF_FUNCS_POINTER_ADD("gconf_value_get_string") //11 GCONF_FUNCS_POINTER_ADD("gconf_value_get_string") //11
GCONF_FUNCS_POINTER_ADD("gconf_value_get_int") //12 GCONF_FUNCS_POINTER_ADD("gconf_value_get_int") //12
GCONF_FUNCS_POINTER_ADD("gconf_client_get_list") //13
GCONF_FUNCS_POINTER_END GCONF_FUNCS_POINTER_END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -689,12 +694,30 @@ GConfProxy::GetCharPref(const char *aMozKey, char **retval)
{ {
NS_ENSURE_TRUE(mInitialized, NS_ERROR_FAILURE); NS_ENSURE_TRUE(mInitialized, NS_ERROR_FAILURE);
gchar *str = GConfClientGetString(mGConfClient, const gchar *gconfkey = MozKey2GConfKey(aMozKey);
MozKey2GConfKey(aMozKey), NULL);
if (str) { if (!strcmp (aMozKey, "network.proxy.no_proxies_on")) {
*retval = PL_strdup(str); GSList *s;
g_free(str); 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; return NS_OK;
} }
@ -815,6 +838,10 @@ GConfProxy::InitFuncPtrs()
GConfValueGetBool = (GConfValueGetBoolType) sGConfFuncList[10].FuncPtr; GConfValueGetBool = (GConfValueGetBoolType) sGConfFuncList[10].FuncPtr;
GConfValueGetString = (GConfValueGetStringType) sGConfFuncList[11].FuncPtr; GConfValueGetString = (GConfValueGetStringType) sGConfFuncList[11].FuncPtr;
GConfValueGetInt = (GConfValueGetIntType) sGConfFuncList[12].FuncPtr; GConfValueGetInt = (GConfValueGetIntType) sGConfFuncList[12].FuncPtr;
//gconf client list func
GConfClientGetList =
(GConfClientGetListType) sGConfFuncList[13].FuncPtr;
} }
void void