diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-06-14 11:30:47 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-06-24 11:13:05 +0200 |
commit | e72637deed3aee3dd8ebc0b2d980bf18469ad270 (patch) | |
tree | ee13aeeb21ce06169ffacc60b69f1bc7eb47390d /src/qml/jsruntime/qv4executablecompilationunit.cpp | |
parent | 98330886bf2d3fb9ea6f7a07801df118855d944e (diff) |
Move saveToDisk into SaveableUnitPointer
This way we can keep the flag mutilation closely local to the place
where we write the data. Also, SaveableUnitPointer doesn't need a full
CompilationUnit this way.
Change-Id: I01872e4c406cb2ccbaa1fa35325cc063b1e8a7df
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index 7867dff769..1e725cbef7 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -687,7 +687,11 @@ bool ExecutableCompilationUnit::saveToDisk(const QUrl &unitUrl, QString *errorSt return false; } - return CompilationUnit::saveToDisk(localCacheFilePath(unitUrl), errorString); + return CompiledData::SaveableUnitPointer(unitData()).saveToDisk<char>( + [this, &unitUrl, errorString](const char *data, quint32 size) { + return CompiledData::SaveableUnitPointer::writeDataToFile(localCacheFilePath(unitUrl), data, + size, errorString); + }); } /*! |