[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/applets/presence
From:       Abner Silva <abner.silva () kdemail ! net>
Date:       2009-09-24 12:15:37
Message-ID: 1253794537.081615.3669.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1027628 by abnerf:

Setting the default avatar image when an invalid image is set.

 M  +9 -10     accountimage.cpp  


--- trunk/playground/base/plasma/applets/presence/accountimage.cpp #1027627:1027628
@@ -39,7 +39,7 @@
     border = 1; // should be a power of two, otherwise we get blurry lines
     fg = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
     bg = Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor);
-    m_pixmap = KIcon("system-users").pixmap(64, 64);
+    setPixmap(QPixmap());
 
 }
 
@@ -49,20 +49,19 @@
 
 void AccountImage::setImage(const QImage &image)
 {
-    if (!image.size().isEmpty()) {
-        m_pixmap = QPixmap::fromImage(image);
-        pixmapUpdated();
-        kDebug() << "----" << m_pixmap.size() << m_scaledPixmap.size();
-    }
+    if (!image.size().isEmpty())
+        setPixmap(QPixmap::fromImage(image));
 }
 
 void AccountImage::setPixmap(const QPixmap &pixmap)
 {
-    if (!pixmap.size().isEmpty()) {
+    if (!pixmap.size().isEmpty())
         m_pixmap = pixmap;
-        pixmapUpdated();
-        kDebug() << "----" << m_pixmap.size() << m_scaledPixmap.size();
-    }
+    else
+        m_pixmap = KIcon("system-users").pixmap(64, 64);
+
+    pixmapUpdated();
+    kDebug() << "----" << m_pixmap.size() << m_scaledPixmap.size();
 }
 
 void AccountImage::pixmapUpdated()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic