aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient/mainDialog.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-13 11:07:17 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-13 11:07:17 +0200
commitfb9e4055f24753461b55d097fa2831dd3d467df2 (patch)
tree270afb141400833a947799bebaca5974152a71fc /examples/GuiClient/mainDialog.cpp
parent5daff75e60f862ce721dbe1358e54036b6d25ebe (diff)
downloadqxmpp-fb9e4055f24753461b55d097fa2831dd3d467df2.tar.gz
set default avatar
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);