From: Scott Kostyshak Date: Wed, 19 Aug 2015 01:55:59 +0000 (-0400) Subject: Refresh file cache before checking existence X-Git-Tag: 2.2.0alpha1~380 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=43ca05ead4f7ea9b4fefe9888333fada4ae2d404;p=features.git Refresh file cache before checking existence This is done only inside LFUN_BUFFER_VIEW_CACHE so as to preserve the benefits of caching in other places. Without this commit, if a converter or a user (re)moves the preview file and then calls buffer-view-cache LyX will launch the viewer for a file that does not exist. For a discussion and use case, see: https://www.mail-archive.com/search?l=mid&q=55D393D7.6050403@lyx.org --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 2a67292c37..09cff3c95a 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2446,6 +2446,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag) break; case LFUN_BUFFER_VIEW_CACHE: + (d->preview_file_).refresh(); enable = (d->preview_file_).exists(); break;