зеркало из https://github.com/mozilla/pjs.git
fixed bug -- Empty trash on local and POP folders doesn't work; implemented empty trash for pop; r=putterman
This commit is contained in:
Родитель
e8985fdb21
Коммит
59cc486ac6
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче