From 7505c7ef734245bef4094fe627290a8836a6e3f8 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Thu, 30 Jun 2016 13:22:04 +0200 Subject: 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 --- src/imports/location/qdeclarativegeomap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/imports') 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. -- cgit v1.2.1