keep folder cache from getting stale, r=putterman 18346

git-svn-id: svn://10.0.0.236/trunk@74827 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
2000-07-26 21:22:54 +00:00
parent db4490125e
commit 14d5fffb63
4 changed files with 16 additions and 5 deletions

View File

@@ -291,7 +291,7 @@ const nsMsgBiffState nsMsgBiffState_Unknown = 2; // We dunno whether there is ne
* write out summary data for this folder
* to the given folder cache (i.e. panacea.dat)
*/
void writeToFolderCache(in nsIMsgFolderCache folderCache);
void writeToFolderCache(in nsIMsgFolderCache folderCache, in boolean deep);
/**
* the charset of this folder
@@ -309,6 +309,8 @@ const nsMsgBiffState nsMsgBiffState_Unknown = 2; // We dunno whether there is ne
*/
readonly attribute wstring newMessagesNotificationDescription;
// are we running a url as a result of the user clicking get msg?
attribute boolean gettingNewMessages;
/**
* local path of this folder
*/

View File

@@ -32,4 +32,5 @@ interface nsIMsgFolderCache : nsISupports
void Init(in nsIFileSpec fileSpec);
nsIMsgFolderCacheElement GetCacheElement(in string key, in boolean createIfMissing);
void Close();
void Commit(in boolean compress);
};

View File

@@ -416,11 +416,19 @@ NS_IMETHODIMP nsMsgFolderCache::GetCacheElement(const char *pathKey, PRBool crea
NS_IMETHODIMP nsMsgFolderCache::Close()
{
nsresult ret=NS_OK;
return Commit(PR_TRUE);
}
nsIMdbThumb *commitThumb = NULL;
NS_IMETHODIMP nsMsgFolderCache::Commit(PRBool compress)
{
nsresult ret = NS_OK;
nsIMdbThumb *commitThumb = nsnull;
if (m_mdbStore)
ret = m_mdbStore->CompressCommit(GetEnv(), &commitThumb);
if (compress)
ret = m_mdbStore->CompressCommit(GetEnv(), &commitThumb);
else
ret = m_mdbStore->LargeCommit(GetEnv(), &commitThumb);
if (commitThumb)
{

View File

@@ -163,7 +163,7 @@ NS_IMETHODIMP nsMsgIncomingServer::WriteToFolderCache(nsIMsgFolderCache *folderC
{
nsCOMPtr <nsIMsgFolder> msgFolder = do_QueryInterface(m_rootFolder, &rv);
if (NS_SUCCEEDED(rv) && msgFolder)
rv = msgFolder->WriteToFolderCache(folderCache);
rv = msgFolder->WriteToFolderCache(folderCache, PR_TRUE /* deep */);
}
return rv;
}