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:
@@ -361,8 +361,12 @@ static std::unique_ptr<QTextDocument> getCurrentDocument(const QString &path)
|
||||
QString contents;
|
||||
Utils::TextFileFormat format;
|
||||
QString error;
|
||||
if (Utils::TextFileFormat::readFile(path, defaultCodec, &contents, &format, &error)
|
||||
!= Utils::TextFileFormat::ReadSuccess) {
|
||||
if (Utils::TextFileFormat::readFile(Utils::FilePath::fromString(path),
|
||||
defaultCodec,
|
||||
&contents,
|
||||
&format,
|
||||
&error)
|
||||
!= Utils::TextFileFormat::ReadSuccess) {
|
||||
qWarning() << "Error reading file " << path << " : " << error;
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user