From e7d19a2a0fcbec38b7e132634d0ebe79b772c61b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 27 Nov 2018 17:22:36 +0100 Subject: Fix stale QML cache files when using assets:// on Android When the "source file system" cannot provide us with a reliable time stamp for a .qml file, do not try to save a cache file to disk. Otherwise we may end up with stale cache files that are loaded despite the source having changed. We used to fall back to the app binary time stamp, but that was needed before we correctly stored the time stamp of resources in the qrc data. Fixes: QTBUG-68736 Change-Id: I8c2f8939d253472ce8bc1e3a59e8142d21f07539 Reviewed-by: Ulf Hermann Reviewed-by: Richard Weickelt --- src/qml/qml/qqmltypeloader.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/qml/qml') diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index cb90af4cf0..9df502f778 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -3285,14 +3285,7 @@ QDateTime QQmlDataBlob::SourceCodeData::sourceTimeStamp() const if (hasInlineSourceCode) return QDateTime(); - QDateTime timeStamp = fileInfo.lastModified(); - if (timeStamp.isValid()) - return timeStamp; - - static QDateTime appTimeStamp; - if (!appTimeStamp.isValid()) - appTimeStamp = QFileInfo(QCoreApplication::applicationFilePath()).lastModified(); - return appTimeStamp; + return fileInfo.lastModified(); } bool QQmlDataBlob::SourceCodeData::exists() const -- cgit v1.2.3