From 9910064be2b7719b662beb837461f879ff4e7a78 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Wed, 13 Oct 2010 20:08:45 +0000 Subject: if the photo is empty return QByteArray() otherwise it generates a non null value --- examples/GuiClient/vCardCache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/GuiClient/vCardCache.cpp') diff --git a/examples/GuiClient/vCardCache.cpp b/examples/GuiClient/vCardCache.cpp index 49396f35..a9158ca1 100644 --- a/examples/GuiClient/vCardCache.cpp +++ b/examples/GuiClient/vCardCache.cpp @@ -135,6 +135,9 @@ QImage vCardCache::getAvatar(const QString& bareJid) const QByteArray vCardCache::getPhotoHash(const QString& bareJid) const { - return QCryptographicHash::hash(m_mapBareJidVcard[bareJid].photo(), + if(m_mapBareJidVcard[bareJid].photo().isEmpty()) + return QByteArray(); + else + return QCryptographicHash::hash(m_mapBareJidVcard[bareJid].photo(), QCryptographicHash::Sha1); } -- cgit v1.2.3