diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index b9bc390b52..4c04707975 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/support/FileName.cpp b/src/support/FileName.cpp index 09984fdab0..ffe14c4f88 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -460,6 +460,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 51c149ff9e..3d64ad091f 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.