From abc1c7eb393e6b0aa5b17958ab13ef7b1fe827c9 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Wed, 4 Apr 2018 07:22:37 -0400 Subject: [PALEMOON] Remove the NS_APP_BOOKMARKS_50_FILE directory service key --- .../components/dirprovider/DirectoryProvider.cpp | 52 +--------------------- 1 file changed, 1 insertion(+), 51 deletions(-) (limited to 'application/palemoon/components') diff --git a/application/palemoon/components/dirprovider/DirectoryProvider.cpp b/application/palemoon/components/dirprovider/DirectoryProvider.cpp index 4d3993b7f..85728b351 100644 --- a/application/palemoon/components/dirprovider/DirectoryProvider.cpp +++ b/application/palemoon/components/dirprovider/DirectoryProvider.cpp @@ -34,57 +34,7 @@ NS_IMPL_ISUPPORTS(DirectoryProvider, NS_IMETHODIMP DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult) { - nsresult rv; - - *aResult = nullptr; - - // NOTE: This function can be reentrant through the NS_GetSpecialDirectory - // call, so be careful not to cause infinite recursion. - - nsCOMPtr file; - - char const* leafName = nullptr; - - if (!strcmp(aKey, NS_APP_BOOKMARKS_50_FILE)) { - leafName = "bookmarks.html"; - - nsCOMPtr prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); - if (prefs) { - nsCString path; - rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path)); - if (NS_SUCCEEDED(rv)) { - NS_NewNativeLocalFile(path, true, getter_AddRefs(file)); - } - } - } - else { - return NS_ERROR_FAILURE; - } - - nsDependentCString leafstr(leafName); - - nsCOMPtr parentDir; - if (file) { - rv = file->GetParent(getter_AddRefs(parentDir)); - if (NS_FAILED(rv)) - return rv; - } - else { - rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(parentDir)); - if (NS_FAILED(rv)) - return rv; - - rv = parentDir->Clone(getter_AddRefs(file)); - if (NS_FAILED(rv)) - return rv; - - file->AppendNative(leafstr); - } - - *aPersist = true; - NS_ADDREF(*aResult = file); - - return NS_OK; + return NS_ERROR_FAILURE; } static void -- cgit v1.2.3