aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient/mainDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/GuiClient/mainDialog.cpp')
-rw-r--r--examples/GuiClient/mainDialog.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp
index dab9da2c..1e13ea7d 100644
--- a/examples/GuiClient/mainDialog.cpp
+++ b/examples/GuiClient/mainDialog.cpp
@@ -529,14 +529,17 @@ void mainDialog::showLoginStatusWithCounter(const QString& msg, int time)
void mainDialog::updateVCard(const QString& bareJid)
{
- const QXmppVCardIq vCard = m_vCardCache.getVCard(bareJid);
- const QImage avatar = m_vCardCache.getAvatar(bareJid);
-
// determine full name
+ const QXmppVCardIq vCard = m_vCardCache.getVCard(bareJid);
QString fullName = vCard.fullName();
if (fullName.isEmpty())
fullName = bareJid;
+ // determine avatar
+ QImage avatar = m_vCardCache.getAvatar(bareJid);
+ if (avatar.isNull())
+ avatar = QImage(":/icons/resource/avatar.png");
+
if (bareJid == m_xmppClient.configuration().jidBare()) {
// update our own information
m_statusWidget.setAvatar(avatar);