m_mapEngine->init();
m_ui->show();
- QSettings settings(DIRECTORY_NAME, FILE_NAME);
- QVariant gpsEnabled = settings.value(SETTINGS_GPS_ENABLED);
- QVariant autoCenteringEnabled = settings.value(SETTINGS_AUTO_CENTERING_ENABLED);
-
- // set features on / off based on settings
- changeAutoCenteringSetting(autoCenteringEnabled.toBool());
- enableGPS(gpsEnabled.toBool());
-
- // show messages at startup if features are enabled automatically
- if (gpsEnabled.toBool())
- m_ui->showMaemoInformationBox(tr("GPS enabled"));
- if (gpsEnabled.toBool() && autoCenteringEnabled.toBool())
- m_ui->showMaemoInformationBox(tr("Auto centering enabled"));
-
m_facebookAuthenticator->start();
+
+ m_automaticUpdateIntervalTimer = new QTimer(this);
+ connect(m_automaticUpdateIntervalTimer, SIGNAL(timeout()),
+ this, SLOT(automaticUpdateIntervalTimerTimeout()));
}
SituareEngine::~SituareEngine()
m_situareService->updateLocation(m_mapEngine->centerGeoCoordinate(), status, publish);
}
+void SituareEngine::saveGPSPosition(QPointF position)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ qDebug() << __PRETTY_FUNCTION__ << m_lastUpdatedGPSPosition.x() << m_lastUpdatedGPSPosition.y();
+ qDebug() << __PRETTY_FUNCTION__ << position.x() << position.y();
+ qDebug() << __PRETTY_FUNCTION__ << "=" << fabs(m_lastUpdatedGPSPosition.x() - position.x()) <<
+ fabs(m_lastUpdatedGPSPosition.y() - position.y());
+
+ if ((fabs(m_lastUpdatedGPSPosition.x() - position.x()) > 0.003) ||
+ (fabs(m_lastUpdatedGPSPosition.y() - position.y()) > 0.001)) {
+ qDebug() << __PRETTY_FUNCTION__ << "m_userMoved = true";
+ m_lastUpdatedGPSPosition = position;
+ m_userMoved = true;
+ }
++
+ void SituareEngine::setFirstStartZoomLevel(QPointF latLonCoordinate, qreal accuracy)
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ Q_UNUSED(latLonCoordinate);
+ Q_UNUSED(accuracy);
+
+ if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
+ m_mapEngine->setZoomLevel(DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE);
+
+ disconnect(m_gps, SIGNAL(position(QPointF,qreal)),
+ this, SLOT(setFirstStartZoomLevel(QPointF,qreal)));
}
void SituareEngine::signalsFromFacebookAuthenticator()