aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-06-14 11:30:47 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-06-24 11:13:05 +0200
commite72637deed3aee3dd8ebc0b2d980bf18469ad270 (patch)
treeee13aeeb21ce06169ffacc60b69f1bc7eb47390d /src/qml/compiler/qv4compileddata.cpp
parent98330886bf2d3fb9ea6f7a07801df118855d944e (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/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 2cb24dc113..a7e0909b16 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -42,7 +42,6 @@
#include <private/qqmlirbuilder_p.h>
#include <QCoreApplication>
#include <QCryptographicHash>
-#include <QSaveFile>
#include <QScopeGuard>
#include <QFileInfo>
@@ -79,38 +78,6 @@ CompilationUnit::~CompilationUnit()
imports = nullptr;
}
-bool CompilationUnit::saveToDisk(const QString &outputFileName, QString *errorString) const
-{
- errorString->clear();
-
-#if QT_CONFIG(temporaryfile)
- // Foo.qml -> Foo.qmlc
- QSaveFile cacheFile(outputFileName);
- if (!cacheFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
- *errorString = cacheFile.errorString();
- return false;
- }
-
- SaveableUnitPointer saveable(this);
- qint64 headerWritten = cacheFile.write(saveable.data<char>(), saveable.size());
- if (headerWritten != saveable.size()) {
- *errorString = cacheFile.errorString();
- return false;
- }
-
- if (!cacheFile.commit()) {
- *errorString = cacheFile.errorString();
- return false;
- }
-
- return true;
-#else
- Q_UNUSED(outputFileName)
- *errorString = QStringLiteral("features.temporaryfile is disabled.");
- return false;
-#endif // QT_CONFIG(temporaryfile)
-}
-
void CompilationUnit::setUnitData(const Unit *unitData, const QmlUnit *qmlUnit,
const QString &fileName, const QString &finalUrlString)
{