Preliminary merge. Integration is brancehd from fresh master.
[situare] / src / engine / engine.cpp
index 44ee596..716f63a 100644 (file)
 SituareEngine::SituareEngine(QMainWindow *parent)
     : QObject(parent)
 {
+    qDebug() << __PRETTY_FUNCTION__;
     m_ui = new MainWindow;
 
-    m_networkManager = new QNetworkAccessManager;
-    m_situareService = new SituareService(this,m_networkManager);
+    m_situareService = new SituareService(this);
 
-    m_loggedIn = false;
     m_facebookAuthenticator = new FacebookAuthentication();
 
     connect(m_facebookAuthenticator, SIGNAL(credentialsReady(FacebookCredentials)),
@@ -47,25 +46,19 @@ SituareEngine::SituareEngine(QMainWindow *parent)
     connect(this, SIGNAL(userLocationReady(User*)), m_ui, SIGNAL(userLocationReady(User*)));
     connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)), m_ui, SIGNAL(friendsLocationsReady(QList<User*>&)));
 
-    start();
+    m_facebookAuthenticator->start();
 }
 
 SituareEngine::~SituareEngine()
 {
     qDebug() << __PRETTY_FUNCTION__;
     delete m_ui;
-}
-
-void SituareEngine::start()
-{
-    m_facebookAuthenticator->start();
+    delete m_facebookAuthenticator;
 }
 
 void SituareEngine::loginOk()
-
 {
     qDebug() << __PRETTY_FUNCTION__;
-    m_loggedIn = true;
     m_facebookAuthenticator->hide();
     m_ui->show();
     m_situareService->fetchLocations(); // request user locations
@@ -78,7 +71,7 @@ void SituareEngine::requestAddress()
     m_situareService->reverseGeo(coordinates);
 }
 
-void SituareEngine::requestUpdateLocation(const QString &status, const bool &publish)
+void SituareEngine::requestUpdateLocation(const QString &status, bool publish)
 {
     qDebug() << __PRETTY_FUNCTION__;
     QPointF coordinates(65, 25.5); // this will be get from somewhere, map etc...