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

@@ -770,12 +770,12 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
QString contents;
{
QString errorMsg;
if (TextFileFormat::readFile(
filePath().toString(),
Core::EditorManager::defaultTextCodec(),
&contents,
&m_textFormat,
&errorMsg) != TextFileFormat::ReadSuccess) {
if (TextFileFormat::readFile(filePath(),
Core::EditorManager::defaultTextCodec(),
&contents,
&m_textFormat,
&errorMsg)
!= TextFileFormat::ReadSuccess) {
QmakeBuildSystem::proFileParseError(errorMsg, filePath());
return qMakePair(includeFile, lines);
}
@@ -932,7 +932,7 @@ void QmakePriFile::save(const QStringList &lines)
QTC_ASSERT(m_textFormat.codec, return);
FileChangeBlocker changeGuard(filePath().toString());
QString errorMsg;
if (!m_textFormat.writeFile(filePath().toString(), lines.join('\n'), &errorMsg)) {
if (!m_textFormat.writeFile(filePath(), lines.join('\n'), &errorMsg)) {
QMessageBox::critical(Core::ICore::dialogParent(), QCoreApplication::translate(
"QmakePriFile", "File Error"), errorMsg);
}