Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8
-
None
-
50b9979f89c6bdb761762e8c42176acb6bd7f18c
Description
qtdeclarative/tools/qmltc/qmltccodewriter.cpp:221
static void writeToFile(const QString &path, const QByteArray &data) { // When not using dependency files, changing a single qml invalidates all // qml files and would force the recompilation of everything. To avoid that, // we check if the data is equal to the existing file, if yes, don't touch // it so the build system will not recompile unnecessary things. // // If the build system use dependency file, we should anyway touch the file // so qmltc is not re-run QFileInfo fi(path); if (fi.exists() && fi.size() == data.size()) { QFile oldFile(path); oldFile.open(QIODevice::ReadOnly); if (oldFile.readAll() == data) return; } QFile file(path); file.open(QIODevice::WriteOnly); file.write(data); }
There's no error checking done here for filesystem errors. Is a qFatal() appropriate, or should the code be refactored to handle the error cleanly?