aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/imageviewer/imageview.cpp
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2022-09-09 13:48:08 +0200
committerEike Ziller <[email protected]>2022-09-12 11:57:04 +0000
commit2c51e4bc1754904695c3d1cfa4fcce86aa3f7245 (patch)
tree67935a1b4e6af7e4b002ba776ab1cacd9ca3b93a /src/plugins/imageviewer/imageview.cpp
parent28349c1b08876c93c6039afe7022de3244bf7f4b (diff)
FilePath: Return optional bytearray for file contents
For differentiating between "error" and "empty file". Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/imageviewer/imageview.cpp')
-rw-r--r--src/plugins/imageviewer/imageview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/imageviewer/imageview.cpp b/src/plugins/imageviewer/imageview.cpp
index 78ebcef1910..f22c4c21e32 100644
--- a/src/plugins/imageviewer/imageview.cpp
+++ b/src/plugins/imageviewer/imageview.cpp
@@ -233,7 +233,7 @@ void ImageView::exportMultiImages()
void ImageView::copyDataUrl()
{
Utils::MimeType mimeType = Utils::mimeTypeForFile(m_file->filePath());
- QByteArray data = m_file->filePath().fileContents();
+ QByteArray data = m_file->filePath().fileContents().value_or(QByteArray());
const auto url = QStringLiteral("data:%1;base64,%2")
.arg(mimeType.name())
.arg(QString::fromLatin1(data.toBase64()));