Clear bibfile cache when set of bibliography files change

Part of #9158

(cherry picked from commit 4115d2487f)
This commit is contained in:
Juergen Spitzmueller 2018-10-13 11:06:24 +02:00
parent e00b11355d
commit 149526c154
3 changed files with 10 additions and 3 deletions

View File

@ -2470,6 +2470,12 @@ void Buffer::checkIfBibInfoCacheIsValid() const
} }
void Buffer::clearBibFileCache() const
{
bibfileCache.clear();
}
void Buffer::reloadBibInfoCache() const void Buffer::reloadBibInfoCache() const
{ {
// use the master's cache // use the master's cache
@ -2487,7 +2493,7 @@ void Buffer::reloadBibInfoCache() const
// FIXME Is this sufficient? Or should we also force that // FIXME Is this sufficient? Or should we also force that
// in some other cases? If so, then it is easy enough to // in some other cases? If so, then it is easy enough to
// add the following line in some other places. // add the following line in some other places.
bibfileCache.clear(); clearBibFileCache();
d->bibinfo_.clear(); d->bibinfo_.clear();
FileNameList checkedFiles; FileNameList checkedFiles;
collectBibKeys(checkedFiles); collectBibKeys(checkedFiles);

View File

@ -509,8 +509,8 @@ public:
/// Calling this method invalidates the cache and so requires a /// Calling this method invalidates the cache and so requires a
/// re-read. /// re-read.
void invalidateBibinfoCache() const; void invalidateBibinfoCache() const;
/// This invalidates the cache of files we need to check. /// Clear the bibfiles cache
void invalidateBibfileCache() const; void clearBibFileCache() const;
/// Updates the cached bibliography information, checking first to see /// Updates the cached bibliography information, checking first to see
/// whether the cache is valid. If so, we do nothing. If not, then we /// whether the cache is valid. If so, we do nothing. If not, then we
/// reload all the BibTeX info. /// reload all the BibTeX info.

View File

@ -117,6 +117,7 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
cur.recordUndo(); cur.recordUndo();
setParams(p); setParams(p);
buffer().removeBiblioTempFiles(); buffer().removeBiblioTempFiles();
cur.buffer()->clearBibFileCache();
cur.forceBufferUpdate(); cur.forceBufferUpdate();
break; break;
} }