mozilla-nongnome-proxies.patch
branchfirefox80
changeset 1141 edb0ebe8cccc
parent 1123 7fa561e5d7c7
equal deleted inserted replaced
1140:a9aa543a508a 1141:edb0ebe8cccc
     1 # HG changeset patch
     1 # HG changeset patch
     2 # User Wolfgang Rosenauer
     2 # User Wolfgang Rosenauer
     3 # Date 1558442915 -7200
     3 # Date 1558442915 -7200
     4 #      Tue May 21 14:48:35 2019 +0200
     4 #      Tue May 21 14:48:35 2019 +0200
     5 # Node ID 6bcf2dfebc1ea2aa34e5cc61152709fc8e409dc5
     5 # Node ID 6bcf2dfebc1ea2aa34e5cc61152709fc8e409dc5
     6 # Parent  dc1684693eed684bdafeff0ad78d4f6d288fcae1
     6 # Parent  bd5d1f49975deb730064a16b3079edb53c4a5f84
     7 Do not use gconf for proxy settings if not running within Gnome
     7 Do not use gconf for proxy settings if not running within Gnome
     8 Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
     8 Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
     9 ===================================================================
     9 ===================================================================
    10 RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v
    10 RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v
    11 retrieving revision 1.1
    11 retrieving revision 1.1
    12 
    12 
    13 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    13 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    14 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    14 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    15 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    15 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    16 @@ -49,21 +49,24 @@ NS_IMETHODIMP
    16 @@ -49,20 +49,24 @@ NS_IMETHODIMP
    17  nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
    17  nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
    18    // dbus prevents us from being threadsafe, but this routine should not block
    18    // dbus prevents us from being threadsafe, but this routine should not block
    19    // anyhow
    19    // anyhow
    20    *aMainThreadOnly = true;
    20    *aMainThreadOnly = true;
    21    return NS_OK;
    21    return NS_OK;
    22  }
    22  }
    23  
    23  
    24  void nsUnixSystemProxySettings::Init() {
    24  void nsUnixSystemProxySettings::Init() {
    25 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    25 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    26 -  if (mGSettings) {
    26 -  if (mGSettings) {
    27 -    mGSettings->GetCollectionForSchema(
    27 -    mGSettings->GetCollectionForSchema("org.gnome.system.proxy"_ns,
    28 -        NS_LITERAL_CSTRING("org.gnome.system.proxy"),
    28 -                                       getter_AddRefs(mProxySettings));
    29 -        getter_AddRefs(mProxySettings));
       
    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 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    31 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    33 +    if (mGSettings) {
    32 +    if (mGSettings) {
    34 +      mGSettings->GetCollectionForSchema(
    33 +      mGSettings->GetCollectionForSchema(
    35 +          NS_LITERAL_CSTRING("org.gnome.system.proxy"),
    34 +          "org.gnome.system.proxy"_ns,
    36 +          getter_AddRefs(mProxySettings));
    35 +          getter_AddRefs(mProxySettings));
    37 +    }
    36 +    }
    38    }
    37    }
    39  }
    38  }
    40  
    39  
    41  nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) {
    40  nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) {
    42    if (mProxySettings) {
    41    if (mProxySettings) {
    43      nsCString proxyMode;
    42      nsCString proxyMode;
    44      // Check if mode is auto
    43      // Check if mode is auto
    45      nsresult rv =
    44      nsresult rv = mProxySettings->GetString("mode"_ns, proxyMode);