fixed bug -- Empty trash on local and POP folders doesn't work; implemented empty trash for pop; r=putterman

This commit is contained in:
jefft%netscape.com 2000-01-11 20:41:24 +00:00
parent 9a18c0578e
commit be314bdf69
2 changed files with 41 additions and 0 deletions

View File

@ -674,6 +674,45 @@ nsMsgLocalMailFolder::CreateSubfolder(const char *folderName)
return rv;
}
NS_IMETHODIMP nsMsgLocalMailFolder::Compact()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgLocalMailFolder::EmptyTrash()
{
nsresult rv;
nsCOMPtr<nsIMsgFolder> trashFolder;
rv = GetTrashFolder(getter_AddRefs(trashFolder));
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIFolder> parent;
rv = GetParent(getter_AddRefs(parent));
if (NS_SUCCEEDED(rv) && parent)
{
nsCOMPtr<nsIMsgFolder> parentFolder;
parentFolder = do_QueryInterface(parent, &rv);
if (NS_SUCCEEDED(rv) && parentFolder)
{
nsXPIDLString idlFolderName;
rv = trashFolder->GetName(getter_Copies(idlFolderName));
if (NS_SUCCEEDED(rv))
{
nsString folderName(idlFolderName);
char *cStringName = folderName.ToNewCString();
trashFolder->SetParent(nsnull);
parentFolder->PropagateDelete(trashFolder, PR_TRUE);
parentFolder->CreateSubfolder(cStringName);
nsCRT::free(cStringName);
}
}
}
}
return rv;
}
NS_IMETHODIMP nsMsgLocalMailFolder::Delete()
{
nsresult rv = GetDatabase();

View File

@ -96,6 +96,8 @@ public:
NS_IMETHOD CreateSubfolder(const char *folderName);
NS_IMETHOD AddSubfolder(nsAutoString *folderName, nsIMsgFolder** newFolder);
NS_IMETHOD Compact();
NS_IMETHOD EmptyTrash();
NS_IMETHOD Delete ();
NS_IMETHOD Rename (const char *newName);
NS_IMETHOD Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos);