mozilla-nongnome-proxies.patch
branchfirefox115
changeset 1190 2a24a948b5cf
parent 1141 edb0ebe8cccc
equal deleted inserted replaced
1189:ba0c97b018a6 1190:2a24a948b5cf
     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  bd5d1f49975deb730064a16b3079edb53c4a5f84
     6 # Parent  715f01d61df8627117e6aefca540f0c1bba45011
     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,20 +49,24 @@ NS_IMETHODIMP
    16 @@ -52,10 +52,13 @@ nsUnixSystemProxySettings::GetMainThread
    17  nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
       
    18    // dbus prevents us from being threadsafe, but this routine should not block
       
    19    // anyhow
       
    20    *aMainThreadOnly = true;
       
    21    return NS_OK;
       
    22  }
    17  }
    23  
    18  
    24  void nsUnixSystemProxySettings::Init() {
    19  void nsUnixSystemProxySettings::Init() {
    25 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    20 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    26 -  if (mGSettings) {
    21 -  if (mGSettings) {
    28 -                                       getter_AddRefs(mProxySettings));
    23 -                                       getter_AddRefs(mProxySettings));
    29 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    24 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    30 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    25 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    31 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    26 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    32 +    if (mGSettings) {
    27 +    if (mGSettings) {
    33 +      mGSettings->GetCollectionForSchema(
    28 +      mGSettings->GetCollectionForSchema("org.gnome.system.proxy"_ns,
    34 +          "org.gnome.system.proxy"_ns,
    29 +                                         getter_AddRefs(mProxySettings));
    35 +          getter_AddRefs(mProxySettings));
       
    36 +    }
    30 +    }
    37    }
    31    }
    38  }
    32  }
    39  
    33  
    40  nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) {
       
    41    if (mProxySettings) {
       
    42      nsCString proxyMode;
       
    43      // Check if mode is auto
       
    44      nsresult rv = mProxySettings->GetString("mode"_ns, proxyMode);