m_folder->NotifyCompactCompleted();  if (m_compactAll) rv = CompactNextFolder();
nsFolderCompactState::FinishCompact(){    // All okay time to finish up the compact process  nsresult rv = NS_OK;  nsCOMPtr<nsIFileSpec> pathSpec;  nsCOMPtr<nsIFolder> parent;  nsCOMPtr<nsIMsgFolder> parentFolder;  nsCOMPtr<nsIDBFolderInfo> folderInfo;  nsFileSpec fileSpec;    // get leaf name and database name of the folder  rv = m_folder->GetPath(getter_AddRefs(pathSpec));  pathSpec->GetFileSpec(&fileSpec);  nsLocalFolderSummarySpec summarySpec(fileSpec);  nsXPIDLCString idlName;  nsCAutoString dbName(summarySpec.GetLeafName());  pathSpec->GetLeafName(getter_Copies(idlName));    // close down the temp file stream; preparing for deleting the old folder    // and its database; then rename the temp folder and database  m_fileStream->flush();  m_fileStream->close();  delete m_fileStream;  m_fileStream = nsnull;    // make sure the new database is valid  m_db->SetSummaryValid(PR_TRUE);  m_db->Commit(nsMsgDBCommitType::kLargeCommit);  m_db->ForceClosed();  m_db = nsnull;  nsLocalFolderSummarySpec newSummarySpec(m_fileSpec);  nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;  nsCOMPtr <nsIDBFolderInfo> transferInfo;  nsCOMPtr <nsIMsgDatabase> db;  m_folder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(db));  if (dbFolderInfo)    dbFolderInfo->GetTransferInfo(getter_AddRefs(transferInfo));  db=nsnull;    // close down database of the original folder and remove the folder node    // and all it's message node from the tree  dbFolderInfo=nsnull;  m_folder->ForceDBClosed();    // remove the old folder and database  fileSpec.Delete(PR_FALSE);  summarySpec.Delete(PR_FALSE);    // rename the copied folder and database to be the original folder and    // database   m_fileSpec.Rename((const char*) idlName);  newSummarySpec.Rename(dbName.get());   rv = ReleaseFolderLock();  NS_ASSERTION(NS_SUCCEEDED(rv),"folder lock not released successfully");  m_folder->GetMsgDatabase(m_window, getter_AddRefs(db));  if (transferInfo && db)  {    db->GetDBFolderInfo(getter_AddRefs(dbFolderInfo));    if(dbFolderInfo)      dbFolderInfo->InitFromTransferInfo(transferInfo);  }  m_folder->NotifyCompactCompleted();  if (m_compactAll)    rv = CompactNextFolder();        return rv;}