зеркало из https://github.com/mozilla/pjs.git
fix problem selecting local folder after compacting it r=putterman 51651
This commit is contained in:
Родитель
d13f47502f
Коммит
0c50761ef4
|
@ -1065,6 +1065,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Compact()
|
|||
rv = NS_ERROR_OUT_OF_MEMORY; goto done;
|
||||
}
|
||||
|
||||
NotifyStoreClosedAllHeaders();
|
||||
|
||||
rv = GetMsgDatabase(nsnull, getter_AddRefs(db));
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
|
@ -1135,6 +1137,32 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Compact()
|
|||
}
|
||||
|
||||
|
||||
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,6 +151,7 @@ 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
|
||||
|
|
Загрузка…
Ссылка в новой задаче