move NotifyStoreClosedAllHeaders to base class so imap can call it to fix 59376 crash in morkRowObject::CloseRowObject r=mscott

This commit is contained in:
bienvenu%netscape.com 2000-11-09 00:14:22 +00:00
Родитель 1287323a34
Коммит 4f3ef4909b
4 изменённых файлов: 27 добавлений и 28 удалений

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

@ -1027,3 +1027,29 @@ nsMsgDBFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
return NS_OK;
}
nsresult nsMsgDBFolder::NotifyStoreClosedAllHeaders()
{
nsCOMPtr <nsISimpleEnumerator> enumerator;
GetMessages(nsnull, getter_AddRefs(enumerator));
nsCOMPtr<nsISupports> folderSupports;
nsresult rv = QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(folderSupports));
if (enumerator)
{
PRBool hasMoreElements;
while(NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements)) && hasMoreElements)
{
nsCOMPtr<nsISupports> childSupports;
rv = enumerator->GetNext(getter_AddRefs(childSupports));
if(NS_FAILED(rv))
return rv;
// clear out db hdr, because it won't be valid when we get rid of the .msf file
nsCOMPtr<nsIDBMessage> dbMessage(do_QueryInterface(childSupports, &rv));
if(NS_SUCCEEDED(rv) && dbMessage)
dbMessage->SetMsgDBHdr(nsnull);
}
}
return NS_OK;
}

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

@ -97,6 +97,7 @@ protected:
nsresult GetFolderCacheKey(nsIFileSpec **aFileSpec);
nsresult GetFolderCacheElemFromFileSpec(nsIFileSpec *fileSpec, nsIMsgFolderCacheElement **cacheElement);
nsresult NotifyStoreClosedAllHeaders();
protected:
nsCOMPtr<nsIMsgDatabase> mDatabase;
nsString mCharset;

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

@ -1142,33 +1142,6 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Compact()
return rv;
}
nsresult nsMsgLocalMailFolder::NotifyStoreClosedAllHeaders()
{
nsCOMPtr <nsISimpleEnumerator> enumerator;
GetMessages(nsnull, getter_AddRefs(enumerator));
nsCOMPtr<nsISupports> folderSupports;
nsresult rv = QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(folderSupports));
if (enumerator)
{
PRBool hasMoreElements;
while(NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements)) && hasMoreElements)
{
nsCOMPtr<nsISupports> childSupports;
rv = enumerator->GetNext(getter_AddRefs(childSupports));
if(NS_FAILED(rv))
return rv;
// clear out db hdr, because it won't be valid when we get rid of the .msf file
nsCOMPtr<nsIDBMessage> dbMessage(do_QueryInterface(childSupports, &rv));
if(NS_SUCCEEDED(rv) && dbMessage)
dbMessage->SetMsgDBHdr(nsnull);
}
}
return NS_OK;
}
NS_IMETHODIMP nsMsgLocalMailFolder::EmptyTrash(nsIMsgWindow *msgWindow,
nsIUrlListener *aListener)
{

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

@ -151,7 +151,6 @@ protected:
nsresult WriteStartOfNewMessage();
nsresult IsChildOfTrash(PRBool *result);
nsresult RecursiveSetDeleteIsMoveTrash(PRBool bVal);
nsresult NotifyStoreClosedAllHeaders();
/* Finds the directory associated with this folder. That is if the path is
c:\Inbox, it will return c:\Inbox.sbd if it succeeds. If that path doesn't