mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Bug 1317117 - call msgStore folder deletion during imap/news empty trash.
Also factors out some common code into nsMSgDBFolder::Delete(), and makes a couple of incidental changes to try and clarify the responsibilies of nsIMsgPluggableStore::DeleteFolder(). Tag #1273
This commit is contained in:
parent
0ef88cc19d
commit
0f885aaad1
8 changed files with 77 additions and 139 deletions
|
|
@ -3559,7 +3559,31 @@ NS_IMETHODIMP nsMsgDBFolder::GetShowDeletedMessages(bool *showDeletedMessages)
|
|||
|
||||
NS_IMETHODIMP nsMsgDBFolder::Delete()
|
||||
{
|
||||
return NS_OK;
|
||||
ForceDBClosed();
|
||||
|
||||
// Delete the .msf file.
|
||||
// NOTE: this doesn't remove .msf files in subfolders, but
|
||||
// both nsMsgBrkMBoxStore::DeleteFolder() and
|
||||
// nsMsgMaildirStore::DeleteFolder() will remove those .msf files
|
||||
// as a side-effect of deleting the .sbd directory.
|
||||
nsCOMPtr<nsIFile> summaryFile;
|
||||
nsresult rv = GetSummaryFile(getter_AddRefs(summaryFile));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool exists = false;
|
||||
summaryFile->Exists(&exists);
|
||||
if (exists) {
|
||||
rv = summaryFile->Remove(false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Ask the msgStore to delete the actual storage (mbox, maildir or whatever
|
||||
// else may be supported in future).
|
||||
nsCOMPtr<nsIMsgPluggableStore> msgStore;
|
||||
rv = GetMsgStore(getter_AddRefs(msgStore));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = msgStore->DeleteFolder(this);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgDBFolder::DeleteSubFolders(nsIArray *folders,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue