UI: update contact avatar
This patch updates avatars after receiving vCard.
Change-Id: Icef2d0c9bb09090eea182971b952aa4e901e4818
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
diff --git a/src/delegates/ImageManipulationDelegate.mm b/src/delegates/ImageManipulationDelegate.mm
index 6bc9630..631ac57 100644
--- a/src/delegates/ImageManipulationDelegate.mm
+++ b/src/delegates/ImageManipulationDelegate.mm
@@ -229,6 +229,9 @@
QPixmap pxm;
const int radius = size.height() / 2;
+ /*
+ * we could not now clear cache and image coul be outdated
+ * so do not use cache now
// Check cache
auto index = QStringLiteral("%1%2%3").arg(size.width())
.arg(size.height())
@@ -237,6 +240,7 @@
if (convPixmCache.contains(index)) {
return convPixmCache.value(index);
}
+ */
auto contactPhoto = qvariant_cast<QPixmap>(personPhoto(QByteArray::fromStdString(avatar)));
contactPhoto = contactPhoto.scaled(size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
@@ -272,7 +276,7 @@
painter.drawRoundedRect(0,0,pxm.height(),pxm.height(),radius,radius);
// Save in cache
- convPixmCache.insert(index, pxm);
+ //convPixmCache.insert(index, pxm);
return pxm;
} else {