diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index 3c91520d26..5c48ea7869 100644 --- a/src/graphics/GraphicsCacheItem.cpp +++ b/src/graphics/GraphicsCacheItem.cpp @@ -349,8 +349,7 @@ static string const findTargetFormat(string const & from) bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from) { // First, check that the file exists! - // force a refresh. - filename_.lastModified(); + filename_.refresh(); if (!filename_.isReadableFile()) { if (status_ != ErrorNoFile) { status_ = ErrorNoFile; diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index b6eceb44fd..769d17f841 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -223,6 +223,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_GRAPHICS_RELOAD: + params_.filename.refresh(); graphic_->reload(); break; diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index ec8c671173..8a3edbdd28 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -474,6 +474,12 @@ FileName FileName::tempPath() } +void FileName::refresh() const +{ + d->refresh(); +} + + time_t FileName::lastModified() const { // QFileInfo caches information about the file. So, in case this file has diff --git a/src/support/FileName.h b/src/support/FileName.h index ebd703bb6a..ee53546c61 100644 --- a/src/support/FileName.h +++ b/src/support/FileName.h @@ -78,6 +78,8 @@ public: /// returns true if the file exists bool exists() const; + /// refreshes the file info + void refresh() const; /// \return true if this object points to a symbolic link. bool isSymLink() const; /// \return true if the file is empty.