mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
fixed bug -- Empty trash on local and POP folders doesn't work; implemented empty trash for pop; r=putterman
This commit is contained in:
parent
9a18c0578e
commit
be314bdf69
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user