2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include "../user/user.h"
26 #include "../common.h"
27 #include "listcommon.h"
29 #include "personlistitem.h"
31 PersonListItem::PersonListItem()
33 qDebug() << __PRETTY_FUNCTION__;
35 setSubitemTextWidth(SUBITEM_TEXT_MAX_WIDTH);
38 PersonListItem::~PersonListItem()
40 qDebug() << __PRETTY_FUNCTION__;
43 GeoCoordinate PersonListItem::coordinates() const
45 qDebug() << __PRETTY_FUNCTION__;
50 QString PersonListItem::facebookId() const
55 void PersonListItem::setAvatarImage(const QPixmap &image)
57 qDebug() << __PRETTY_FUNCTION__;
63 void PersonListItem::setCoordinates(const GeoCoordinate &coordinates)
65 qDebug() << __PRETTY_FUNCTION__;
67 m_coordinates = coordinates;
70 void PersonListItem::setFacebookId(const QString &facebookId)
72 qDebug() << __PRETTY_FUNCTION__;
74 m_facebookId = facebookId;
77 void PersonListItem::setPersonData(const User &user)
79 qDebug() << __PRETTY_FUNCTION__;
81 setFacebookId(user.userId());
83 setTitle(shortenText(user.name(), NAME_TEXT_MAX_WIDTH - MARGIN * 3,
84 ListItem::TEXT_SIZE_NORMAL));
85 setCoordinates(user.coordinates());
87 if (!user.profileImage().isNull())
88 setImage(user.profileImage());
94 foreach (QString tag, user.tags())
95 tagsText.append("[" + tag + "] ");
97 addSubItem(tagsText, QPixmap(":/res/images/tag.png"));