remove summary file prior trash all messages

This commit is contained in:
jefft%netscape.com 1999-08-06 21:03:59 +00:00
Родитель 3a9a3fa421
Коммит f9a0f8a033
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -568,6 +568,29 @@ NS_IMETHODIMP nsImapMailFolder::EmptyTrash()
rv = GetTrashFolder(getter_AddRefs(trashFolder));
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIMsgDatabase> trashDB;
rv = trashFolder->GetMsgDatabase(getter_AddRefs(trashDB));
if (NS_SUCCEEDED(rv))
{
trashDB->ForceClosed();
trashDB = null_nsCOMPtr();
}
nsCOMPtr<nsIFileSpec> pathSpec;
rv = trashFolder->GetPath(getter_AddRefs(pathSpec));
if (NS_SUCCEEDED(rv))
{
nsFileSpec fileSpec;
rv = pathSpec->GetFileSpec(&fileSpec);
if (NS_SUCCEEDED(rv))
{
nsLocalFolderSummarySpec summarySpec(fileSpec);
if (summarySpec.Exists())
summarySpec.Delete(PR_FALSE);
}
}
rv = trashFolder->GetMsgDatabase(getter_AddRefs(trashDB));
NS_WITH_SERVICE (nsIImapService, imapService, kCImapService, &rv);
if (NS_SUCCEEDED(rv))
rv = imapService->DeleteAllMessages(m_eventQueue, trashFolder,