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:
@@ -274,7 +274,7 @@ public:
|
||||
if (fn.isEmpty())
|
||||
return;
|
||||
const int blockSize = m_widget->dataBlockSize();
|
||||
QByteArray data = fn.fileContents(blockSize, address);
|
||||
QByteArray data = fn.fileContents(blockSize, address).value_or(QByteArray());
|
||||
const int dataSize = data.size();
|
||||
if (dataSize != blockSize)
|
||||
data += QByteArray(blockSize - dataSize, 0);
|
||||
|
||||
Reference in New Issue
Block a user