]> git.lyx.org Git - lyx.git/commitdiff
Clear bibfile cache when set of bibliography files change
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Oct 2018 09:06:24 +0000 (11:06 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 14 Oct 2018 08:07:22 +0000 (10:07 +0200)
Part of #9158

(cherry picked from commit 4115d2487f57f58774ee2846aa2b35818c0bc1b9)

src/Buffer.cpp
src/Buffer.h
src/insets/InsetBibtex.cpp

index 583d3db52b86c2716f5c52445d569109e6d6f800..fce5b4ce97ff73046978796e0efe0636b9a44b44 100644 (file)
@@ -2470,6 +2470,12 @@ void Buffer::checkIfBibInfoCacheIsValid() const
 }
 
 
+void Buffer::clearBibFileCache() const
+{
+       bibfileCache.clear();
+}
+
+
 void Buffer::reloadBibInfoCache() const
 {
        // use the master's cache
@@ -2487,7 +2493,7 @@ void Buffer::reloadBibInfoCache() const
        // FIXME Is this sufficient? Or should we also force that
        // in some other cases? If so, then it is easy enough to
        // add the following line in some other places.
-       bibfileCache.clear();
+       clearBibFileCache();
        d->bibinfo_.clear();
        FileNameList checkedFiles;
        collectBibKeys(checkedFiles);
index 57efb8d00333064955ce516448fe1528759f9799..f30b1a3fca61882669035ee88d5b9a8452659403 100644 (file)
@@ -509,8 +509,8 @@ public:
        /// Calling this method invalidates the cache and so requires a
        /// re-read.
        void invalidateBibinfoCache() const;
-       /// This invalidates the cache of files we need to check.
-       void invalidateBibfileCache() const;
+       /// Clear the bibfiles cache
+       void clearBibFileCache() const;
        /// Updates the cached bibliography information, checking first to see
        /// whether the cache is valid. If so, we do nothing. If not, then we
        /// reload all the BibTeX info.
index 5f1b31a6293dd2d073506f128418dc0841f3b3c0..9724e953efb04a23444644c662099fd9ec630ea5 100644 (file)
@@ -117,6 +117,7 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.recordUndo();
                setParams(p);
                buffer().removeBiblioTempFiles();
+               cur.buffer()->clearBibFileCache();
                cur.forceBufferUpdate();
                break;
        }