Fix build without features.temporaryfile
Change-Id: I3f26f122a20aa8e59baaf3f33b89cc776865ff8b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
0a96d8fb38
commit
64e977cfac
@ -1460,7 +1460,7 @@ void QConfFileSettingsPrivate::syncConfFile(int confFileNo)
|
||||
ensureAllSectionsParsed(confFile);
|
||||
ParsedSettingsMap mergedKeys = confFile->mergedKeyMap();
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
|
||||
QSaveFile sf(confFile->name);
|
||||
#else
|
||||
QFile sf(confFile->name);
|
||||
@ -1488,7 +1488,7 @@ void QConfFileSettingsPrivate::syncConfFile(int confFileNo)
|
||||
ok = writeFunc(sf, tempOriginalKeys);
|
||||
}
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
|
||||
if (ok)
|
||||
ok = sf.commit();
|
||||
#endif
|
||||
|
@ -194,8 +194,11 @@ static QVector<QComposeTableElement> loadCache(const QComposeCacheFileHeader &co
|
||||
static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QComposeTableElement> &vec)
|
||||
{
|
||||
const QString filePath = getCacheFilePath();
|
||||
#if QT_CONFIG(temporaryfile)
|
||||
QSaveFile outputFile(filePath);
|
||||
|
||||
#else
|
||||
QFile outputFile(filePath);
|
||||
#endif
|
||||
if (!outputFile.open(QIODevice::WriteOnly))
|
||||
return false;
|
||||
const char *data = reinterpret_cast<const char*>(&info);
|
||||
@ -207,7 +210,11 @@ static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QCompos
|
||||
|
||||
if (outputFile.write(data, size) != size)
|
||||
return false;
|
||||
#if QT_CONFIG(temporaryfile)
|
||||
return outputFile.commit();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
TableGenerator::TableGenerator() : m_state(NoErrors),
|
||||
|
@ -1914,6 +1914,7 @@ static inline bool isWindowsBuildDirectory(const QString &dirName)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(temporaryfile)
|
||||
/*!
|
||||
Extracts a directory from resources to disk. The content is extracted
|
||||
recursively to a temporary folder. The extracted content is removed
|
||||
@ -1974,6 +1975,7 @@ QSharedPointer<QTemporaryDir> QTest::qExtractTestData(const QString &dirName)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif // QT_CONFIG(temporaryfile)
|
||||
|
||||
/*! \internal
|
||||
*/
|
||||
|
@ -283,7 +283,9 @@ namespace QTest
|
||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(temporaryfile)
|
||||
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
|
||||
#endif
|
||||
Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
||||
Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user