summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qbc.io>2019-05-31 19:46:24 +0900
committerTasuku Suzuki <tasuku.suzuki@qbc.io>2019-07-11 01:48:59 +0900
commitf6d815922d66c4239c8158d00fe9bfeecf4f4b6e (patch)
tree174af8674a4eeb7a00a3c4928e22a1bff60ca513 /src/gui/opengl
parenta9aa206b7b8ac4e69f8c46233b4080e00e845ff5 (diff)
Fix build without feature.temporaryfile
Change-Id: I096b6a7d9cc8e17165e07657f6647a14baafefa5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
index c96021a969..74b91086ee 100644
--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
@@ -398,10 +398,16 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId)
writeUInt(&blobFormatPtr, blobFormat);
+#if QT_CONFIG(temporaryfile)
QSaveFile f(cacheFileName(cacheKey));
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
f.write(blob);
if (!f.commit())
+#else
+ QFile f(cacheFileName(cacheKey));
+ if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ if (f.write(blob) < blob.length())
+#endif
qCDebug(DBG_SHADER_CACHE, "Failed to write %s to shader cache", qPrintable(f.fileName()));
} else {
qCDebug(DBG_SHADER_CACHE, "Failed to create %s in shader cache", qPrintable(f.fileName()));