Added FriendGroupItem and FriendItemsHandler classes
[situare] / src / map / mapengine.cpp
index 4b68360..95bfceb 100644 (file)
@@ -30,6 +30,7 @@
 #include <QHashIterator>
 #include <QRect>
 
+#include "frienditemshandler.h"
 #include "mapengine.h"
 #include "maptile.h"
 
@@ -55,7 +56,11 @@ MapEngine::MapEngine(QObject *parent)
     connect(m_mapZoomPanel, SIGNAL(zoomInPressed()), this, SLOT(zoomIn()));
     connect(m_mapZoomPanel, SIGNAL(zoomOutPressed()), this, SLOT(zoomOut()));
 
-   m_ownLocation = new OwnLocationItem(QPointF());
+    /// @todo VILLE: m_ownLocation ei poisteta mikäli ei koskaan saa tietoa sijainnista jolloin vasta
+    /// lisätään sceneen
+    m_ownLocation = new OwnLocationItem(QPointF());
+
+    m_friendItemsHandler = new FriendItemsHandler(this);
 }
 
 MapEngine::~MapEngine()
@@ -333,5 +338,11 @@ void MapEngine::receiveFriendLocations(QList<User *> &friendsList)
         friendLocation->setUserId(friendsList.at(i)->userId());
         m_friendsLocations.append(friendLocation);
         m_mapScene->addItem(friendLocation);
+
+        m_friendItemsHandler->refactorFriendItems();
     }
 }
+
+
+
+