author | Wolfgang Rosenauer <wr@rosenauer.org> |
Wed, 13 Feb 2019 08:51:42 +0100 | |
branch | firefox65 |
changeset 1086 | ed1c30c5f456 |
parent 1085 | 87f893cf45b9 |
child 1093 | 3942c205588b |
permissions | -rw-r--r-- |
0 | 1 |
From: Wolfgang Rosenauer |
2 |
Subject: Do not use gconf for proxy settings if not running within Gnome |
|
3 |
||
4 |
Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
|
5 |
=================================================================== |
|
6 |
RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v |
|
7 |
retrieving revision 1.1 |
|
367 | 8 |
|
9 |
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
|
10 |
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
|
11 |
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
|
1085 | 12 |
@@ -55,24 +55,27 @@ NS_IMETHODIMP |
13 |
nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { |
|
14 |
// dbus prevents us from being threadsafe, but this routine should not block |
|
15 |
// anyhow |
|
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
419
diff
changeset
|
16 |
*aMainThreadOnly = true; |
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
419
diff
changeset
|
17 |
return NS_OK; |
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
419
diff
changeset
|
18 |
} |
0 | 19 |
|
1085 | 20 |
nsresult nsUnixSystemProxySettings::Init() { |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
21 |
- mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
22 |
- if (mGSettings) { |
1085 | 23 |
- mGSettings->GetCollectionForSchema( |
24 |
- NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
|
25 |
- getter_AddRefs(mProxySettings)); |
|
650 | 26 |
- } |
27 |
- if (!mProxySettings) { |
|
28 |
- mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
|
29 |
+ // only use GSettings if that is a GNOME session |
|
0 | 30 |
+ const char* sessionType = PR_GetEnv("DESKTOP_SESSION"); |
31 |
+ if (sessionType && !strcmp(sessionType, "gnome")) { |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
32 |
+ mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
33 |
+ if (mGSettings) { |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
34 |
+ mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
35 |
+ getter_AddRefs(mProxySettings)); |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
36 |
+ } |
650 | 37 |
+ if (!mProxySettings) { |
38 |
+ mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
|
39 |
+ } |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
40 |
} |
994 | 41 |
|
0 | 42 |
return NS_OK; |
43 |
} |
|
44 |
||
1085 | 45 |
bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) { |
46 |
nsAutoCString mode; |
|
47 |
return NS_SUCCEEDED(mGConf->GetString( |