Moved creating the FacebookLoginBrowser to FacebookAuthentication.
[situare] / src / engine / engine.cpp
index 6edd87e..2e39d84 100644 (file)
@@ -83,7 +83,7 @@ SituareEngine::SituareEngine()
     m_situareService = new SituareService(this);
 
     // build FacebookAuthenticator
-    m_facebookAuthenticator = new FacebookAuthentication(this);
+    m_facebookAuthenticator = new FacebookAuthentication(m_ui, this);
 
     // build routing service
     m_routingService = new RoutingService(this); // create this when needed, not in constructor!
@@ -355,15 +355,6 @@ void SituareEngine::locationSearch(QString location)
         m_geocodingService->requestLocation(location);
 }
 
-void SituareEngine::loggedIn()
-{
-    qWarning() << __PRETTY_FUNCTION__;
-
-    m_ui->destroyFacebookLoginBrowser();
-
-    loginOk();
-}
-
 void SituareEngine::loginActionPressed()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -595,14 +586,11 @@ void SituareEngine::signalsFromFacebookAuthenticator()
     connect(m_facebookAuthenticator, SIGNAL(error(int, int)),
             this, SLOT(error(int, int)));
 
-    connect(m_facebookAuthenticator, SIGNAL(buildLoginBrowser()),
-            m_ui, SLOT(buildFacebookLoginBrowser()));
-
     connect(m_facebookAuthenticator, SIGNAL(loggedIn(QString)),
             m_situareService, SLOT(updateSession(QString)));
 
     connect(m_facebookAuthenticator, SIGNAL(loggedIn(QString)),
-            this, SLOT(loggedIn()));
+            this, SLOT(loginOk()));
 }
 
 void SituareEngine::signalsFromGeocodingService()
@@ -640,9 +628,6 @@ void SituareEngine::signalsFromMainWindow()
     connect(m_ui, SIGNAL(loginActionPressed()),
             this, SLOT(loginActionPressed()));
 
-    connect(m_ui, SIGNAL(loginBrowserCreated(FacebookLoginBrowser*)),
-            m_facebookAuthenticator, SLOT(setBrowser(FacebookLoginBrowser*)));
-
     // signals from map view
     connect(m_ui, SIGNAL(mapViewScrolled(SceneCoordinate)),
             m_mapEngine, SLOT(setCenterPosition(SceneCoordinate)));