First phase of userdata rewrite
[situare] / src / engine / engine.cpp
index 601ac66..289a578 100644 (file)
@@ -91,6 +91,12 @@ SituareEngine::SituareEngine(QMainWindow *parent)
     connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
             m_mapEngine, SIGNAL(friendsLocationsReady(QList<User*>&)));
 
+    connect(this, SIGNAL(friendImageReady(User*)),
+            m_ui, SIGNAL(friendImageReady(User*)));
+
+    connect(this, SIGNAL(friendImageReady(User*)),
+            m_mapEngine, SIGNAL(friendImageReady(User*)));
+
     m_automaticUpdateIntervalTimer = new QTimer(this);
     connect(m_automaticUpdateIntervalTimer, SIGNAL(timeout()),
             this, SLOT(startAutomaticUpdate()));
@@ -328,6 +334,16 @@ void SituareEngine::fetchUsernameFromSettings()
     m_ui->setUsername(m_facebookAuthenticator->loadUsername());
 }
 
+void SituareEngine::imageReady(User *user)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if(user->type())
+        emit userLocationReady(user);
+    else
+        emit friendImageReady(user);
+}
+
 void SituareEngine::initializeGpsAndAutocentering()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -637,6 +653,9 @@ void SituareEngine::signalsFromSituareService()
     connect(m_situareService, SIGNAL(error(int, int)),
             this, SLOT(error(int, int)));
 
+    connect(m_situareService, SIGNAL(imageReady(User*)),
+            this, SLOT(imageReady(User*)));
+
     connect(m_situareService, SIGNAL(reverseGeoReady(QString)),
             m_ui, SIGNAL(reverseGeoReady(QString)));