From: Jussi Laitinen Date: Thu, 24 Jun 2010 10:22:53 +0000 (+0300) Subject: Modified FriendListItem User member type. X-Git-Tag: v1.0~1 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=8a37ae5887a658d252f00c45a4ffa38b252d0870;p=situare Modified FriendListItem User member type. --- diff --git a/src/ui/friendlistitem.cpp b/src/ui/friendlistitem.cpp index 3cfc7fc..aa211f5 100644 --- a/src/ui/friendlistitem.cpp +++ b/src/ui/friendlistitem.cpp @@ -69,7 +69,7 @@ const int AEROPLANE_DISTANCE = 5000;///< Aeroplane distance limit for distance i FriendListItem::FriendListItem(QWidget *parent) : QWidget(parent) , m_expanded(false) - , m_user(0) +// , m_user(0) { qDebug() << __PRETTY_FUNCTION__; @@ -168,14 +168,14 @@ void FriendListItem::setData(User *user) qDebug() << __PRETTY_FUNCTION__; if(user) { - m_user = user; + m_user = *user; - if (!m_user->profileImage().isNull()) - m_findButton->setButtonIcon(m_user->profileImage()); + if (!m_user.profileImage().isNull()) + m_findButton->setButtonIcon(m_user.profileImage()); QString unit; double value; - user->distance(value, unit); + m_user.distance(value, unit); m_distanceTextLabel->setText(QString::number(value) + " " + unit); setDistanceIcon(value, unit); @@ -207,10 +207,10 @@ void FriendListItem::shortenTexts() QFontMetrics nameLabelMetrics = m_nameLabel->fontMetrics(); QFontMetrics otherLabelsMetrics = m_updatedLabel->fontMetrics(); - QString name = m_user->name(); - QString updated = m_user->timestamp(); - QString statusText = m_user->note(); - QString location = m_user->address(); + QString name = m_user.name(); + QString updated = m_user.timestamp(); + QString statusText = m_user.note(); + QString location = m_user.address(); int nameIndex = name.indexOf('\n'); int updatedIndex = updated.indexOf('\n'); @@ -250,9 +250,9 @@ void FriendListItem::setText(bool expanded) if (expanded) { setUpdatesEnabled(false); m_nameLabel->setText(m_shortenedName); - m_updatedLabel->setText(m_user->timestamp()); - m_statusTextLabel->setText(m_user->note()); - m_locationLabel->setText(m_user->address()); + m_updatedLabel->setText(m_user.timestamp()); + m_statusTextLabel->setText(m_user.note()); + m_locationLabel->setText(m_user.address()); setUpdatesEnabled(true); } else { @@ -312,5 +312,5 @@ void FriendListItem::findButtonClicked() { qDebug() << __PRETTY_FUNCTION__; - emit findFriend(m_user->coordinates()); + emit findFriend(m_user.coordinates()); } diff --git a/src/ui/friendlistitem.h b/src/ui/friendlistitem.h index cc8496c..f1c20fa 100644 --- a/src/ui/friendlistitem.h +++ b/src/ui/friendlistitem.h @@ -149,7 +149,7 @@ private: QString m_shortenedUpdated; ///< Shortened updated text QLabel *m_statusTextLabel; ///< Status text label QLabel *m_updatedLabel; ///< Updated label - User *m_user; ///< User data + User m_user; ///< User data }; #endif // FRIENDLISTITEM_H