diff options
| author | David Schulz <david.schulz@qt.io> | 2020-09-02 12:06:51 +0200 |
|---|---|---|
| committer | David Schulz <david.schulz@qt.io> | 2020-09-04 10:14:14 +0000 |
| commit | 339db00f8563c7fc865a6166114e684021ac260e (patch) | |
| tree | fad2b72c3ac36fc08ac3f5c24a2df8a2ded909d8 /src/plugins/qmlprojectmanager/qmlproject.cpp | |
| parent | e4dec0484c7becbeaeeda3d473bfe2f24dc52e94 (diff) | |
| download | qt-creator-339db00f8563c7fc865a6166114e684021ac260e.tar.gz | |
Core: replace QString with Utils::FilePath to get documents
Change-Id: I01777c227398be8bd3bf877c5429b84a75aa361b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlproject.cpp')
| -rw-r--r-- | src/plugins/qmlprojectmanager/qmlproject.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 9b4820586e..82d5967e4d 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -474,8 +474,8 @@ bool QmlBuildSystem::renameFile(Node * context, const QString &filePath, const Q setMainFile(newFilePath); // make sure to change it also in the qmlproject file - const QString qmlProjectFilePath = project()->projectFilePath().toString(); - Core::FileChangeBlocker fileChangeBlocker(qmlProjectFilePath); + const Utils::FilePath qmlProjectFilePath = project()->projectFilePath(); + Core::FileChangeBlocker fileChangeBlocker(qmlProjectFilePath.toString()); const QList<Core::IEditor *> editors = Core::DocumentModel::editorsForFilePath(qmlProjectFilePath); TextEditor::TextDocument *document = nullptr; if (!editors.isEmpty()) { @@ -489,7 +489,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, codec, &fileContent, &textFileFormat, &error) + if (Utils::TextFileFormat::readFile(qmlProjectFilePath.toString(), codec, &fileContent, &textFileFormat, &error) != Utils::TextFileFormat::ReadSuccess) { qWarning() << "Failed to read file" << qmlProjectFilePath << ":" << error; } @@ -502,7 +502,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, fileContent, &error)) + if (!textFileFormat.writeFile(qmlProjectFilePath.toString(), fileContent, &error)) qWarning() << "Failed to write file" << qmlProjectFilePath << ":" << error; refresh(Everything); |
