diff options
Diffstat (limited to 'src')
52 files changed, 113 insertions, 114 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 9fe40bc3..d3548d49 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -311,7 +311,7 @@ void QDeclarativeGeoMap::onSupportedMapTypesChanged() m_map->setActiveMapType(QGeoMapType()); // no supported map types: setting an invalid one } else { bool hasMapType = false; - for (auto *declarativeType : m_supportedMapTypes) { + for (const auto *declarativeType : qAsConst(m_supportedMapTypes)) { if (declarativeType->mapType() == m_map->activeMapType()) hasMapType = true; } @@ -383,7 +383,7 @@ void QDeclarativeGeoMap::initialize() // So, emit visibleRegionChanged() separately, as // the effective visible region becomes available only now. - for (auto obj : qAsConst(m_pendingMapObjects)) + for (const auto &obj : qAsConst(m_pendingMapObjects)) obj->setMap(m_map); m_initialized = true; @@ -951,7 +951,7 @@ bool QDeclarativeGeoMap::removeMapChild(QObject *child) return false; } -bool QDeclarativeGeoMap::isGroupNested(QDeclarativeGeoMapItemGroup *group) +bool QDeclarativeGeoMap::isGroupNested(QDeclarativeGeoMapItemGroup *group) const { QObject *parent = group->parent(); // Nested groups have parent set in parent's componentComplete() @@ -1739,7 +1739,7 @@ void QDeclarativeGeoMap::itemChange(ItemChange change, const ItemChangeData &val QQuickItem::itemChange(change, value); } -bool QDeclarativeGeoMap::isInteractive() +bool QDeclarativeGeoMap::isInteractive() const { return (m_gestureArea->enabled() && m_gestureArea->acceptedGestures()) || m_gestureArea->isActive(); } diff --git a/src/location/declarativemaps/qdeclarativegeomap_p.h b/src/location/declarativemaps/qdeclarativegeomap_p.h index ea1f64b8..74618c7f 100644 --- a/src/location/declarativemaps/qdeclarativegeomap_p.h +++ b/src/location/declarativemaps/qdeclarativegeomap_p.h @@ -263,7 +263,7 @@ protected: void setZoomLevel(qreal zoomLevel, bool overzoom); bool addMapChild(QObject *child); bool removeMapChild(QObject *child); - bool isGroupNested(QDeclarativeGeoMapItemGroup *group); + bool isGroupNested(QDeclarativeGeoMapItemGroup *group) const; bool addMapItem_real(QDeclarativeGeoMapItemBase *item); bool removeMapItem_real(QDeclarativeGeoMapItemBase *item); @@ -287,7 +287,7 @@ private: void populateMap(); void populateParameters(); void fitViewportToMapItemsRefine(const QList<QPointer<QDeclarativeGeoMapItemBase> > &mapItems, bool refine, bool onlyVisible); - bool isInteractive(); + bool isInteractive() const; void attachCopyrightNotice(bool initialVisibility); void detachCopyrightNotice(bool currentVisibility); QMargins mapMargins() const; diff --git a/src/location/declarativemaps/qdeclarativegeomapitemutils_p.h b/src/location/declarativemaps/qdeclarativegeomapitemutils_p.h index 9d8b1bfe..634bd262 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitemutils_p.h +++ b/src/location/declarativemaps/qdeclarativegeomapitemutils_p.h @@ -90,18 +90,18 @@ public: }; static void wrapPath(const QList<QGeoCoordinate> &perimeter - ,const QGeoCoordinate &geoLeftBound - ,const QGeoProjectionWebMercator &p - ,QList<QDoubleVector2D> &wrappedPath - ,QList<QDoubleVector2D> &wrappedPathMinus1 - ,QList<QDoubleVector2D> &wrappedPathPlus1 - ,QDoubleVector2D *leftBoundWrapped = nullptr); + , const QGeoCoordinate &geoLeftBound + , const QGeoProjectionWebMercator &p + , QList<QDoubleVector2D> &wrappedPath + , QList<QDoubleVector2D> &wrappedPathMinus1 + , QList<QDoubleVector2D> &wrappedPathPlus1 + , QDoubleVector2D *leftBoundWrapped = nullptr); static void wrapPath(const QList<QGeoCoordinate> &perimeter - ,const QGeoCoordinate &geoLeftBound - ,const QGeoProjectionWebMercator &p - ,QList<QDoubleVector2D> &wrappedPath - ,QDoubleVector2D *leftBoundWrapped = nullptr); + , const QGeoCoordinate &geoLeftBound + , const QGeoProjectionWebMercator &p + , QList<QDoubleVector2D> &wrappedPath + , QDoubleVector2D *leftBoundWrapped = nullptr); static void wrapPath(const QList<QDoubleVector2D> &path , const QDoubleVector2D &geoLeftBound @@ -109,14 +109,14 @@ public: static void clipPolygon(const QList<QDoubleVector2D> &wrappedPath - ,const QGeoProjectionWebMercator &p - ,QList<QList<QDoubleVector2D> > &clippedPaths - ,QDoubleVector2D *leftBoundWrapped = nullptr - ,const bool closed = true); + , const QGeoProjectionWebMercator &p + , QList<QList<QDoubleVector2D> > &clippedPaths + , QDoubleVector2D *leftBoundWrapped = nullptr + , bool closed = true); static void projectBbox(const QList<QDoubleVector2D> &clippedBbox - ,const QGeoProjectionWebMercator &p - ,QPainterPath &projectedBbox); + , const QGeoProjectionWebMercator &p + , QPainterPath &projectedBbox); }; diff --git a/src/location/declarativemaps/qdeclarativegeomaptype.cpp b/src/location/declarativemaps/qdeclarativegeomaptype.cpp index b3ccdd21..996a5b04 100644 --- a/src/location/declarativemaps/qdeclarativegeomaptype.cpp +++ b/src/location/declarativemaps/qdeclarativegeomaptype.cpp @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE a flag to indicate if the map type is optimized for mobile devices (\l mobile). */ -QDeclarativeGeoMapType::QDeclarativeGeoMapType(const QGeoMapType mapType, QObject *parent) +QDeclarativeGeoMapType::QDeclarativeGeoMapType(const QGeoMapType &mapType, QObject *parent) : QObject(parent), mapType_(mapType), cameraCapabilities_(new QDeclarativeGeoCameraCapabilities(mapType.cameraCapabilities(), this)) {} diff --git a/src/location/declarativemaps/qdeclarativegeomaptype_p.h b/src/location/declarativemaps/qdeclarativegeomaptype_p.h index 34ed8095..8209a5ae 100644 --- a/src/location/declarativemaps/qdeclarativegeomaptype_p.h +++ b/src/location/declarativemaps/qdeclarativegeomaptype_p.h @@ -114,7 +114,7 @@ public: CustomMap = 100 }; - QDeclarativeGeoMapType(const QGeoMapType mapType, QObject *parent = 0); + QDeclarativeGeoMapType(const QGeoMapType &mapType, QObject *parent = 0); ~QDeclarativeGeoMapType(); MapStyle style() const; @@ -125,7 +125,7 @@ public: QDeclarativeGeoCameraCapabilities *cameraCapabilities() const; QVariantMap metadata() const; - const QGeoMapType mapType() { return mapType_; } + QGeoMapType mapType() const { return mapType_; } private: QGeoMapType mapType_; diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp index 8275d762..6bec322b 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp @@ -863,7 +863,7 @@ void QDeclarativeGeoRouteQuery::setNumberAlternativeRoutes(int numberAlternative \sa waypointObjects, addWaypoint, removeWaypoint, clearWaypoints */ -QVariantList QDeclarativeGeoRouteQuery::waypoints() +QVariantList QDeclarativeGeoRouteQuery::waypoints() const { QVariantList res; @@ -881,7 +881,7 @@ QVariantList QDeclarativeGeoRouteQuery::waypoints() \sa waypointObjects, addWaypoint, removeWaypoint, clearWaypoints */ -QVariantList QDeclarativeGeoRouteQuery::waypointObjects() +QVariantList QDeclarativeGeoRouteQuery::waypointObjects() const { QVariantList res; diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h index 1832f6f5..69f7b4b9 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h @@ -375,8 +375,8 @@ public: QList<int> featureTypes(); - QVariantList waypoints(); - Q_INVOKABLE QVariantList waypointObjects(); + QVariantList waypoints() const; + Q_INVOKABLE QVariantList waypointObjects() const; void setWaypoints(const QVariantList &value); // READ functions for list properties diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp index ab4851c0..4b24162f 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp @@ -202,7 +202,7 @@ void QDeclarativeGeoServiceProvider::componentComplete() QStringList providers = QGeoServiceProvider::availableServiceProviders(); /* first check any preferred plugins */ - for (const QString &name : prefer_) { + for (const QString &name : qAsConst(prefer_)) { if (providers.contains(name)) { // so we don't try it again later providers.removeAll(name); diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index 42fad815..21913e1f 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -1700,10 +1700,10 @@ void QGeoMapPolylineGeometryOpenGL::allocateAndFillLineStrip(QSGGeometry *geom, } void MapPolylineNodeOpenGLExtruded::update(const QColor &fillColor, - const float lineWidth, + float lineWidth, const QGeoMapPolylineGeometryOpenGL *shape, - const QMatrix4x4 geoProjection, - const QDoubleVector3D center, + const QMatrix4x4 &geoProjection, + const QDoubleVector3D ¢er, const Qt::PenCapStyle capStyle, bool closed, unsigned int zoom) diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h index 0ec2f4a5..0cad6682 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h @@ -178,7 +178,7 @@ public: m_wrapOffset = wrapOffset; } - void setLineWidth(const float lw) + void setLineWidth(float lw) { m_lineWidth = lw; } @@ -415,7 +415,7 @@ public: } QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override; - void setMiter(const int m) + void setMiter(int m) { m_miter = m; } @@ -462,10 +462,10 @@ public: ~MapPolylineNodeOpenGLExtruded() override; void update(const QColor &fillColor, - const float lineWidth, + float lineWidth, const QGeoMapPolylineGeometryOpenGL *shape, - const QMatrix4x4 geoProjection, - const QDoubleVector3D center, + const QMatrix4x4 &geoProjection, + const QDoubleVector3D ¢er, const Qt::PenCapStyle capStyle = Qt::FlatCap, bool closed = false, unsigned int zoom = 30); diff --git a/src/location/declarativemaps/qgeomapobject.cpp b/src/location/declarativemaps/qgeomapobject.cpp index bd9f6ac2..c8ee7c98 100644 --- a/src/location/declarativemaps/qgeomapobject.cpp +++ b/src/location/declarativemaps/qgeomapobject.cpp @@ -167,7 +167,7 @@ void QGeoMapObject::setChildrenVisibility() { const bool v = visible(); const QList<QGeoMapObject *> kids = geoMapObjectChildren(); - for (auto kid : qAsConst(kids)) + for (auto kid : kids) kid->setParentVisiblity(v); } diff --git a/src/location/declarativemaps/qparameterizableobject_p.h b/src/location/declarativemaps/qparameterizableobject_p.h index 90c36457..431c0d31 100644 --- a/src/location/declarativemaps/qparameterizableobject_p.h +++ b/src/location/declarativemaps/qparameterizableobject_p.h @@ -72,7 +72,7 @@ public: QList<T*> quickChildren() const { QList<T*> res; - for (auto kid : qAsConst(m_children)) { + for (auto kid : m_children) { auto val = qobject_cast<T*>(kid); if (val) res.push_back(val); diff --git a/src/location/declarativemaps/qquickgeomapgesturearea_p.h b/src/location/declarativemaps/qquickgeomapgesturearea_p.h index c06be42c..493fe5f8 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea_p.h +++ b/src/location/declarativemaps/qquickgeomapgesturearea_p.h @@ -387,11 +387,11 @@ private: flickActive } m_flickState; - inline void setTouchPointState(const TouchPointState state); - inline void setFlickState(const FlickState state); - inline void setTiltState(const TiltState state); - inline void setRotationState(const RotationState state); - inline void setPinchState(const PinchState state); + inline void setTouchPointState(TouchPointState state); + inline void setFlickState(FlickState state); + inline void setTiltState(TiltState state); + inline void setRotationState(RotationState state); + inline void setPinchState(PinchState state); }; QT_END_NAMESPACE diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp index 54473d13..f37ea0e7 100644 --- a/src/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/location/declarativeplaces/qdeclarativeplace.cpp @@ -392,7 +392,7 @@ void QDeclarativePlace::setPlace(const QPlace &src) synchronizeContacts(); } -QPlace QDeclarativePlace::place() +QPlace QDeclarativePlace::place() const { // The following properties are not stored in m_src but instead stored in QDeclarative* objects @@ -457,7 +457,7 @@ void QDeclarativePlace::setLocation(QDeclarativeGeoLocation *location) emit locationChanged(); } -QDeclarativeGeoLocation *QDeclarativePlace::location() +QDeclarativeGeoLocation *QDeclarativePlace::location() const { return m_location; } @@ -480,7 +480,7 @@ void QDeclarativePlace::setRatings(QDeclarativeRatings *rating) emit ratingsChanged(); } -QDeclarativeRatings *QDeclarativePlace::ratings() +QDeclarativeRatings *QDeclarativePlace::ratings() const { return m_ratings; diff --git a/src/location/declarativeplaces/qdeclarativeplace_p.h b/src/location/declarativeplaces/qdeclarativeplace_p.h index 2e8008c9..a2e21fe2 100644 --- a/src/location/declarativeplaces/qdeclarativeplace_p.h +++ b/src/location/declarativeplaces/qdeclarativeplace_p.h @@ -134,7 +134,7 @@ public: QDeclarativePlaceImageModel *imageModel(); QDeclarativePlaceEditorialModel *editorialModel(); - QPlace place(); + QPlace place() const; void setPlace(const QPlace &src); QQmlListProperty<QDeclarativeCategory> categories(); @@ -144,9 +144,9 @@ public: static QDeclarativeCategory *category_at(QQmlListProperty<QDeclarativeCategory> *prop, qsizetype index); static void category_clear(QQmlListProperty<QDeclarativeCategory> *prop); - QDeclarativeGeoLocation *location(); + QDeclarativeGeoLocation *location() const; void setLocation(QDeclarativeGeoLocation *location); - QDeclarativeRatings *ratings(); + QDeclarativeRatings *ratings() const; void setRatings(QDeclarativeRatings *ratings); QDeclarativeSupplier *supplier() const; void setSupplier(QDeclarativeSupplier *supplier); diff --git a/src/location/doc/snippets/places/requesthandler.h b/src/location/doc/snippets/places/requesthandler.h index 097a6a6d..edd90405 100644 --- a/src/location/doc/snippets/places/requesthandler.h +++ b/src/location/doc/snippets/places/requesthandler.h @@ -494,7 +494,8 @@ public slots: //! [Match places handler] void matchHandler() { if (matchReply->error() == QPlaceReply::NoError) { - for (const QPlace place : matchReply->places()) { + const auto places = matchReply->places(); + for (const QPlace &place : places) { if (place != QPlace()) qDebug() << "Place is a favorite with name" << place.name(); else diff --git a/src/location/labs/qgeotiledmaplabs.cpp b/src/location/labs/qgeotiledmaplabs.cpp index c31fd7c7..7daabf9e 100644 --- a/src/location/labs/qgeotiledmaplabs.cpp +++ b/src/location/labs/qgeotiledmaplabs.cpp @@ -70,7 +70,7 @@ public: protected: void changeViewportSize(const QSize &size) override; void changeCameraData(const QGeoCameraData &oldCameraData) override; - void changeActiveMapType(const QGeoMapType mapType) override; + void changeActiveMapType(const QGeoMapType &mapType) override; QGeoMapObjectQSGSupport m_qsgSupport; }; @@ -151,7 +151,7 @@ void QGeoTiledMapLabsPrivate::changeCameraData(const QGeoCameraData &oldCameraDa QGeoTiledMapPrivate::changeCameraData(oldCameraData); } -void QGeoTiledMapLabsPrivate::changeActiveMapType(const QGeoMapType mapType) +void QGeoTiledMapLabsPrivate::changeActiveMapType(const QGeoMapType &mapType) { updateObjectsGeometry(); QGeoTiledMapPrivate::changeActiveMapType(mapType); diff --git a/src/location/labs/qsg/qmappolylineobjectqsg.cpp b/src/location/labs/qsg/qmappolylineobjectqsg.cpp index 3b881de2..bce2db3a 100644 --- a/src/location/labs/qsg/qmappolylineobjectqsg.cpp +++ b/src/location/labs/qsg/qmappolylineobjectqsg.cpp @@ -70,7 +70,7 @@ QMapPolylineObjectPrivateQSG::~QMapPolylineObjectPrivateQSG() m_map->removeMapObject(q); } -QList<QDoubleVector2D> QMapPolylineObjectPrivateQSG::projectPath() +QList<QDoubleVector2D> QMapPolylineObjectPrivateQSG::projectPath() const { QList<QDoubleVector2D> geopathProjected_; if (!m_map || m_map->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) diff --git a/src/location/labs/qsg/qmappolylineobjectqsg_p_p.h b/src/location/labs/qsg/qmappolylineobjectqsg_p_p.h index 1a452bb1..efe1d436 100644 --- a/src/location/labs/qsg/qmappolylineobjectqsg_p_p.h +++ b/src/location/labs/qsg/qmappolylineobjectqsg_p_p.h @@ -68,7 +68,7 @@ public: QMapPolylineObjectPrivateQSG(const QMapPolylineObjectPrivate &other); ~QMapPolylineObjectPrivateQSG() override; - QList<QDoubleVector2D> projectPath(); + QList<QDoubleVector2D> projectPath() const; // QQSGMapObject void markSourceDirty(); diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp index 1a401b53..21b45cc6 100644 --- a/src/location/maps/qgeocameratiles.cpp +++ b/src/location/maps/qgeocameratiles.cpp @@ -506,22 +506,20 @@ QGeoCameraTilesPrivate::ClippedFootprint QGeoCameraTilesPrivate::clipFootprintTo PolygonVector results = footprint; - if (clipY0) { + if (clipY0) results = splitPolygonAtAxisValue(results, 1, 0.0).second; - } - if (clipY1) { + if (clipY1) results = splitPolygonAtAxisValue(results, 1, side).first; - } - for (const QDoubleVector3D &p: results) { + for (const QDoubleVector3D &p : qAsConst(results)) { if ((p.x() < 0.0) || (qFuzzyIsNull(p.x()))) clipX0 = true; if ((p.x() > side) || (qFuzzyCompare(side, p.x()))) clipX1 = true; } - for (const QDoubleVector3D &v : results) { + for (const QDoubleVector3D &v : qAsConst(results)) { minX = qMin(v.x(), minX); maxX = qMax(v.x(), maxX); } diff --git a/src/location/maps/qgeofiletilecache.cpp b/src/location/maps/qgeofiletilecache.cpp index 251b3237..9c0b9504 100644 --- a/src/location/maps/qgeofiletilecache.cpp +++ b/src/location/maps/qgeofiletilecache.cpp @@ -335,7 +335,7 @@ void QGeoFileTileCache::clearMapId(const int mapId) QDir dir(directory_); QStringList formats; formats << QLatin1String("*.*"); - QStringList files = dir.entryList(formats, QDir::Files); + const QStringList files = dir.entryList(formats, QDir::Files); qWarning() << "Old tile data detected. Cache eviction left out "<< files.size() << "tiles"; for (const QString &tileFileName : files) { QGeoTileSpec spec = filenameToTileSpec(tileFileName); diff --git a/src/location/maps/qgeofiletilecache_p.h b/src/location/maps/qgeofiletilecache_p.h index 3def14e7..bc5c849c 100644 --- a/src/location/maps/qgeofiletilecache_p.h +++ b/src/location/maps/qgeofiletilecache_p.h @@ -110,7 +110,7 @@ public: int minTextureUsage() const override; int textureUsage() const override; void clearAll() override; - void clearMapId(const int mapId); + void clearMapId(int mapId); void setCostStrategyDisk(CostStrategy costStrategy) override; CostStrategy costStrategyDisk() const override; void setCostStrategyMemory(CostStrategy costStrategy) override; diff --git a/src/location/maps/qgeomaneuver.cpp b/src/location/maps/qgeomaneuver.cpp index 4cb6b6fb..26d3592f 100644 --- a/src/location/maps/qgeomaneuver.cpp +++ b/src/location/maps/qgeomaneuver.cpp @@ -370,7 +370,7 @@ QString QGeoManeuverPrivate::id() const return QString(); } -void QGeoManeuverPrivate::setId(const QString id) +void QGeoManeuverPrivate::setId(const QString &id) { Q_UNUSED(id); } @@ -488,7 +488,7 @@ QString QGeoManeuverPrivateDefault::id() const return m_id; } -void QGeoManeuverPrivateDefault::setId(const QString id) +void QGeoManeuverPrivateDefault::setId(const QString &id) { m_id = id; } diff --git a/src/location/maps/qgeomaneuver_p.h b/src/location/maps/qgeomaneuver_p.h index 918169fc..8ce368e0 100644 --- a/src/location/maps/qgeomaneuver_p.h +++ b/src/location/maps/qgeomaneuver_p.h @@ -74,7 +74,7 @@ public: virtual void setValid(bool valid); virtual QString id() const; - virtual void setId(const QString id); + virtual void setId(const QString &id); virtual QGeoCoordinate position() const; virtual void setPosition(const QGeoCoordinate &position); @@ -113,7 +113,7 @@ public: virtual void setValid(bool valid) override; virtual QString id() const override; - virtual void setId(const QString id) override; + virtual void setId(const QString &id) override; virtual QGeoCoordinate position() const override; virtual void setPosition(const QGeoCoordinate &position) override; diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp index 9766a5b7..f6b3edca 100644 --- a/src/location/maps/qgeomap.cpp +++ b/src/location/maps/qgeomap.cpp @@ -157,7 +157,7 @@ const QGeoCameraData &QGeoMap::cameraData() const return d->m_cameraData; } -void QGeoMap::setActiveMapType(const QGeoMapType type) +void QGeoMap::setActiveMapType(const QGeoMapType &type) { Q_D(QGeoMap); if (type == d->m_activeMapType) @@ -168,7 +168,7 @@ void QGeoMap::setActiveMapType(const QGeoMapType type) emit activeMapTypeChanged(); } -const QGeoMapType QGeoMap::activeMapType() const +QGeoMapType QGeoMap::activeMapType() const { Q_D(const QGeoMap); return d->m_activeMapType; diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h index 295a5aba..331359ad 100644 --- a/src/location/maps/qgeomap_p.h +++ b/src/location/maps/qgeomap_p.h @@ -117,8 +117,8 @@ public: QGeoCameraCapabilities cameraCapabilities() const; virtual Capabilities capabilities() const; - void setActiveMapType(const QGeoMapType mapType); - const QGeoMapType activeMapType() const; + void setActiveMapType(const QGeoMapType &mapType); + QGeoMapType activeMapType() const; // returns the minimum zoom at the current viewport size double minimumZoom() const; diff --git a/src/location/maps/qgeomap_p_p.h b/src/location/maps/qgeomap_p_p.h index 97707ccb..eaa62989 100644 --- a/src/location/maps/qgeomap_p_p.h +++ b/src/location/maps/qgeomap_p_p.h @@ -98,7 +98,7 @@ protected: virtual void changeViewportSize(const QSize &size) = 0; // called by QGeoMap::setSize() virtual void changeCameraData(const QGeoCameraData &oldCameraData) = 0; // called by QGeoMap::setCameraData() - virtual void changeActiveMapType(const QGeoMapType mapType) = 0; // called by QGeoMap::setActiveMapType() + virtual void changeActiveMapType(const QGeoMapType &mapType) = 0; // called by QGeoMap::setActiveMapType() virtual double mapWidth() const; virtual double mapHeight() const; diff --git a/src/location/maps/qgeomapparameter.cpp b/src/location/maps/qgeomapparameter.cpp index fb069bf2..aef520e0 100644 --- a/src/location/maps/qgeomapparameter.cpp +++ b/src/location/maps/qgeomapparameter.cpp @@ -101,7 +101,7 @@ QVariantMap QGeoMapParameter::toVariantMap() const return res; } -bool QGeoMapParameter::hasProperty(const char *propertyName) +bool QGeoMapParameter::hasProperty(const char *propertyName) const { return metaObject()->indexOfProperty(propertyName) != -1 || dynamicPropertyNames().indexOf(QByteArray(propertyName)) != -1; diff --git a/src/location/maps/qgeomapparameter_p.h b/src/location/maps/qgeomapparameter_p.h index 36226ef4..ab3bc9c3 100644 --- a/src/location/maps/qgeomapparameter_p.h +++ b/src/location/maps/qgeomapparameter_p.h @@ -76,7 +76,7 @@ public: void updateProperty(const char *propertyName, QVariant value); QVariantMap toVariantMap() const; - bool hasProperty(const char *propertyName); + bool hasProperty(const char *propertyName) const; Q_SIGNALS: void propertyUpdated(QGeoMapParameter *param, const char *propertyName); diff --git a/src/location/maps/qgeorouteparserosrmv5.cpp b/src/location/maps/qgeorouteparserosrmv5.cpp index 151e065f..4225a1dd 100644 --- a/src/location/maps/qgeorouteparserosrmv5.cpp +++ b/src/location/maps/qgeorouteparserosrmv5.cpp @@ -921,8 +921,8 @@ QGeoRouteReply::Error QGeoRouteParserOsrmV5Private::parseReply(QList<QGeoRoute> return QGeoRouteReply::ParseError; } - QJsonArray osrmRoutes = object.value(QLatin1String("routes")).toArray(); - for (const QJsonValueRef r : osrmRoutes) { + const QJsonArray osrmRoutes = object.value(QLatin1String("routes")).toArray(); + for (const QJsonValueConstRef r : osrmRoutes) { if (!r.isObject()) continue; QJsonObject routeObject = r.toObject(); @@ -938,7 +938,7 @@ QGeoRouteReply::Error QGeoRouteParserOsrmV5Private::parseReply(QList<QGeoRoute> bool error = false; QList<QGeoRouteSegment> segments; - QJsonArray legs = routeObject.value(QLatin1String("legs")).toArray(); + const QJsonArray legs = routeObject.value(QLatin1String("legs")).toArray(); QList<QGeoRouteLeg> routeLegs; QGeoRoute route; for (int legIndex = 0; legIndex < legs.size(); ++legIndex) { @@ -949,14 +949,14 @@ QGeoRouteReply::Error QGeoRouteParserOsrmV5Private::parseReply(QList<QGeoRoute> error = true; break; } - QJsonObject leg = l.toObject(); + const QJsonObject leg = l.toObject(); if (!leg.value(QLatin1String("steps")).isArray()) { // Invalid steps field error = true; break; } const double legDistance = leg.value(QLatin1String("distance")).toDouble(); const double legTravelTime = leg.value(QLatin1String("duration")).toDouble(); - QJsonArray steps = leg.value(QLatin1String("steps")).toArray(); + const QJsonArray steps = leg.value(QLatin1String("steps")).toArray(); QGeoRouteSegment segment; for (int stepIndex = 0; stepIndex < steps.size(); ++stepIndex) { const QJsonValue &s = steps.at(stepIndex); diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp index 4a82b3b6..dcf8d043 100644 --- a/src/location/maps/qgeoserviceprovider.cpp +++ b/src/location/maps/qgeoserviceprovider.cpp @@ -275,7 +275,7 @@ QGeoServiceProvider::~QGeoServiceProvider() * Ideally, the enumName would be a template parameter, but strings * are not a valid const expr. :( */ template <class Flags> -Flags QGeoServiceProviderPrivate::features(const char *enumName) +Flags QGeoServiceProviderPrivate::features(const char *enumName) const { const QMetaObject *mo = &QGeoServiceProvider::staticMetaObject; const QMetaEnum en = mo->enumerator( diff --git a/src/location/maps/qgeoserviceprovider_p.h b/src/location/maps/qgeoserviceprovider_p.h index 5994c33d..1ebc4f5e 100644 --- a/src/location/maps/qgeoserviceprovider_p.h +++ b/src/location/maps/qgeoserviceprovider_p.h @@ -85,7 +85,7 @@ public: Manager *manager(QGeoServiceProvider::Error *error, QString *errorString, Manager **manager); template <class Flags> - Flags features(const char *enumName); + Flags features(const char *enumName) const; QGeoServiceProviderFactory *factory; QGeoServiceProviderFactoryV2 *factoryV2 = nullptr; diff --git a/src/location/maps/qgeotiledmap.cpp b/src/location/maps/qgeotiledmap.cpp index 37e7b791..2e2911b1 100644 --- a/src/location/maps/qgeotiledmap.cpp +++ b/src/location/maps/qgeotiledmap.cpp @@ -277,7 +277,7 @@ void QGeoTiledMapPrivate::prefetchTiles() } } -QGeoMapType QGeoTiledMapPrivate::activeMapType() +QGeoMapType QGeoTiledMapPrivate::activeMapType() const { return m_visibleTiles->activeMapType(); } @@ -382,7 +382,7 @@ QRectF QGeoTiledMapPrivate::visibleArea() const return m_visibleArea; } -void QGeoTiledMapPrivate::changeActiveMapType(const QGeoMapType mapType) +void QGeoTiledMapPrivate::changeActiveMapType(const QGeoMapType &mapType) { m_visibleTiles->setTileSize(m_cameraCapabilities.tileSize()); m_prefetchTiles->setTileSize(m_cameraCapabilities.tileSize()); diff --git a/src/location/maps/qgeotiledmap_p_p.h b/src/location/maps/qgeotiledmap_p_p.h index 6c5f01fb..58e66ce5 100644 --- a/src/location/maps/qgeotiledmap_p_p.h +++ b/src/location/maps/qgeotiledmap_p_p.h @@ -82,13 +82,13 @@ public: void updateTile(const QGeoTileSpec &spec); void prefetchTiles(); - QGeoMapType activeMapType(); + QGeoMapType activeMapType() const; void onCameraCapabilitiesChanged(const QGeoCameraCapabilities &oldCameraCapabilities); protected: void changeViewportSize(const QSize& size) override; void changeCameraData(const QGeoCameraData &cameraData) override; - void changeActiveMapType(const QGeoMapType mapType) override; + void changeActiveMapType(const QGeoMapType &mapType) override; void changeTileVersion(int version); void clearScene(); diff --git a/src/location/maps/qgeotiledmapscene_p_p.h b/src/location/maps/qgeotiledmapscene_p_p.h index 4c087d43..d1e735f2 100644 --- a/src/location/maps/qgeotiledmapscene_p_p.h +++ b/src/location/maps/qgeotiledmapscene_p_p.h @@ -144,7 +144,7 @@ public: bool buildGeometry(const QGeoTileSpec &spec, QSGImageNode *imageNode, bool &overzooming); void updateTileBounds(const QSet<QGeoTileSpec> &tiles); void setupCamera(); - inline bool isTiltedOrRotated() { return (m_cameraData.tilt() > 0.0) || (m_cameraData.bearing() > 0.0); } + inline bool isTiltedOrRotated() const { return (m_cameraData.tilt() > 0.0) || (m_cameraData.bearing() > 0.0); } public: diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp index d59cf427..4829b508 100644 --- a/src/location/places/qplacemanager.cpp +++ b/src/location/places/qplacemanager.cpp @@ -389,7 +389,7 @@ void QPlaceManager::setLocales(const QList<QLocale> &locales) present in the modified version. Manager specific data such as the place id, is not copied over from the \a original. */ -QPlace QPlaceManager::compatiblePlace(const QPlace &original) +QPlace QPlaceManager::compatiblePlace(const QPlace &original) const { return d->compatiblePlace(original); } diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index d8802e2b..893922ad 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -98,7 +98,7 @@ public: void setLocale(const QLocale &locale); void setLocales(const QList<QLocale> &locale); - QPlace compatiblePlace(const QPlace &place); + QPlace compatiblePlace(const QPlace &place) const; QPlaceMatchReply *matchingPlaces(const QPlaceMatchRequest &request) const; diff --git a/src/location/places/qplacematchrequest.cpp b/src/location/places/qplacematchrequest.cpp index 486ff16b..1356b1d7 100644 --- a/src/location/places/qplacematchrequest.cpp +++ b/src/location/places/qplacematchrequest.cpp @@ -193,7 +193,7 @@ QList<QPlace> QPlaceMatchRequest::places() const \sa setResults() */ -void QPlaceMatchRequest::setPlaces(const QList<QPlace> places) +void QPlaceMatchRequest::setPlaces(const QList<QPlace> &places) { Q_D(QPlaceMatchRequest); d->places = places; diff --git a/src/location/places/qplacematchrequest.h b/src/location/places/qplacematchrequest.h index 91aaaadd..9884a5cb 100644 --- a/src/location/places/qplacematchrequest.h +++ b/src/location/places/qplacematchrequest.h @@ -71,7 +71,7 @@ public: { return !lhs.isEqual(rhs); } QList<QPlace> places() const; - void setPlaces(const QList<QPlace> places); + void setPlaces(const QList<QPlace> &places); void setResults(const QList<QPlaceSearchResult> &results); diff --git a/src/plugins/geoservices/itemsoverlay/qgeomapitemsoverlay.cpp b/src/plugins/geoservices/itemsoverlay/qgeomapitemsoverlay.cpp index 44758d68..f6a696fe 100644 --- a/src/plugins/geoservices/itemsoverlay/qgeomapitemsoverlay.cpp +++ b/src/plugins/geoservices/itemsoverlay/qgeomapitemsoverlay.cpp @@ -81,7 +81,7 @@ public: protected: void changeViewportSize(const QSize &size) override; void changeCameraData(const QGeoCameraData &oldCameraData) override; - void changeActiveMapType(const QGeoMapType mapType) override; + void changeActiveMapType(const QGeoMapType &mapType) override; QRectF m_visibleArea; }; @@ -253,7 +253,7 @@ void QGeoMapItemsOverlayPrivate::changeCameraData(const QGeoCameraData &/*oldCam updateObjectsGeometry(); } -void QGeoMapItemsOverlayPrivate::changeActiveMapType(const QGeoMapType /*mapType*/) +void QGeoMapItemsOverlayPrivate::changeActiveMapType(const QGeoMapType &/*mapType*/) { updateObjectsGeometry(); } diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h index 1c180f31..6098a5e1 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h @@ -99,7 +99,7 @@ public: protected: void changeViewportSize(const QSize &size) override; void changeCameraData(const QGeoCameraData &oldCameraData) override; - void changeActiveMapType(const QGeoMapType mapType) override; + void changeActiveMapType(const QGeoMapType &mapType) override; void setVisibleArea(const QRectF &visibleArea) override; QRectF visibleArea() const override; diff --git a/src/plugins/geoservices/nokia/qgeomapversion.cpp b/src/plugins/geoservices/nokia/qgeomapversion.cpp index ec250325..752f5c6a 100644 --- a/src/plugins/geoservices/nokia/qgeomapversion.cpp +++ b/src/plugins/geoservices/nokia/qgeomapversion.cpp @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE QGeoMapVersion::QGeoMapVersion() : m_version(-1) {} -bool QGeoMapVersion::isNewVersion(const QJsonObject &newVersionData) +bool QGeoMapVersion::isNewVersion(const QJsonObject &newVersionData) const { return m_versionData != newVersionData; } diff --git a/src/plugins/geoservices/nokia/qgeomapversion.h b/src/plugins/geoservices/nokia/qgeomapversion.h index 83536912..94acad60 100644 --- a/src/plugins/geoservices/nokia/qgeomapversion.h +++ b/src/plugins/geoservices/nokia/qgeomapversion.h @@ -50,7 +50,7 @@ class QGeoMapVersion public: QGeoMapVersion(); - bool isNewVersion(const QJsonObject &newVersionData); + bool isNewVersion(const QJsonObject &newVersionData) const; int version() const; void setVersion(const int); void setVersionData(const QJsonObject &versionData); diff --git a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp index 72ef9d38..dc6f9435 100644 --- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp @@ -214,7 +214,7 @@ bool QGeoRoutingManagerEngineNokia::checkEngineSupport(const QGeoRouteRequest &r return true; } -QStringList QGeoRoutingManagerEngineNokia::calculateRouteRequestString(const QGeoRouteRequest &request) +QStringList QGeoRoutingManagerEngineNokia::calculateRouteRequestString(const QGeoRouteRequest &request) const { bool supported = checkEngineSupport(request, request.travelModes()); diff --git a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h index 90e5b9de..f7c5d0fa 100644 --- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h +++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h @@ -68,7 +68,7 @@ private Q_SLOTS: void routeError(QGeoRouteReply::Error error, const QString &errorString); private: - QStringList calculateRouteRequestString(const QGeoRouteRequest &request); + QStringList calculateRouteRequestString(const QGeoRouteRequest &request) const; QStringList updateRouteRequestString(const QGeoRoute &route, const QGeoCoordinate &position); QString routeRequestString(const QGeoRouteRequest &request) const; bool checkEngineSupport(const QGeoRouteRequest &request, diff --git a/src/plugins/geoservices/nokia/qgeotiledmap_nokia.h b/src/plugins/geoservices/nokia/qgeotiledmap_nokia.h index 896f5fe6..7822ff99 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmap_nokia.h +++ b/src/plugins/geoservices/nokia/qgeotiledmap_nokia.h @@ -61,7 +61,7 @@ public: QGeoTiledMapNokia(QGeoTiledMappingManagerEngineNokia *engine, QObject *parent = 0); ~QGeoTiledMapNokia(); - QString getViewCopyright(); + QString getViewCopyright() const; void evaluateCopyrights(const QSet<QGeoTileSpec> &visibleTiles) override; private: diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index a7faf26d..80fe533e 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -239,19 +239,19 @@ void QGeoTiledMappingManagerEngineNokia::populateMapSchemes() m_mapSchemes[21] = QStringLiteral("carnav.day.grey"); } -QString QGeoTiledMappingManagerEngineNokia::getScheme(int mapId) +QString QGeoTiledMappingManagerEngineNokia::getScheme(int mapId) const { return m_mapSchemes[mapId]; } -QString QGeoTiledMappingManagerEngineNokia::getBaseScheme(int mapId) +QString QGeoTiledMappingManagerEngineNokia::getBaseScheme(int mapId) const { - QString fullScheme(m_mapSchemes[mapId]); + const QString fullScheme(m_mapSchemes[mapId]); return fullScheme.section(QLatin1Char('.'), 0, 0); } -int QGeoTiledMappingManagerEngineNokia::mapVersion() +int QGeoTiledMappingManagerEngineNokia::mapVersion() const { return m_mapVersion.version(); } @@ -367,8 +367,8 @@ void QGeoTiledMappingManagerEngineNokia::loadMapVersion() setTileVersion(m_mapVersion.version()); } -QString QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(const QGeoMapType mapType, - const qreal zoomLevel, +QString QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(const QGeoMapType &mapType, + qreal zoomLevel, const QSet<QGeoTileSpec> &tiles) { static const QChar copyrightSymbol(0x00a9); diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h index 43edd0a0..69d42dec 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h @@ -69,12 +69,12 @@ public: ~QGeoTiledMappingManagerEngineNokia(); QGeoMap *createMap() override; - QString evaluateCopyrightsText(const QGeoMapType mapType, - const qreal zoomLevel, + QString evaluateCopyrightsText(const QGeoMapType &mapType, + qreal zoomLevel, const QSet<QGeoTileSpec> &tiles); - QString getScheme(int mapId); - QString getBaseScheme(int mapId); - int mapVersion(); + QString getScheme(int mapId) const; + QString getBaseScheme(int mapId) const; + int mapVersion() const; public Q_SLOTS: void loadCopyrightsDescriptorsFromJson(const QByteArray &jsonData); diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp index fb863f21..57fad1f1 100644 --- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp @@ -125,7 +125,7 @@ QGeoTiledMapReply *QGeoTileFetcherNokia::getTileImage(const QGeoTileSpec &spec) return mapReply; } -QString QGeoTileFetcherNokia::getRequestString(const QGeoTileSpec &spec, int ppi) +QString QGeoTileFetcherNokia::getRequestString(const QGeoTileSpec &spec, int ppi) const { if (!m_engineNokia) return QString(); diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h index 60e2e0cf..9d460264 100644 --- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h +++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h @@ -77,7 +77,7 @@ public Q_SLOTS: private: Q_DISABLE_COPY(QGeoTileFetcherNokia) - QString getRequestString(const QGeoTileSpec &spec, int ppi=72); + QString getRequestString(const QGeoTileSpec &spec, int ppi=72) const; QString getLanguageString() const; diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp index d3bbbefb..12f1476e 100644 --- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp +++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp @@ -143,7 +143,7 @@ bool QGeoTileProviderOsm::isHighDpi() const return m_provider->isHighDpi(); } -const QDateTime QGeoTileProviderOsm::timestamp() const +QDateTime QGeoTileProviderOsm::timestamp() const { if (!m_provider) return QDateTime(); diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.h b/src/plugins/geoservices/osm/qgeotileproviderosm.h index 4e074376..60c9c62f 100644 --- a/src/plugins/geoservices/osm/qgeotileproviderosm.h +++ b/src/plugins/geoservices/osm/qgeotileproviderosm.h @@ -160,7 +160,7 @@ public: const QGeoMapType &mapType() const; bool isValid() const; bool isResolved() const; - const QDateTime timestamp() const; + QDateTime timestamp() const; QGeoCameraCapabilities cameraCapabilities() const; Q_SIGNALS: |