this, SLOT(loginOk()));
connect(m_ui, SIGNAL(requestReverseGeo()), this, SLOT(requestAddress()));
- connect(m_situareService, SIGNAL(reverseGeoReady(QString)),
- m_ui, SIGNAL(reverseGeoReady(QString)));
- connect(m_ui, SIGNAL(statusUpdate(QString,bool)),
- this, SLOT(requestUpdateLocation(QString,bool)));
+ connect(m_situareService, SIGNAL(reverseGeoReady(QString)), m_ui, SIGNAL(reverseGeoReady(QString)));
+ connect(m_ui, SIGNAL(statusUpdate(QString,bool)), this, SLOT(requestUpdateLocation(QString,bool)));
+ connect(m_situareService, SIGNAL(userDataChanged(User*,QList<User*>&)),
+ this, SLOT(userDataChanged(User*,QList<User*>&)));
+ 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()
* @param status Status message
* @param publish Publish on Facebook
*/
- void requestUpdateLocation(const QString &status, const bool &publish);
+ void requestUpdateLocation(const QString &status, bool publish);
+ /**
+ * @brief Slot to initiate update friends list function
+ */
void updateFriendsList();
+ void userDataChanged(User *user, QList<User *> &friendList);
+
+ /*******************************************************************************
+ * 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();
-
+ void userLocationReady(User *user);
+ void friendsLocationsReady(QList<User *> &friendList);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
{
qDebug() << __PRETTY_FUNCTION__;
- if(!m_user->profileImageUrl().isEmpty() && m_user->profileImageUrl().isValid()) {
- if(m_user->profileImageUrl() != QUrl("")) {
++ if(!m_user->profileImageUrl().isEmpty()) {
emit fetchImage(m_user->profileImageUrl());
}
for(int i=0;i<m_friendsList.count();i++) {
- if(!m_friendsList.at(i)->profileImageUrl().isEmpty() && m_user->profileImageUrl().isValid()) {
- if(m_friendsList.at(i)->profileImageUrl() != QUrl("")) {
++ if(!m_friendsList.at(i)->profileImageUrl().isEmpty()) {
m_visited++; // indicates how many friends that have profile image
emit fetchImage(m_friendsList.at(i)->profileImageUrl());
}
connect(this, SIGNAL(reverseGeoReady(QString)), m_locationDialog, SLOT(setAddress(QString)));
connect(m_locationDialog, SIGNAL(statusUpdate(QString,bool)), this,
SIGNAL(statusUpdate(QString,bool)));
-
- m_networkManager = new QNetworkAccessManager;
- m_situareService = new SituareService(this,m_networkManager);
-
+ connect(this, SIGNAL(userLocationReady(User*)),
+ m_mapViewScreen, SLOT(userLocationReady(User*)));
+ connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
+ m_mapViewScreen, SLOT(friendsLocationsReady(QList<User*>&)));
}
MainWindow::~MainWindow()
dialog->show();
}
-
-void MainWindow::loginScreenClosed()
-{
- qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
- if (m_loggedIn) {
- this->show();
- return;
- }
- else {
- this->close();
- }
-}
-
-void MainWindow::loginOK()
-{
- qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
- m_loggedIn = true;
- //m_facebookAuthenticator->close();
-}
-
-//void MainWindow::userLocationReady(User &user)
-//{
-// emit userLocationReady(user);
-//}
-//
-//void MainWindow::friendsLocationsReady(QList<User *>friendsList)
-//{
-// emit friendsLocationsReady(friendsList);
-//}
-