Merge branch 'master' into settings_auto_update
[situare] / src / map / gpslocationitem.cpp
index 9e6cc98..2585513 100644 (file)
@@ -19,8 +19,6 @@
     USA.
 */
 
-const int ACCURATE_LIMIT = 250; // this and lower values (in meters) are considered as accurate
-
 #include <QDebug>
 #include <QGraphicsPixmapItem>
 
@@ -63,14 +61,16 @@ void GPSLocationItem::updatePosition(QPoint scenePosition, qreal accuracy)
 
     setPos(scenePosition);
 
-    if (accuracy != GPS_ACCURACY_UNDEFINED  // accuracy must be defined
-        && accuracy <= ACCURATE_LIMIT       // and smaller than limit
-        && m_currentAccuracy != ACCURATE) { // and accurate pixmap not yet set
+    if (accuracy == GPS_ACCURACY_UNDEFINED) { // fix is NOT accurate
+        if (m_currentAccuracy != COARSE) { // coarse pixmap not yet set
+            setPixmap(m_coarsePixmap);
+            m_currentAccuracy = COARSE;
+        }
+    }
+    else { // fix is accurate
+        if (m_currentAccuracy != ACCURATE) { // accurate pixmap not yet set
             setPixmap(m_accuratePixmap);
             m_currentAccuracy = ACCURATE;
-    }
-    else if (m_currentAccuracy != COARSE) { // coarse pixmap not yet set
-        setPixmap(m_coarsePixmap);
-        m_currentAccuracy = COARSE;
+        }
     }
 }