Merge branch 'master' into listview
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 19 Jul 2010 07:12:01 +0000 (10:12 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 19 Jul 2010 07:12:01 +0000 (10:12 +0300)
Conflicts:
src/src.pro

1  2 
src/src.pro
src/ui/friendlistitem.cpp
src/ui/friendlistitem.h
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h

diff --cc src/src.pro
@@@ -37,7 -38,7 +38,6 @@@ SOURCES += main.cpp 
      ui/avatarimage.cpp \
      ui/friendlistitem.cpp \
      ui/friendlistpanel.cpp \
- #    ui/friendlistview.cpp \
 -    ui/friendlistview.cpp \
      ui/imagebutton.cpp \
      ui/logindialog.cpp \
      ui/mainwindow.cpp \
      ui/zoombuttonpanel.cpp \
      user/user.cpp \
      ui/fullscreenbutton.cpp \
 -    engine/mce.cpp
 +    engine/mce.cpp \
 +    ui/listview.cpp \
 +    ui/listitem.cpp \
 +    ui/listitemdelegate.cpp \
 +    ui/friendlistitemdelegate.cpp
- HEADERS += common.h \
+ HEADERS += application.h \
+     common.h \
      engine/engine.h \
      facebookservice/facebookauthentication.h \
      facebookservice/facebookcommon.h \
@@@ -91,7 -89,7 +92,6 @@@
      ui/avatarimage.h \
      ui/friendlistitem.h \
      ui/friendlistpanel.h \
- #    ui/friendlistview.h \
 -    ui/friendlistview.h \
      ui/imagebutton.h \
      ui/logindialog.h \
      ui/mainwindow.h \
@@@ -102,8 -170,8 +102,7 @@@ void FriendListItem::setUserData(User *
      if(user) {
          m_user = user;
  
--        if (!m_user->profileImage().isNull())
-             setData(AVATAR_IMAGE_INDEX, m_user->profileImage());
 -            m_findButton->setButtonIcon(m_user->profileImage());
++        setData(AVATAR_IMAGE_INDEX, m_user->profileImage());
  
          QString unit;
          double value;
      }
  }
  
+ void FriendListItem::setAvatarImage(const QPixmap &image)
+ {
+     qDebug() << __PRETTY_FUNCTION__;
+     if(!image.isNull())
 -        m_findButton->setButtonIcon(image);
++        setData(AVATAR_IMAGE_INDEX, m_user->profileImage());
+ }
  void FriendListItem::setDistanceIcon(double value, const QString &unit)
  {
 +    qDebug() << __PRETTY_FUNCTION__;
 +
      QPixmap distanceImage;
  
      if ((unit == "m") || (value < WALK_DISTANCE))
@@@ -86,18 -85,17 +86,25 @@@ public
      *
      * @param user User pointer
      */
 -    void setData(User *user);
 +    void setUserData(User *user);
  
+     /**
+     * @brief Sets avatar image for this item.
+     *
+     * @param image image
+     */
+     void setAvatarImage(const QPixmap &image);
  private:
      /**
 +    * @brief Calculates text rects.
 +    *
 +    * Caclulates distance, status, updated and location texts rects. Sets item's
 +    * expanded height from rects.
 +    */
 +    void calculateTextRects();
 +
 +    /**
      * @brief Set distance icon.
      *
      * Icon is selected by distance.
@@@ -70,6 -66,14 +71,16 @@@ FriendListPanel::FriendListPanel(QWidge
              this, SLOT(clearFriendListFilter()));
  }
  
+ void FriendListPanel::friendImageReady(User *user)
+ {
+     qDebug() << __PRETTY_FUNCTION__;
 -    FriendListItem *item = m_friendListView->widget(user->userId());
 -    item->setAvatarImage(user->profileImage());
++    FriendListItem *item = static_cast<FriendListItem*>(m_friendListView->listItem(user->userId()));
++
++    if (item)
++        item->setAvatarImage(user->profileImage());
+ }
  void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
  {
      qDebug() << __PRETTY_FUNCTION__;
Simple merge