mozilla-nongnome-proxies.patch
branchfirefox67
changeset 1095 9c008b241362
parent 1093 3942c205588b
child 1097 840132a4a9b3
equal deleted inserted replaced
1094:a25638dad81d 1095:9c008b241362
     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 @@ -57,25 +57,27 @@ NS_IMETHODIMP
    12 @@ -57,24 +57,27 @@ NS_IMETHODIMP
    13  nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
    13  nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
    14    // dbus prevents us from being threadsafe, but this routine should not block
    14    // dbus prevents us from being threadsafe, but this routine should not block
    15    // anyhow
    15    // anyhow
    16    *aMainThreadOnly = true;
    16    *aMainThreadOnly = true;
    17    return NS_OK;
    17    return NS_OK;
    24 -        NS_LITERAL_CSTRING("org.gnome.system.proxy"),
    24 -        NS_LITERAL_CSTRING("org.gnome.system.proxy"),
    25 -        getter_AddRefs(mProxySettings));
    25 -        getter_AddRefs(mProxySettings));
    26 -  }
    26 -  }
    27 -  if (!mProxySettings) {
    27 -  if (!mProxySettings) {
    28 -    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    28 -    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    29 -  }
       
    30 +  // only use GSettings if that is a GNOME session
    29 +  // only use GSettings if that is a GNOME session
    31 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    30 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    32 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    31 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    33 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    32 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    34 +    if (mGSettings) {
    33 +    if (mGSettings) {
    36 +                                         getter_AddRefs(mProxySettings));
    35 +                                         getter_AddRefs(mProxySettings));
    37 +    }
    36 +    }
    38 +    if (!mProxySettings) {
    37 +    if (!mProxySettings) {
    39 +      mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    38 +      mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    40 +    }
    39 +    }
       
    40    }
    41  }
    41  }
    42  
    42  
    43  bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) {
    43  bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) {
    44    nsAutoCString mode;
    44    nsAutoCString mode;
    45    return NS_SUCCEEDED(mGConf->GetString(
    45    return NS_SUCCEEDED(mGConf->GetString(
    46               NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) &&
    46               NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) &&
    47           mode.EqualsASCII(aMode);
    47           mode.EqualsASCII(aMode);
    48  }