forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user