aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-08-01 15:57:53 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-08-04 14:32:11 +0000
commit01575a22ea2d2e54ef1748733929243ca024234b (patch)
tree0069207f40828894baee32346d44dd5e0d1b0bf9 /src/qml
parentd77e544a568dbfff698c4d37c669bc991383fe9b (diff)
Fix interaction of files selectors with disk caching
Make sure to save the .qmlc/.jsc files to the location determined by the file selectors. Change-Id: If535bb1e4f0d20ac692b3d8e6d563f77cd00446b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp3
-rw-r--r--src/qml/compiler/qv4compileddata_p.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index a4fffedbcd..cb5c14ebc2 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -320,7 +320,7 @@ bool CompilationUnit::verifyChecksum(QQmlEngine *engine,
sizeof(data->dependencyMD5Checksum)) == 0;
}
-bool CompilationUnit::saveToDisk(QString *errorString)
+bool CompilationUnit::saveToDisk(const QUrl &unitUrl, QString *errorString)
{
errorString->clear();
@@ -329,7 +329,6 @@ bool CompilationUnit::saveToDisk(QString *errorString)
return false;
}
- const QUrl unitUrl = url();
if (!unitUrl.isLocalFile()) {
*errorString = QStringLiteral("File has to be a local file.");
return false;
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index c79f4cf007..d6537bbab3 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -904,7 +904,7 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public QQmlRefCount
void destroy() Q_DECL_OVERRIDE;
- bool saveToDisk(QString *errorString);
+ bool saveToDisk(const QUrl &unitUrl, QString *errorString);
bool loadFromDisk(const QUrl &url, EvalISelFactory *iselFactory, QString *errorString);
protected:
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 538e630e98..0e1f9572e0 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2510,7 +2510,7 @@ void QQmlTypeData::compile(const QQmlRefPointer<QQmlTypeNameCache> &importCache,
}
if (diskCache() || forceDiskCacheRefresh()) {
QString errorString;
- if (!m_compiledData->saveToDisk(&errorString)) {
+ if (!m_compiledData->saveToDisk(url(), &errorString)) {
qCDebug(DBG_DISK_CACHE) << "Error saving cached version of" << m_compiledData->url().toString() << "to disk:" << errorString;
}
}
@@ -2944,7 +2944,7 @@ void QQmlScriptBlob::dataReceived(const Data &data)
if (diskCache() || forceDiskCacheRefresh()) {
QString errorString;
- if (!unit->saveToDisk(&errorString)) {
+ if (!unit->saveToDisk(url(), &errorString)) {
qCDebug(DBG_DISK_CACHE()) << "Error saving cached version of" << unit->url().toString() << "to disk:" << errorString;
}
}