From 4f3ef4909b18cffe0bbe40fff5ad0a74647675bd Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Thu, 9 Nov 2000 00:14:22 +0000 Subject: [PATCH] move NotifyStoreClosedAllHeaders to base class so imap can call it to fix 59376 crash in morkRowObject::CloseRowObject r=mscott --- mailnews/base/util/nsMsgDBFolder.cpp | 26 +++++++++++++++++++++++ mailnews/base/util/nsMsgDBFolder.h | 1 + mailnews/local/src/nsLocalMailFolder.cpp | 27 ------------------------ mailnews/local/src/nsLocalMailFolder.h | 1 - 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/mailnews/base/util/nsMsgDBFolder.cpp b/mailnews/base/util/nsMsgDBFolder.cpp index 0a04799ecd8..dc53e2d9fc1 100644 --- a/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mailnews/base/util/nsMsgDBFolder.cpp @@ -1027,3 +1027,29 @@ nsMsgDBFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode) return NS_OK; } + +nsresult nsMsgDBFolder::NotifyStoreClosedAllHeaders() +{ + nsCOMPtr enumerator; + + GetMessages(nsnull, getter_AddRefs(enumerator)); + nsCOMPtr folderSupports; + nsresult rv = QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(folderSupports)); + if (enumerator) + { + PRBool hasMoreElements; + while(NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements)) && hasMoreElements) + { + nsCOMPtr 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 dbMessage(do_QueryInterface(childSupports, &rv)); + if(NS_SUCCEEDED(rv) && dbMessage) + dbMessage->SetMsgDBHdr(nsnull); + } + } + return NS_OK; +} diff --git a/mailnews/base/util/nsMsgDBFolder.h b/mailnews/base/util/nsMsgDBFolder.h index 8f03ae602d6..9ee82c532ae 100644 --- a/mailnews/base/util/nsMsgDBFolder.h +++ b/mailnews/base/util/nsMsgDBFolder.h @@ -97,6 +97,7 @@ protected: nsresult GetFolderCacheKey(nsIFileSpec **aFileSpec); nsresult GetFolderCacheElemFromFileSpec(nsIFileSpec *fileSpec, nsIMsgFolderCacheElement **cacheElement); + nsresult NotifyStoreClosedAllHeaders(); protected: nsCOMPtr mDatabase; nsString mCharset; diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index ce443912edb..10e59c106bf 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -1142,33 +1142,6 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Compact() return rv; } - -nsresult nsMsgLocalMailFolder::NotifyStoreClosedAllHeaders() -{ - nsCOMPtr enumerator; - - GetMessages(nsnull, getter_AddRefs(enumerator)); - nsCOMPtr folderSupports; - nsresult rv = QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(folderSupports)); - if (enumerator) - { - PRBool hasMoreElements; - while(NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements)) && hasMoreElements) - { - nsCOMPtr 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 dbMessage(do_QueryInterface(childSupports, &rv)); - if(NS_SUCCEEDED(rv) && dbMessage) - dbMessage->SetMsgDBHdr(nsnull); - } - } - return NS_OK; -} - NS_IMETHODIMP nsMsgLocalMailFolder::EmptyTrash(nsIMsgWindow *msgWindow, nsIUrlListener *aListener) { diff --git a/mailnews/local/src/nsLocalMailFolder.h b/mailnews/local/src/nsLocalMailFolder.h index 6ae77614d69..8a05a099e98 100644 --- a/mailnews/local/src/nsLocalMailFolder.h +++ b/mailnews/local/src/nsLocalMailFolder.h @@ -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