summaryrefslogtreecommitdiffstats
path: root/src/MxcImageProvider.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-03-22 04:32:11 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-03-22 04:32:11 +0100
commit30ba3870766ebdae647c400e52cabc65c0806c19 (patch)
tree6a9802efca6860c7a11c01ec7b797849b539b1b1 /src/MxcImageProvider.cpp
parent43a1975e16637d1c3edd7d77a1ad74da334ea165 (diff)
Fix thumbnails of received encrypted images
Diffstat (limited to 'src/MxcImageProvider.cpp')
-rw-r--r--src/MxcImageProvider.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp
index 6df5cd43..0a91dde3 100644
--- a/src/MxcImageProvider.cpp
+++ b/src/MxcImageProvider.cpp
@@ -65,9 +65,9 @@ MxcImageRunnable::run()
MxcImageProvider::download(
m_id,
m_requestedSize,
- [this](QString, QSize, QImage image, QString) {
+ [this](QString id, QSize, QImage image, QString) {
if (image.isNull()) {
- emit error(QStringLiteral("Failed to download image."));
+ emit error(QStringLiteral("Failed to download image: %1").arg(id));
} else {
emit done(image);
}
@@ -157,7 +157,6 @@ MxcImageProvider::download(const QString &id,
mtx::http::RequestErr err) {
if (err || res.empty()) {
download(id, QSize(), then, crop, radius);
-
return;
}
@@ -237,6 +236,7 @@ MxcImageProvider::download(const QString &id,
const std::string &originalFilename,
mtx::http::RequestErr err) {
if (err) {
+ nhlog::net()->error("Failed to download {}: {}", id.toStdString(), *err);
then(id, QSize(), {}, QLatin1String(""));
return;
}
@@ -244,6 +244,8 @@ MxcImageProvider::download(const QString &id,
auto tempData = res;
QFile f(fileInfo.absoluteFilePath());
if (!f.open(QIODevice::Truncate | QIODevice::WriteOnly)) {
+ nhlog::net()->error(
+ "Failed to write {}: {}", id.toStdString(), f.errorString().toStdString());
then(id, QSize(), {}, QLatin1String(""));
return;
}