Utils: filepathify TextFileFormat

Change-Id: I6a4e2d38b0bbdec661a4a492901d9182a9f2e502
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2021-05-18 07:57:14 +02:00
parent f8ca730121
commit 8b7a90ac51
18 changed files with 94 additions and 69 deletions

View File

@@ -543,7 +543,7 @@ bool QmlBuildSystem::renameFile(Node * context, const QString &filePath, const Q
QString error;
Utils::TextFileFormat textFileFormat;
const QTextCodec *codec = QTextCodec::codecForName("UTF-8"); // qml files are defined to be utf-8
if (Utils::TextFileFormat::readFile(qmlProjectFilePath.toString(), codec, &fileContent, &textFileFormat, &error)
if (Utils::TextFileFormat::readFile(qmlProjectFilePath, codec, &fileContent, &textFileFormat, &error)
!= Utils::TextFileFormat::ReadSuccess) {
qWarning() << "Failed to read file" << qmlProjectFilePath << ":" << error;
}
@@ -556,7 +556,7 @@ bool QmlBuildSystem::renameFile(Node * context, const QString &filePath, const Q
fileContent.replace(match.capturedStart(1), match.capturedLength(1), QFileInfo(newFilePath).fileName());
if (!textFileFormat.writeFile(qmlProjectFilePath.toString(), fileContent, &error))
if (!textFileFormat.writeFile(qmlProjectFilePath, fileContent, &error))
qWarning() << "Failed to write file" << qmlProjectFilePath << ":" << error;
refresh(Everything);