From 7957b8d886b581132c0f7ea56828cf50c4a6c6ca Mon Sep 17 00:00:00 2001 From: "naving%netscape.com" Date: Tue, 21 Aug 2001 21:06:40 +0000 Subject: [PATCH] 88251 r=bienvenu sr=sspitzer. Maintain the sort-order etc when emptying local trash. --- mailnews/local/src/nsLocalMailFolder.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index d690a612ca12..bbe4c29fd142 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -978,14 +978,30 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EmptyTrash(nsIMsgWindow *msgWindow, rv = trashFolder->GetName(getter_Copies(idlFolderName)); if (NS_SUCCEEDED(rv)) { + nsCOMPtr dbFolderInfo; + nsCOMPtr transferInfo; + nsCOMPtr db; + trashFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(db)); + if (dbFolderInfo) + dbFolderInfo->GetTransferInfo(getter_AddRefs(transferInfo)); + nsString folderName(idlFolderName); trashFolder->SetParent(nsnull); parentFolder->PropagateDelete(trashFolder, PR_TRUE, msgWindow); parentFolder->CreateSubfolder(folderName.get(),nsnull); nsCOMPtr newTrashFolder; rv = GetTrashFolder(getter_AddRefs(newTrashFolder)); + db=nsnull; + dbFolderInfo=nsnull; if (NS_SUCCEEDED(rv) && newTrashFolder) - newTrashFolder->UpdateFolder(msgWindow); + newTrashFolder->GetMsgDatabase(msgWindow, getter_AddRefs(db)); + + if (transferInfo && db) + { + db->GetDBFolderInfo(getter_AddRefs(dbFolderInfo)); + if (dbFolderInfo) + dbFolderInfo->InitFromTransferInfo(transferInfo); + } } } }