forked from qt-creator/qt-creator
FilePath: Return optional bytearray for file contents
For differentiating between "error" and "empty file". Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -2431,7 +2431,7 @@ static CPlusPlus::Document::Ptr getParsedDocument(const FilePath &filePath,
|
||||
if (workingCopy.contains(filePath))
|
||||
src = workingCopy.source(filePath);
|
||||
else
|
||||
src = QString::fromLocal8Bit(filePath.fileContents()).toUtf8();
|
||||
src = QString::fromLocal8Bit(filePath.fileContents().value_or(QByteArray())).toUtf8();
|
||||
|
||||
CPlusPlus::Document::Ptr doc = snapshot.preprocessedDocument(src, filePath);
|
||||
doc->parse();
|
||||
|
||||
Reference in New Issue
Block a user