summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiban Bairagya <sanjiban22393@gmail.com>2016-09-26 17:04:05 (GMT)
committerSanjiban Bairagya <sanjiban22393@gmail.com>2016-09-26 17:04:05 (GMT)
commitb9e355c87a995ee751d75f5c941479a2b51e9fa5 (patch)
tree34ab73a0452e0029cd56f90c4aa2f6f75d59c096
parent830aee230b404f5e418f715f16d9dc6e99dd1558 (diff)
Center on current position when application starts,
if no coordinates were saved from before
-rw-r--r--src/lib/marble/declarative/MarbleQuickItem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/marble/declarative/MarbleQuickItem.cpp b/src/lib/marble/declarative/MarbleQuickItem.cpp
index 997303d..c483eed 100644
--- a/src/lib/marble/declarative/MarbleQuickItem.cpp
+++ b/src/lib/marble/declarative/MarbleQuickItem.cpp
@@ -909,7 +909,11 @@ namespace Marble
settings.beginGroup(QStringLiteral("MarbleQuickItem"));
double lon = settings.value(QStringLiteral("centerLon"), QVariant(0.0)).toDouble();
double lat = settings.value(QStringLiteral("centerLat"), QVariant(0.0)).toDouble();
- centerOn(lon, lat);
+ if (lat == 0.0 && lon == 0.0) {
+ centerOnCurrentPosition();
+ } else {
+ centerOn(lon, lat);
+ }
int const zoom = settings.value(QStringLiteral("zoom"), QVariant(0)).toInt();
if (zoom > 0) {
setZoom(zoom);