m_networkManager = new QNetworkAccessManager;
m_situareService = new SituareService(this,m_networkManager);
- m_loggedIn = false;
m_facebookAuthenticator = new FacebookAuthentication();
connect(m_facebookAuthenticator, SIGNAL(credentialsReady(FacebookCredentials)),
connect(m_situareService, SIGNAL(reverseGeoReady(QString)), m_ui, SIGNAL(reverseGeoReady(QString)));
connect(m_ui, SIGNAL(statusUpdate(QString,bool)), this, SLOT(requestUpdateLocation(QString,bool)));
- start();
+ m_facebookAuthenticator->start();
}
SituareEngine::~SituareEngine()
delete m_ui;
}
-void SituareEngine::start()
-{
- m_facebookAuthenticator->start();
-}
-
void SituareEngine::loginOk()
{
qDebug() << __PRETTY_FUNCTION__;
- m_loggedIn = true;
m_facebookAuthenticator->hide();
m_ui->show();
m_situareService->fetchLocations(); // request user locations
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public:
- /**
- * @brief Function to start engine component
- */
- void start();
public slots:
* SIGNALS
******************************************************************************/
signals:
- /**
- * @brief Signal that is emitted when UI must be showed
- */
- void engine_showMainWindow();
-
- /**
- * @brief Signal that is emitted when UI must be closed
- */
- void engine_closeMainWindow();
/*******************************************************************************
* DATA MEMBERS
FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
SituareService *m_situareService; ///< Instance of the situare server communication service
- bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
};
#endif // ENGINE_H