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
Родитель e8985fdb21
Коммит 59cc486ac6
2 изменённых файлов: 41 добавлений и 0 удалений

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

@ -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();

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

@ -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);