diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 20:27:19 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 20:27:19 -0500 |
commit | 1f5f6a4bf0163f4dcf0fd6778611891165c334ff (patch) | |
tree | b4211330b96a89b66c838c116dbc379159c62ed6 /mailnews/local/src/nsMsgMaildirStore.cpp | |
parent | 4d20783c0aa26ced30b55c3eaaab76f46a01a803 (diff) | |
download | UXP-1f5f6a4bf0163f4dcf0fd6778611891165c334ff.tar UXP-1f5f6a4bf0163f4dcf0fd6778611891165c334ff.tar.gz UXP-1f5f6a4bf0163f4dcf0fd6778611891165c334ff.tar.lz UXP-1f5f6a4bf0163f4dcf0fd6778611891165c334ff.tar.xz UXP-1f5f6a4bf0163f4dcf0fd6778611891165c334ff.zip |
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
Diffstat (limited to 'mailnews/local/src/nsMsgMaildirStore.cpp')
-rw-r--r-- | mailnews/local/src/nsMsgMaildirStore.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/mailnews/local/src/nsMsgMaildirStore.cpp b/mailnews/local/src/nsMsgMaildirStore.cpp index 7a4633367..993abbad5 100644 --- a/mailnews/local/src/nsMsgMaildirStore.cpp +++ b/mailnews/local/src/nsMsgMaildirStore.cpp @@ -323,19 +323,30 @@ NS_IMETHODIMP nsMsgMaildirStore::SetSummaryFileValid(nsIMsgFolder *aFolder, NS_IMETHODIMP nsMsgMaildirStore::DeleteFolder(nsIMsgFolder *aFolder) { NS_ENSURE_ARG_POINTER(aFolder); + bool exists; - // Delete Maildir structure + // Delete the Maildir itself. nsCOMPtr<nsIFile> pathFile; nsresult rv = aFolder->GetFilePath(getter_AddRefs(pathFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = pathFile->Remove(true); // recursive + exists = false; + pathFile->Exists(&exists); + if (exists) { + rv = pathFile->Remove(true); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Delete any subfolders (.sbd-suffixed directories). AddDirectorySeparator(pathFile); - bool exists; + exists = false; pathFile->Exists(&exists); - if (exists) - pathFile->Remove(true); - return rv; + if (exists) { + rv = pathFile->Remove(true); + NS_ENSURE_SUCCESS(rv, rv); + } + + return NS_OK; } NS_IMETHODIMP nsMsgMaildirStore::RenameFolder(nsIMsgFolder *aFolder, |