keep folder cache from getting stale, r=putterman 18346

This commit is contained in:
bienvenu%netscape.com 2000-07-26 21:22:54 +00:00
Родитель 1e613ec962
Коммит e344bdaccc
4 изменённых файлов: 16 добавлений и 5 удалений

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

@ -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
*/

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

@ -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);
};

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

@ -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)
{

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

@ -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;
}