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
This commit is contained in:
Scott Kostyshak 2015-08-18 21:55:59 -04:00
parent 488ce900e0
commit 43ca05ead4

View File

@ -2446,6 +2446,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break; break;
case LFUN_BUFFER_VIEW_CACHE: case LFUN_BUFFER_VIEW_CACHE:
(d->preview_file_).refresh();
enable = (d->preview_file_).exists(); enable = (d->preview_file_).exists();
break; break;