Merge branch 'master' into stacked_friends
[situare] / src / map / mapengine.h
index 304c1e2..3b72783 100644 (file)
@@ -5,6 +5,7 @@
        Sami Rämö - sami.ramo@ixonos.com
        Jussi Laitinen - jussi.laitinen@ixonos.com
        Pekka Nissinen - pekka.nissinen@ixonos.com
+       Ville Tiensuu - ville.tiensuu@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -45,6 +46,7 @@ class FriendItemsHandler;
 * @author Sami Rämö - sami.ramo (at) ixonos.com
 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
+* @author Ville Tiensuu - ville.tiensuu (at) ixonos.com
 */
 class MapEngine : public QObject
 {
@@ -153,6 +155,7 @@ public slots:
     * @param user User info
     */
     void receiveOwnLocation(User *user);
+
     /**
     * @brief Slot to catch friends location data
     *
@@ -172,6 +175,13 @@ private:
     QRect calculateTileGrid(QPoint sceneCoordinate);
 
     /**
+    * @brief clean old friend data from m_mapScene and m_friendItems
+    *
+    * @param friendsList QList item of friend information
+    */
+    void cleanOldFriendData(const QList<User *> &friendsList);
+
+    /**
     * @brief Get new tiles.
     *
     * Calculates which tiles has to be fetched. Does emit fetchImage for tiles which
@@ -197,6 +207,20 @@ private:
     int tileMaxValue(int zoomLevel);
 
     /**
+    * @brief updates data member m_friendItems from given parameter
+    *
+    * @param friendsList QList item of friend information
+    */
+    void updateFriendItemList(const QList<User *> &friendsList);
+
+    /**
+    * @brief updates data member m_friendItems values that differs from given parameter
+    *
+    * @param friendsList QList item of friend information
+    */
+    void updateFriendLocationsAndImages(const QList<User *> &friendsList);
+
+    /**
     * @brief Updates the current view rect including margins
     *
     * Calculates tiles rect in scene based on m_viewTilesGrid and
@@ -277,7 +301,7 @@ private:
     QSize m_viewSize; ///< Current view size
     bool m_zoomedIn; ///< Flag for checking if zoomed in when zoom is finished
     int m_zoomLevel; ///< Current zoom level
-    QList<FriendLocationItem *> m_friendsLocations; ///< Location of friends
+    QList<FriendLocationItem *> m_friendItems; ///< List of friendLocationItems
 };
 
 #endif // MAPENGINE_H