зеркало из https://github.com/mozilla/pjs.git
keep folder cache from getting stale, r=putterman 18346
This commit is contained in:
Родитель
1e613ec962
Коммит
e344bdaccc
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче