7 retrieving revision 1.1 |
7 retrieving revision 1.1 |
8 |
8 |
9 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
9 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
10 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
10 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
11 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
11 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
12 @@ -50,24 +50,28 @@ nsUnixSystemProxySettings::GetMainThread |
12 @@ -53,23 +53,27 @@ nsUnixSystemProxySettings::GetMainThread |
13 // dbus prevents us from being threadsafe, but this routine should not block anyhow |
13 // dbus prevents us from being threadsafe, but this routine should not block anyhow |
14 *aMainThreadOnly = true; |
14 *aMainThreadOnly = true; |
15 return NS_OK; |
15 return NS_OK; |
16 } |
16 } |
17 |
17 |
18 nsresult |
18 nsresult |
19 nsUnixSystemProxySettings::Init() |
19 nsUnixSystemProxySettings::Init() |
20 { |
20 { |
21 - mSchemeProxySettings.Init(5); |
|
22 - mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
21 - mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
23 - if (mGSettings) { |
22 - if (mGSettings) { |
24 - mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
23 - mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
25 - getter_AddRefs(mProxySettings)); |
24 - getter_AddRefs(mProxySettings)); |
26 - } |
25 - } |
27 - if (!mProxySettings) { |
26 - if (!mProxySettings) { |
28 - mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
27 - mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
29 + // only use GSettings if that is a GNOME session |
28 + // only use GSettings if that is a GNOME session |
30 + const char* sessionType = PR_GetEnv("DESKTOP_SESSION"); |
29 + const char* sessionType = PR_GetEnv("DESKTOP_SESSION"); |
31 + if (sessionType && !strcmp(sessionType, "gnome")) { |
30 + if (sessionType && !strcmp(sessionType, "gnome")) { |
32 + mSchemeProxySettings.Init(5); |
|
33 + mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
31 + mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
34 + if (mGSettings) { |
32 + if (mGSettings) { |
35 + mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
33 + mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
36 + getter_AddRefs(mProxySettings)); |
34 + getter_AddRefs(mProxySettings)); |
37 + } |
35 + } |