summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/dirprovider/DirectoryProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/components/dirprovider/DirectoryProvider.cpp')
-rw-r--r--application/palemoon/components/dirprovider/DirectoryProvider.cpp52
1 files changed, 1 insertions, 51 deletions
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<nsIFile> file;
-
- char const* leafName = nullptr;
-
- if (!strcmp(aKey, NS_APP_BOOKMARKS_50_FILE)) {
- leafName = "bookmarks.html";
-
- nsCOMPtr<nsIPrefBranch> 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<nsIFile> 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