# HG changeset patch # User Geoff Lankow # Date 1554940992 -43200 # Node ID dda5855e718c84148a36cd2fd4e7a7ce7ae72f27 # Parent 0431532bf0b2bb70d7aecc76306d615a3aa8316e Bug 1543531 - Port bug 1433685 - Remove nsGConfService; rs=bustage-fix diff --git a/mail/components/shell/nsMailGNOMEIntegration.cpp b/mail/components/shell/nsMailGNOMEIntegration.cpp --- a/mail/components/shell/nsMailGNOMEIntegration.cpp +++ b/mail/components/shell/nsMailGNOMEIntegration.cpp @@ -1,15 +1,14 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsMailGNOMEIntegration.h" -#include "nsIGConfService.h" #include "nsIGIOService.h" #include "nsCOMPtr.h" #include "nsIServiceManager.h" #include "prenv.h" #include "nsIFile.h" #include "nsIStringBundle.h" #include "nsIPromptService.h" #include "nsIPrefService.h" @@ -69,22 +68,19 @@ nsMailGNOMEIntegration::nsMailGNOMEInteg mAppIsInPath(false) {} nsresult nsMailGNOMEIntegration::Init() { nsresult rv; - // GConf _must_ be available, or we do not allow CreateInstance to succeed. - - nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - if (!gconf && !giovfs) + if (!giovfs) return NS_ERROR_NOT_AVAILABLE; // Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use // the locale encoding. If it's not set, they use UTF-8. mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nullptr; if (GetAppPathFromLauncher()) return NS_OK; @@ -230,33 +226,22 @@ nsMailGNOMEIntegration::CheckHandlerMatc } return KeyMatchesAppName(command.get()); } bool nsMailGNOMEIntegration::checkDefault(const char* const *aProtocols, unsigned int aLength) { - nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - bool enabled; nsAutoCString handler; nsresult rv; for (unsigned int i = 0; i < aLength; ++i) { - if (gconf) { - handler.Truncate(); - rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]), - &enabled, handler); - if (NS_SUCCEEDED(rv) && (!CheckHandlerMatchesAppName(handler) || !enabled)) { - return false; - } - } - if (giovfs) { handler.Truncate(); nsCOMPtr handlerApp; rv = giovfs->GetAppForURIScheme(nsDependentCString(aProtocols[i]), getter_AddRefs(handlerApp)); if (NS_FAILED(rv) || !handlerApp) { return false; } @@ -273,38 +258,29 @@ nsMailGNOMEIntegration::checkDefault(con nsresult nsMailGNOMEIntegration::MakeDefault(const char* const *aProtocols, unsigned int aProtocolsLength, const char *aMimeType, const char *aExtensions) { nsAutoCString appKeyValue; - nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if(mAppIsInPath) { // mAppPath is in the users path, so use only the basename as the launcher gchar *tmp = g_path_get_basename(mAppPath.get()); appKeyValue = tmp; g_free(tmp); } else { appKeyValue = mAppPath; } appKeyValue.AppendLiteral(" %s"); nsresult rv; - if (gconf) { - for (unsigned int i = 0; i < aProtocolsLength; ++i) { - rv = gconf->SetAppForProtocol(nsDependentCString(aProtocols[i]), - appKeyValue); - NS_ENSURE_SUCCESS(rv, rv); - } - } - if (giovfs) { nsCOMPtr bundleService = mozilla::services::GetStringBundleService(); NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED); nsCOMPtr brandBundle; rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle)); NS_ENSURE_SUCCESS(rv, rv);