summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Kert├ęsz <[email protected]>2017-05-23 15:34:51 +0300
committerJasem Mutlaq <[email protected]>2017-05-23 15:34:51 +0300
commitd2c6cb3969d207de8d3c565c870b82897ebffc46 (patch)
tree2130a7a1bbe48bf2c9ae3dbf44985248f5db13dc
parentc692f301ec511e519c31f58d28763d4c8932ef75 (diff)
Fix automatic mode in KStars Lite
-rw-r--r--kstars/skymaplite.cpp6
-rw-r--r--kstars/skymaplite.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/kstars/skymaplite.cpp b/kstars/skymaplite.cpp
index 41943c8..6f010f6 100644
--- a/kstars/skymaplite.cpp
+++ b/kstars/skymaplite.cpp
@@ -152,7 +152,7 @@ SkyMapLite::SkyMapLite()
});
#if defined (Q_OS_ANDROID)
//Automatic mode
- automaticModeTimer.setInterval(1);
+ automaticModeTimer.setInterval(5);
connect(&automaticModeTimer, SIGNAL(timeout()), this, SLOT(updateAutomaticMode()));
setAutomaticMode(false);
#endif
@@ -989,14 +989,14 @@ void SkyMapLite::setAutomaticMode(bool automaticMode)
#endif
}
-#if defined(Q_OS_ANDROID)
void SkyMapLite::updateAutomaticMode()
{
+#if defined(Q_OS_ANDROID)
m_deviceOrientation->getOrientation();
setFocusAltAz(dms(m_deviceOrientation->getAltitude()), dms(m_deviceOrientation->getAzimuth()));
setSkyRotation(-1 * m_deviceOrientation->getRoll());
-}
#endif
+}
void SkyMapLite::initStarImages()
{
diff --git a/kstars/skymaplite.h b/kstars/skymaplite.h
index 428781a..832d7d4 100644
--- a/kstars/skymaplite.h
+++ b/kstars/skymaplite.h
@@ -516,11 +516,10 @@ class SkyMapLite : public QQuickItem
*/
void slotSelectObject(SkyObject * skyObj);
-#if defined(Q_OS_ANDROID)
/** @short updates focus of SkyMapLite according to data from DeviceOrientation
(Smartphone's sensors)*/
void updateAutomaticMode();
-#endif
+
void setSkyRotation(double skyRotation);
signals: