summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-06-30 13:22:04 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-06-30 13:18:01 +0000
commit7505c7ef734245bef4094fe627290a8836a6e3f8 (patch)
treeee9f2e600d034a469c48cad1cc4bdddec1897df0 /src/imports
parent706f97d93b7e0e01bc287d9379e692ffd1bd08a6 (diff)
downloadqtlocation-7505c7ef734245bef4094fe627290a8836a6e3f8.tar.gz
Refactor: rename improperly named methods
After consultation, it seems that Qt favors using "At" rather than "For" in naming a method such as "maximumLatitudeForZoom". Moreover, this methods returns the maximum latitude that map center can have at a specific zoom level, so it is important to make that clear not only in the comments but also in the method's name. Change-Id: I26f0d18f8ca94b1bdd085cd49dd603d51a68689b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index a8d93fab..67cee411 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -280,10 +280,10 @@ void QDeclarativeGeoMap::initialize()
// try to keep center change signal in the end
bool centerHasChanged = false;
- setMinimumZoomLevel(m_map->minimumZoomForMapSize(width(), height()));
+ setMinimumZoomLevel(m_map->minimumZoomAtMapSize(width(), height()));
// set latitude bundary check
- m_maximumViewportLatitude = m_map->maximumLatitudeForZoom(m_cameraData.zoomLevel());
+ m_maximumViewportLatitude = m_map->maximumCenterLatitudeAtZoom(m_cameraData.zoomLevel());
QGeoCoordinate center = m_cameraData.center();
center.setLatitude(qBound(-m_maximumViewportLatitude, center.latitude(), m_maximumViewportLatitude));
@@ -589,7 +589,7 @@ void QDeclarativeGeoMap::setMinimumZoomLevel(qreal minimumZoomLevel)
if (m_map) {
minimumZoomLevel = qBound(qreal(m_map->cameraCapabilities().minimumZoomLevel()), minimumZoomLevel, maximumZoomLevel());
- double minimumViewportZoomLevel = m_map->minimumZoomForMapSize(width(),height());
+ double minimumViewportZoomLevel = m_map->minimumZoomAtMapSize(width(),height());
if (minimumZoomLevel < minimumViewportZoomLevel)
minimumZoomLevel = minimumViewportZoomLevel;
}
@@ -688,7 +688,7 @@ void QDeclarativeGeoMap::setZoomLevel(qreal zoomLevel)
if (m_initialized) {
m_cameraData.setZoomLevel(qBound(minimumZoomLevel(), zoomLevel, maximumZoomLevel()));
- m_maximumViewportLatitude = m_map->maximumLatitudeForZoom(m_cameraData.zoomLevel());
+ m_maximumViewportLatitude = m_map->maximumCenterLatitudeAtZoom(m_cameraData.zoomLevel());
QGeoCoordinate coord = m_cameraData.center();
coord.setLatitude(qBound(-m_maximumViewportLatitude, coord.latitude(), m_maximumViewportLatitude));
if (coord != m_cameraData.center()) {
@@ -1252,7 +1252,7 @@ void QDeclarativeGeoMap::geometryChanged(const QRectF &newGeometry, const QRectF
if (!m_initialized)
initialize();
else
- setMinimumZoomLevel(m_map->minimumZoomForMapSize(newGeometry.width(), newGeometry.height()));
+ setMinimumZoomLevel(m_map->minimumZoomAtMapSize(newGeometry.width(), newGeometry.height()));
/*!
The fitViewportTo*() functions depend on a valid map geometry.