2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@ixonos.com
6 Henri Lampela - henri.lampela@ixonos.com
7 Jussi Laitinen - jussi.laitinen@ixonos.com
8 Sami Rämö - sami.ramo@ixonos.com
10 Situare is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 version 2 as published by the Free Software Foundation.
14 Situare is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Situare; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include <QMessageBox>
26 #include <QNetworkReply>
29 #include "application.h"
32 #include "facebookservice/facebookauthentication.h"
33 #include "gps/gpsposition.h"
34 #include "map/mapengine.h"
35 #include "routing/routingservice.h"
36 #include "situareservice/situareservice.h"
37 #include "ui/mainwindow.h"
38 #include "network/networkaccessmanager.h"
44 const QString SETTINGS_GPS_ENABLED = "GPS_ENABLED"; ///< GPS setting
45 const QString SETTINGS_AUTO_CENTERING_ENABLED = "AUTO_CENTERING_ENABLED";///< Auto centering setting
46 const int DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE = 12; ///< Default zoom level when GPS available
47 const qreal USER_MOVEMENT_MINIMUM_LONGITUDE_DIFFERENCE = 0.003;///< Min value for user move latitude
48 const qreal USER_MOVEMENT_MINIMUM_LATITUDE_DIFFERENCE = 0.001;///< Min value for user move longitude
49 const int MIN_UPDATE_INTERVAL_MSECS = 5*60*1000;
51 SituareEngine::SituareEngine()
52 : m_autoCenteringEnabled(false),
53 m_automaticUpdateFirstStart(true),
54 m_automaticUpdateRequest(false),
56 m_automaticUpdateIntervalTimer(0),
57 m_lastUpdatedGPSPosition(QPointF())
59 qDebug() << __PRETTY_FUNCTION__;
61 m_ui = new MainWindow;
62 m_ui->updateItemVisibility();
65 m_app = static_cast<Application *>(qApp);
66 m_app->registerWindow(m_ui->winId());
68 connect(m_app, SIGNAL(topmostChanged(bool)),
69 this, SLOT(enablePowerSave(bool)));
72 m_networkAccessManager = NetworkAccessManager::instance();
75 m_mapEngine = new MapEngine(this);
76 m_ui->setMapViewScene(m_mapEngine->scene());
79 m_gps = new GPSPosition(this);
81 // build SituareService
82 m_situareService = new SituareService(this);
84 // build FacebookAuthenticator
85 m_facebookAuthenticator = new FacebookAuthentication(this);
87 // build routing service
88 m_routingService = new RoutingService(this); // create this when needed, not in constructor!
89 connect(m_routingService, SIGNAL(routeParsed(Route&)),
90 m_mapEngine, SLOT(setRoute(Route&)));
93 signalsFromMapEngine();
95 signalsFromSituareService();
96 signalsFromMainWindow();
97 signalsFromFacebookAuthenticator();
99 connect(this, SIGNAL(userLocationReady(User*)),
100 m_ui, SIGNAL(userLocationReady(User*)));
102 connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
103 m_ui, SIGNAL(friendsLocationsReady(QList<User*>&)));
105 connect(this, SIGNAL(userLocationReady(User*)),
106 m_mapEngine, SLOT(receiveOwnLocation(User*)));
108 connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
109 m_mapEngine, SIGNAL(friendsLocationsReady(QList<User*>&)));
111 connect(this, SIGNAL(friendImageReady(User*)),
112 m_ui, SIGNAL(friendImageReady(User*)));
114 connect(this, SIGNAL(friendImageReady(User*)),
115 m_mapEngine, SIGNAL(friendImageReady(User*)));
117 m_automaticUpdateIntervalTimer = new QTimer(this);
118 connect(m_automaticUpdateIntervalTimer, SIGNAL(timeout()),
119 this, SLOT(startAutomaticUpdate()));
121 // signals connected, now it's time to show the main window
122 // but init the MapEngine before so starting location is set
126 m_facebookAuthenticator->start();
128 m_gps->setMode(GPSPosition::Default);
129 initializeGpsAndAutocentering();
131 m_mce = new MCE(this);
132 connect(m_mce, SIGNAL(displayOff(bool)), this, SLOT(enablePowerSave(bool)));
134 /// @todo for testing, remove after real route start and end points are available
135 //m_routingService->requestRoute(QPointF(65.010193,25.509859), QPointF(65.015152, 25.46645));
138 SituareEngine::~SituareEngine()
140 qDebug() << __PRETTY_FUNCTION__;
144 QSettings settings(DIRECTORY_NAME, FILE_NAME);
145 settings.setValue(SETTINGS_GPS_ENABLED, m_gps->isRunning());
146 settings.setValue(SETTINGS_AUTO_CENTERING_ENABLED, m_autoCenteringEnabled);
149 void SituareEngine::changeAutoCenteringSetting(bool enabled)
151 qDebug() << __PRETTY_FUNCTION__;
153 m_autoCenteringEnabled = enabled;
154 enableAutoCentering(enabled);
157 void SituareEngine::disableAutoCentering()
159 qDebug() << __PRETTY_FUNCTION__;
161 changeAutoCenteringSetting(false);
162 m_ui->buildInformationBox(tr("Auto centering disabled"));
165 void SituareEngine::enableAutoCentering(bool enabled)
167 qDebug() << __PRETTY_FUNCTION__;
169 m_ui->setAutoCenteringButtonEnabled(enabled);
170 m_mapEngine->setAutoCentering(enabled);
173 m_gps->requestLastPosition();
176 void SituareEngine::enableGPS(bool enabled)
178 qDebug() << __PRETTY_FUNCTION__;
180 m_ui->setOwnLocationCrosshairVisibility(!enabled);
182 if (m_gps->isInitialized()) {
183 m_ui->setGPSButtonEnabled(enabled);
184 m_mapEngine->setGPSEnabled(enabled);
186 if (enabled && !m_gps->isRunning()) {
188 enableAutoCentering(m_autoCenteringEnabled);
189 m_gps->requestLastPosition();
191 if(m_ui->loginState())
192 m_ui->readAutomaticLocationUpdateSettings();
194 else if (!enabled && m_gps->isRunning()) {
196 enableAutoCentering(false);
197 enableAutomaticLocationUpdate(false);
202 m_ui->buildInformationBox(tr("Unable to start GPS"));
203 m_ui->setGPSButtonEnabled(false);
204 m_mapEngine->setGPSEnabled(false);
208 void SituareEngine::enableAutomaticLocationUpdate(bool enabled, int updateIntervalMsecs)
210 qDebug() << __PRETTY_FUNCTION__;
212 //Show automatic update confirmation dialog
213 if (m_automaticUpdateFirstStart && m_gps->isRunning() && enabled) {
214 m_ui->showEnableAutomaticUpdateLocationDialog(
215 tr("Do you want to enable automatic location update with %1 min update interval?")
216 .arg(updateIntervalMsecs/1000/60));
217 m_automaticUpdateFirstStart = false;
219 if (enabled && m_gps->isRunning()) {
220 m_ui->buildInformationBox(tr("Automatic location update enabled"));
221 if (updateIntervalMsecs < MIN_UPDATE_INTERVAL_MSECS)
222 m_automaticUpdateIntervalTimer->setInterval(MIN_UPDATE_INTERVAL_MSECS);
224 m_automaticUpdateIntervalTimer->setInterval(updateIntervalMsecs);
226 connect(m_gps, SIGNAL(position(QPointF,qreal)),
227 this, SLOT(requestAutomaticUpdateIfMoved(QPointF)));
229 m_automaticUpdateIntervalTimer->start();
232 disconnect(m_gps, SIGNAL(position(QPointF,qreal)),
233 this, SLOT(requestAutomaticUpdateIfMoved(QPointF)));
235 m_automaticUpdateIntervalTimer->stop();
240 void SituareEngine::enablePowerSave(bool enabled)
242 qDebug() << __PRETTY_FUNCTION__;
244 m_gps->enablePowerSave(enabled);
246 if(m_autoCenteringEnabled)
247 m_mapEngine->setAutoCentering(!enabled);
250 void SituareEngine::error(const int context, const int error)
252 qDebug() << __PRETTY_FUNCTION__;
256 case SituareError::ERROR_GENERAL:
257 if(context == ErrorContext::SITUARE) {
258 m_ui->toggleProgressIndicator(false);
259 m_ui->buildInformationBox(tr("Unknown server error"), true);
262 case 1: //errors: SituareError::ERROR_MISSING_ARGUMENT and QNetworkReply::ConnectionRefusedError
263 m_ui->toggleProgressIndicator(false);
264 if(context == ErrorContext::SITUARE) {
265 m_ui->buildInformationBox(tr("Missing parameter from request"), true);
266 } else if(context == ErrorContext::NETWORK) {
267 m_ui->buildInformationBox(tr("Connection refused by the server"), true);
270 case QNetworkReply::RemoteHostClosedError:
271 if(context == ErrorContext::NETWORK) {
272 m_ui->toggleProgressIndicator(false);
273 m_ui->buildInformationBox(tr("Connection closed by the server"), true);
276 case QNetworkReply::HostNotFoundError:
277 if(context == ErrorContext::NETWORK) {
278 m_ui->toggleProgressIndicator(false);
279 m_ui->buildInformationBox(tr("Remote server not found"), true);
282 case QNetworkReply::TimeoutError:
283 if(context == ErrorContext::NETWORK) {
284 m_ui->toggleProgressIndicator(false);
285 m_ui->buildInformationBox(tr("Connection timed out"), true);
288 case QNetworkReply::UnknownNetworkError:
289 if(context == ErrorContext::NETWORK) {
290 m_ui->toggleProgressIndicator(false);
291 m_ui->buildInformationBox(tr("No network connection"), true);
294 case SituareError::SESSION_EXPIRED:
295 m_ui->buildInformationBox(tr("Session expired. Please login again"), true);
296 m_facebookAuthenticator->clearAccountInformation(true); // keep username = true
297 m_situareService->clearUserData();
298 m_ui->loggedIn(false);
301 case SituareError::LOGIN_FAILED:
302 m_ui->toggleProgressIndicator(false);
303 m_ui->buildInformationBox(tr("Invalid E-mail address or password"), true);
306 case SituareError::UPDATE_FAILED:
307 m_ui->toggleProgressIndicator(false);
308 m_ui->buildInformationBox(tr("Update failed, please try again"), true);
310 case SituareError::DATA_RETRIEVAL_FAILED:
311 m_ui->toggleProgressIndicator(false);
312 m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
314 case SituareError::ADDRESS_RETRIEVAL_FAILED:
315 case SituareError::ERROR_GEOLOCATION_REQUEST_FAIL:
316 case SituareError::ERROR_GEOLOCATION_LONLAT_INVALID:
317 m_ui->toggleProgressIndicator(false);
318 m_ui->buildInformationBox(tr("Address retrieval failed"), true);
320 case SituareError::IMAGE_DOWNLOAD_FAILED:
321 m_ui->buildInformationBox(tr("Image download failed"), true);
323 case SituareError::MAP_IMAGE_DOWNLOAD_FAILED:
324 m_ui->buildInformationBox(tr("Map image download failed"), true);
326 case SituareError::GPS_INITIALIZATION_FAILED:
328 m_ui->buildInformationBox(tr("GPS initialization failed"), true);
330 case SituareError::INVALID_JSON:
331 m_ui->buildInformationBox(tr("Malformatted reply from server"), true);
332 m_ui->loggedIn(false);
333 m_facebookAuthenticator->clearAccountInformation(false); // clean all
335 case SituareError::ERROR_GEOLOCATION_SERVER_UNAVAILABLE:
336 m_ui->toggleProgressIndicator(false);
337 m_ui->buildInformationBox(tr("Address server not responding"), true);
340 m_ui->toggleProgressIndicator(false);
341 if(context == ErrorContext::NETWORK)
342 qCritical() << "QNetworkReply::NetworkError: " << error;
344 qCritical() << "Unknown error: " << error;
350 void SituareEngine::fetchUsernameFromSettings()
352 qDebug() << __PRETTY_FUNCTION__;
354 m_ui->setUsername(m_facebookAuthenticator->loadUsername());
357 void SituareEngine::imageReady(User *user)
359 qDebug() << __PRETTY_FUNCTION__;
362 emit userLocationReady(user);
364 emit friendImageReady(user);
367 void SituareEngine::initializeGpsAndAutocentering()
369 qDebug() << __PRETTY_FUNCTION__;
371 QSettings settings(DIRECTORY_NAME, FILE_NAME);
372 QVariant gpsEnabled = settings.value(SETTINGS_GPS_ENABLED);
373 QVariant autoCenteringEnabled = settings.value(SETTINGS_AUTO_CENTERING_ENABLED);
375 if (m_gps->isInitialized()) {
377 if (gpsEnabled.toString().isEmpty()) { // First start. Situare.conf file does not exists
379 connect(m_gps, SIGNAL(position(QPointF,qreal)),
380 this, SLOT(setFirstStartZoomLevel(QPointF,qreal)));
382 changeAutoCenteringSetting(true);
385 m_ui->buildInformationBox(tr("GPS enabled"));
386 m_ui->buildInformationBox(tr("Auto centering enabled"));
388 } else { // Normal start
389 changeAutoCenteringSetting(autoCenteringEnabled.toBool());
390 enableGPS(gpsEnabled.toBool());
392 if (gpsEnabled.toBool())
393 m_ui->buildInformationBox(tr("GPS enabled"));
395 if (gpsEnabled.toBool() && autoCenteringEnabled.toBool())
396 m_ui->buildInformationBox(tr("Auto centering enabled"));
403 void SituareEngine::loginActionPressed()
405 qDebug() << __PRETTY_FUNCTION__;
407 if (m_networkAccessManager->isConnected()) {
408 if(m_ui->loginState()) {
410 m_situareService->clearUserData();
412 m_facebookAuthenticator->start();
416 error(ErrorContext::NETWORK, QNetworkReply::UnknownNetworkError);
420 void SituareEngine::loginOk()
422 qDebug() << __PRETTY_FUNCTION__;
424 m_ui->loggedIn(true);
427 m_situareService->fetchLocations(); // request user locations
429 if (m_gps->isRunning())
430 m_ui->readAutomaticLocationUpdateSettings();
433 void SituareEngine::loginProcessCancelled()
435 qDebug() << __PRETTY_FUNCTION__;
437 m_ui->toggleProgressIndicator(false);
438 m_ui->updateItemVisibility();
441 void SituareEngine::logout()
443 qDebug() << __PRETTY_FUNCTION__;
445 m_ui->loggedIn(false);
447 // signal to clear locationUpdateDialog's data
448 connect(this, SIGNAL(clearUpdateLocationDialogData()),
449 m_ui, SIGNAL(clearUpdateLocationDialogData()));
450 emit clearUpdateLocationDialogData();
452 m_facebookAuthenticator->clearAccountInformation(); // clear all
453 m_automaticUpdateFirstStart = true;
456 void SituareEngine::refreshUserData()
458 qDebug() << __PRETTY_FUNCTION__;
460 if (m_networkAccessManager->isConnected()) {
461 m_ui->toggleProgressIndicator(true);
462 m_situareService->fetchLocations();
465 error(ErrorContext::NETWORK, QNetworkReply::UnknownNetworkError);
469 void SituareEngine::requestAddress()
471 qDebug() << __PRETTY_FUNCTION__;
473 if (m_networkAccessManager->isConnected()) {
474 if (m_gps->isRunning())
475 m_situareService->reverseGeo(m_gps->lastPosition());
477 m_situareService->reverseGeo(m_mapEngine->centerGeoCoordinate());
480 error(ErrorContext::NETWORK, QNetworkReply::UnknownNetworkError);
484 void SituareEngine::requestUpdateLocation(const QString &status, bool publish)
486 qDebug() << __PRETTY_FUNCTION__;
488 if (m_networkAccessManager->isConnected()) {
489 m_ui->toggleProgressIndicator(true);
491 if (m_gps->isRunning())
492 m_situareService->updateLocation(m_gps->lastPosition(), status, publish);
494 m_situareService->updateLocation(m_mapEngine->centerGeoCoordinate(), status, publish);
497 error(ErrorContext::NETWORK, QNetworkReply::UnknownNetworkError);
501 void SituareEngine::requestAutomaticUpdateIfMoved(QPointF position)
503 qDebug() << __PRETTY_FUNCTION__;
505 if ((fabs(m_lastUpdatedGPSPosition.x() - position.x()) >
506 USER_MOVEMENT_MINIMUM_LONGITUDE_DIFFERENCE) ||
507 (fabs(m_lastUpdatedGPSPosition.y() - position.y()) >
508 USER_MOVEMENT_MINIMUM_LATITUDE_DIFFERENCE)) {
510 m_lastUpdatedGPSPosition = position;
514 if (m_automaticUpdateRequest && m_userMoved) {
515 requestUpdateLocation(tr("Automatic location update"));
516 m_automaticUpdateRequest = false;
521 void SituareEngine::setFirstStartZoomLevel(QPointF latLonCoordinate, qreal accuracy)
523 qDebug() << __PRETTY_FUNCTION__;
525 Q_UNUSED(latLonCoordinate);
528 if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
529 m_mapEngine->setZoomLevel(DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE);
531 disconnect(m_gps, SIGNAL(position(QPointF,qreal)),
532 this, SLOT(setFirstStartZoomLevel(QPointF,qreal)));
535 void SituareEngine::signalsFromFacebookAuthenticator()
537 qDebug() << __PRETTY_FUNCTION__;
539 connect(m_facebookAuthenticator, SIGNAL(error(int, int)),
540 this, SLOT(error(int, int)));
542 connect(m_facebookAuthenticator, SIGNAL(credentialsReady(FacebookCredentials)),
543 m_situareService, SLOT(credentialsReady(FacebookCredentials)));
545 connect(m_facebookAuthenticator, SIGNAL(credentialsReady(FacebookCredentials)),
546 this, SLOT(loginOk()));
548 connect(m_facebookAuthenticator, SIGNAL(newLoginRequest()),
549 m_ui, SLOT(startLoginProcess()));
551 connect(m_facebookAuthenticator, SIGNAL(saveCookiesRequest()),
552 m_ui, SLOT(saveCookies()));
554 connect(m_facebookAuthenticator, SIGNAL(loginUsingCookies()),
555 m_ui, SLOT(loginUsingCookies()));
558 void SituareEngine::signalsFromGPS()
560 qDebug() << __PRETTY_FUNCTION__;
562 connect(m_gps, SIGNAL(position(QPointF,qreal)),
563 m_mapEngine, SLOT(gpsPositionUpdate(QPointF,qreal)));
565 connect(m_gps, SIGNAL(timeout()),
566 m_ui, SLOT(gpsTimeout()));
568 connect(m_gps, SIGNAL(error(int, int)),
569 this, SLOT(error(int, int)));
572 void SituareEngine::signalsFromMainWindow()
574 qDebug() << __PRETTY_FUNCTION__;
576 connect(m_ui, SIGNAL(error(int, int)),
577 this, SLOT(error(int, int)));
579 connect(m_ui, SIGNAL(fetchUsernameFromSettings()),
580 this, SLOT(fetchUsernameFromSettings()));
582 connect(m_ui, SIGNAL(loginActionPressed()),
583 this, SLOT(loginActionPressed()));
585 connect(m_ui, SIGNAL(saveUsername(QString)),
586 m_facebookAuthenticator, SLOT(saveUsername(QString)));
588 connect(m_ui, SIGNAL(updateCredentials(QUrl)),
589 m_facebookAuthenticator, SLOT(updateCredentials(QUrl)));
591 // signals from map view
592 connect(m_ui, SIGNAL(mapViewScrolled(QPoint)),
593 m_mapEngine, SLOT(setCenterPosition(QPoint)));
595 connect(m_ui, SIGNAL(mapViewResized(QSize)),
596 m_mapEngine, SLOT(viewResized(QSize)));
598 connect(m_ui, SIGNAL(viewZoomFinished()),
599 m_mapEngine, SLOT(viewZoomFinished()));
601 // signals from zoom buttons (zoom panel and volume buttons)
602 connect(m_ui, SIGNAL(zoomIn()),
603 m_mapEngine, SLOT(zoomIn()));
605 connect(m_ui, SIGNAL(zoomOut()),
606 m_mapEngine, SLOT(zoomOut()));
608 // signals from menu buttons
609 connect(m_ui, SIGNAL(autoCenteringTriggered(bool)),
610 this, SLOT(changeAutoCenteringSetting(bool)));
612 connect(m_ui, SIGNAL(gpsTriggered(bool)),
613 this, SLOT(enableGPS(bool)));
615 //signals from dialogs
616 connect(m_ui, SIGNAL(cancelLoginProcess()),
617 this, SLOT(loginProcessCancelled()));
619 connect(m_ui, SIGNAL(requestReverseGeo()),
620 this, SLOT(requestAddress()));
622 connect(m_ui, SIGNAL(statusUpdate(QString,bool)),
623 this, SLOT(requestUpdateLocation(QString,bool)));
625 connect(m_ui, SIGNAL(enableAutomaticLocationUpdate(bool, int)),
626 this, SLOT(enableAutomaticLocationUpdate(bool, int)));
628 // signals from user info tab
629 connect(m_ui, SIGNAL(refreshUserData()),
630 this, SLOT(refreshUserData()));
632 connect(m_ui, SIGNAL(findUser(QPointF)),
633 m_mapEngine, SLOT(centerToCoordinates(QPointF)));
635 // signals from friend list tab
636 connect(m_ui, SIGNAL(findFriend(QPointF)),
637 m_mapEngine, SLOT(centerToCoordinates(QPointF)));
640 void SituareEngine::signalsFromMapEngine()
642 qDebug() << __PRETTY_FUNCTION__;
644 connect(m_mapEngine, SIGNAL(error(int, int)),
645 this, SLOT(error(int, int)));
647 connect(m_mapEngine, SIGNAL(locationChanged(QPoint)),
648 m_ui, SIGNAL(centerToSceneCoordinates(QPoint)));
650 connect(m_mapEngine, SIGNAL(zoomLevelChanged(int)),
651 m_ui, SIGNAL(zoomLevelChanged(int)));
653 connect(m_mapEngine, SIGNAL(mapScrolledManually()),
654 this, SLOT(disableAutoCentering()));
656 connect(m_mapEngine, SIGNAL(maxZoomLevelReached()),
657 m_ui, SIGNAL(maxZoomLevelReached()));
659 connect(m_mapEngine, SIGNAL(minZoomLevelReached()),
660 m_ui, SIGNAL(minZoomLevelReached()));
662 connect(m_mapEngine, SIGNAL(locationItemClicked(QList<QString>)),
663 m_ui, SIGNAL(locationItemClicked(QList<QString>)));
665 connect(m_mapEngine, SIGNAL(newMapResolution(qreal)),
666 m_ui, SIGNAL(newMapResolution(qreal)));
669 void SituareEngine::signalsFromSituareService()
671 qDebug() << __PRETTY_FUNCTION__;
673 connect(m_situareService, SIGNAL(error(int, int)),
674 this, SLOT(error(int, int)));
676 connect(m_situareService, SIGNAL(imageReady(User*)),
677 this, SLOT(imageReady(User*)));
679 connect(m_situareService, SIGNAL(reverseGeoReady(QString)),
680 m_ui, SIGNAL(reverseGeoReady(QString)));
682 connect(m_situareService, SIGNAL(userDataChanged(User*, QList<User*>&)),
683 this, SLOT(userDataChanged(User*, QList<User*>&)));
685 connect(m_situareService, SIGNAL(updateWasSuccessful()),
686 this, SLOT(updateWasSuccessful()));
688 connect(m_situareService, SIGNAL(updateWasSuccessful()),
689 m_ui, SIGNAL(clearUpdateLocationDialogData()));
692 void SituareEngine::startAutomaticUpdate()
694 qDebug() << __PRETTY_FUNCTION__;
696 m_gps->requestUpdate();
697 m_automaticUpdateRequest = true;
700 void SituareEngine::updateWasSuccessful()
702 qDebug() << __PRETTY_FUNCTION__;
704 if (m_networkAccessManager->isConnected())
705 m_situareService->fetchLocations();
707 error(ErrorContext::NETWORK, QNetworkReply::UnknownNetworkError);
710 void SituareEngine::userDataChanged(User *user, QList<User *> &friendsList)
712 qDebug() << __PRETTY_FUNCTION__;
714 m_ui->toggleProgressIndicator(false);
717 emit userLocationReady(user);
718 emit friendsLocationsReady(friendsList);