FriendLocationItem::FriendLocationItem(const QPixmap &icon,
const QPointF &friendsLocation,
QObject *parent)
+ : BaseLocationItem(parent)
+
{
- Q_UNUSED(parent);
+ //Q_UNUSED(parent);
qDebug() << __PRETTY_FUNCTION__;
setPixmap(icon);
setPosition(QPointF( friendsLocation.x(), friendsLocation.y() ));
setZValue(FRIEND_LOCATION_ICON_Z_LEVEL);
setOffset(-icon.width()/2, -icon.height()/2);
- setFlag(QGraphicsItem::ItemIgnoresTransformations);
- m_name = new QString;
+ setFlag(QGraphicsItem::ItemIgnoresTransformations);
}
+
void FriendLocationItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
Q_UNUSED(event);
qDebug() << "Friends Location is " << position().x() << " " << position().y();
- qDebug() << "Name of the friend is " << m_name->toAscii();
- emit iconClicked(*m_name);
+ qDebug() << "Friends user ID is " << m_userId.toAscii();
+ emit iconClicked(m_userId);
}
-QString FriendLocationItem::name() const
+QString FriendLocationItem::userId() const
{
- return *m_name;
+ return m_userId;
}
-void FriendLocationItem::setName(const QString &name)
+void FriendLocationItem::setUserId(const QString &userId)
{
- *m_name = name;
+ m_userId = userId;
}
FriendLocationItem(const QPixmap &icon, const QPointF &friendsLocation, QObject *parent = 0);
/**
- * @brief getter for name
+ * @brief getter for m_userId
*
- * @return QString name of friend
+ * @return QString friends user identity
*/
- QString name() const;
+ QString userId() const;
/**
* @brief sets name for friend.
*
- * @param name friends name
+ * @param userID friends user identity
*/
- void setName(const QString &name);
+ void setUserId(const QString &userId);
signals:
/**
* @brief signal is emitted when friends icon is clicked on the map
*
- * @param name friends name
+ * @param m_userId friends user identity
*/
- void iconClicked(QString name);
+ void iconClicked(QString m_userId);
protected:
/**
* @brief method that detects when friend icon is clicked
*
- * @param event detects the mouse click (same as touch in maemo)
+ * @param event detects the mouse click (or touch in Maemo)
*/
void mousePressEvent(QGraphicsSceneMouseEvent *event);
private:
- QString *m_name; ///< Friends name
+ QString m_userId; ///< Friends user ID
};
#endif // FRIENDLOCATIONITEM_H
const int MAX_MAP_ZOOM_LEVEL = 18; ///< Maximum zoom level
const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
+/**
+* \var FRIEND_LOCATION_ICON_Z_LEVEL
+* \brief layer of friend location icon
+*/
+const int FRIEND_LOCATION_ICON_Z_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL + MAX_MAP_ZOOM_LEVEL + 1;
+
+/**
+* \var OWN_LOCATION_ICON_Z_LEVEL
+* \brief layer of own location icon
+*/
+const int OWN_LOCATION_ICON_Z_LEVEL = FRIEND_LOCATION_ICON_Z_LEVEL + 1;
+
+const int MAP_ZOOM_PANEL_LEVEL = OWN_LOCATION_ICON_Z_LEVEL + 1; ///< Zepth of zoom panel (Z-axis)
+
+
const int ZOOM_FPS = 30; ///< FPS for the zoom effect
const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
static const int MAP_ZOOM_PANEL_POSITION_X = 10; ///< Horizontal position of zoom panel
static const int MAP_ZOOM_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
-static const int MAP_ZOOM_PANEL_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL
- + MAX_MAP_ZOOM_LEVEL + 2; ///< Zepth of zoom panel (Z-axis)
+
static const int MAP_ZOOM_PANEL_BUTTON_SIZE = 74; ///< Size of a zoom panel button
static const int MAP_OWN_LOCATION_ICON_SIZE = 24; ///< Size of own location item icon
-static const int OWN_LOCATION_ICON_Z_LEVEL = MAP_ZOOM_PANEL_LEVEL - 1; ///< Z-Level of own location icon
-const int FRIEND_LOCATION_ICON_Z_LEVEL = OWN_LOCATION_ICON_Z_LEVEL -1; ///< Z-Level of friend location icon
+
const qreal MAX_LATITUDE = 85.05112877980659237802; ///< Maximum latitude value
const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
= new FriendLocationItem(friendsList.at(i)->profileImage(),
friendsList.at(i)->coordinates(),0);
- friendLocation->setName(friendsList.at(i)->name());
+ friendLocation->setUserId(friendsList.at(i)->userId());
m_friendsLocations.append(friendLocation);
m_mapScene->addItem(friendLocation);
}
connect(this, SIGNAL(reverseGeoReady(QString)), m_locationDialog, SLOT(setAddress(QString)));
connect(m_locationDialog, SIGNAL(statusUpdate(QString,bool)), this,
SIGNAL(statusUpdate(QString,bool)));
-
- m_networkManager = new QNetworkAccessManager;
- m_situareService = new SituareService(this,m_networkManager);
connect(this, SIGNAL(userLocationReady(User*)),
m_mapViewScreen, SLOT(userLocationReady(User*)));
UpdateLocationDialog *m_locationDialog; ///< Message dialog
MapViewScreen *m_mapViewScreen;
FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
- QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
- SituareService *m_situareService; ///< Instance of the situare server communication service
bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
QAction *m_toListViewAct; ///< Action to trigger switch to list view