aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlcachegen
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:21:42 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:21:42 +0200
commit6a0bb9a7d6a6473920da74bb48c52a4eaed990b0 (patch)
tree3a32c56b1fe21c96d5982511e0b4815c1c07dfbb /tools/qmlcachegen
parentf0d23d3ff9da26a71295a6abd356c8d366d17439 (diff)
parent2746518c76e02c642ff29faf568de4de90216e58 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'tools/qmlcachegen')
-rw-r--r--tools/qmlcachegen/generateloader.cpp6
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp6
-rw-r--r--tools/qmlcachegen/qtquickcompiler.prf10
3 files changed, 12 insertions, 10 deletions
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp
index 74208a25e2..1c8a5a016a 100644
--- a/tools/qmlcachegen/generateloader.cpp
+++ b/tools/qmlcachegen/generateloader.cpp
@@ -434,7 +434,11 @@ bool generateLoader(const QStringList &compiledFiles, const QStringList &sortedR
}
}
+#if QT_CONFIG(temporaryfile)
QSaveFile f(outputFileName);
+#else
+ QFile f(outputFileName);
+#endif
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
*errorString = f.errorString();
return false;
@@ -445,10 +449,12 @@ bool generateLoader(const QStringList &compiledFiles, const QStringList &sortedR
return false;
}
+#if QT_CONFIG(temporaryfile)
if (!f.commit()) {
*errorString = f.errorString();
return false;
}
+#endif
return true;
}
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index 1bfa2f0e98..6e96b88c0c 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -364,7 +364,11 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil
const QV4::CompiledData::SaveableUnitPointer &unit,
QString *errorString)
{
+#if QT_CONFIG(temporaryfile)
QSaveFile f(outputFileName);
+#else
+ QFile f(outputFileName);
+#endif
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
*errorString = f.errorString();
return false;
@@ -422,10 +426,12 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil
if (!writeStr("};\n}\n}\n"))
return false;
+#if QT_CONFIG(temporaryfile)
if (!f.commit()) {
*errorString = f.errorString();
return false;
}
+#endif
return true;
}
diff --git a/tools/qmlcachegen/qtquickcompiler.prf b/tools/qmlcachegen/qtquickcompiler.prf
index 24cbe7f2e5..2f98aadefe 100644
--- a/tools/qmlcachegen/qtquickcompiler.prf
+++ b/tools/qmlcachegen/qtquickcompiler.prf
@@ -1,15 +1,5 @@
if(qtc_run|lupdate_run): return()
-!contains(QT, qml) {
- qt_modules = \
- $$replace(QT, -private$, _private) \
- $$replace(QT_PRIVATE, -private$, _private)
- qt_modules = $$resolve_depends(qt_modules, "QT.", ".depends" ".run_depends")
- !contains(qt_modules, qml): \
- error("The qtquickcompiler feature cannot be used without the QML module.")
- unset(qt_modules)
-}
-
qtPrepareTool(QML_CACHEGEN, qmlcachegen, _FILTER)
qtPrepareTool(QMAKE_RCC, rcc, _DEP)