summaryrefslogtreecommitdiffstats
path: root/mailnews/news/src
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-10 20:27:19 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-11-10 20:27:19 -0500
commit1f5f6a4bf0163f4dcf0fd6778611891165c334ff (patch)
treeb4211330b96a89b66c838c116dbc379159c62ed6 /mailnews/news/src
parent4d20783c0aa26ced30b55c3eaaab76f46a01a803 (diff)
downloadUXP-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/news/src')
-rw-r--r--mailnews/news/src/nsNewsFolder.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/mailnews/news/src/nsNewsFolder.cpp b/mailnews/news/src/nsNewsFolder.cpp
index 3af5ae43f..33faa4269 100644
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -495,41 +495,8 @@ NS_IMETHODIMP nsMsgNewsFolder::CreateSubfolder(const nsAString& newsgroupName,
NS_IMETHODIMP nsMsgNewsFolder::Delete()
{
- nsresult rv = GetDatabase();
-
- if(NS_SUCCEEDED(rv))
- {
- mDatabase->ForceClosed();
- mDatabase = nullptr;
- }
-
- nsCOMPtr<nsIFile> folderPath;
- rv = GetFilePath(getter_AddRefs(folderPath));
-
- if (NS_SUCCEEDED(rv))
- {
- nsCOMPtr<nsIFile> summaryPath;
- rv = GetSummaryFileLocation(folderPath, getter_AddRefs(summaryPath));
- if (NS_SUCCEEDED(rv))
- {
- bool exists = false;
- rv = folderPath->Exists(&exists);
-
- if (NS_SUCCEEDED(rv) && exists)
- rv = folderPath->Remove(false);
-
- if (NS_FAILED(rv))
- NS_WARNING("Failed to remove News Folder");
-
- rv = summaryPath->Exists(&exists);
-
- if (NS_SUCCEEDED(rv) && exists)
- rv = summaryPath->Remove(false);
-
- if (NS_FAILED(rv))
- NS_WARNING("Failed to remove News Folder Summary File");
- }
- }
+ nsresult rv = nsMsgDBFolder::Delete();
+ NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr <nsINntpIncomingServer> nntpServer;
rv = GetNntpServer(getter_AddRefs(nntpServer));