mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
[PALEMOON] Remove the NS_APP_BOOKMARKS_50_FILE directory service key
This commit is contained in:
parent
07667373c4
commit
fda68c9bfe
1 changed files with 1 additions and 51 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue