From 7bed9b1934b7005645ea9f42fffc6ffba9e4ae9c Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Fri, 27 Dec 2024 17:44:16 +0700 Subject: [PATCH] Address const review --- src/core/positioning/positioningsource.cpp | 2 +- src/core/qgsquick/qgsquickcoordinatetransformer.cpp | 4 ++-- src/core/qgsquick/qgsquickcoordinatetransformer.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/positioning/positioningsource.cpp b/src/core/positioning/positioningsource.cpp index 81b6319b12..97a21f2903 100644 --- a/src/core/positioning/positioningsource.cpp +++ b/src/core/positioning/positioningsource.cpp @@ -153,7 +153,7 @@ void PositioningSource::setBackgroundMode( bool backgroundMode ) if ( mBackgroundMode ) { QFile file( QStringLiteral( "%1.information" ).arg( backgroundFilePath ) ); - file.open( QFile::WriteOnly ); + file.open( QFile::Truncate ); file.close(); } diff --git a/src/core/qgsquick/qgsquickcoordinatetransformer.cpp b/src/core/qgsquick/qgsquickcoordinatetransformer.cpp index 713ade7392..3060072249 100644 --- a/src/core/qgsquick/qgsquickcoordinatetransformer.cpp +++ b/src/core/qgsquick/qgsquickcoordinatetransformer.cpp @@ -107,7 +107,7 @@ QgsCoordinateTransformContext QgsQuickCoordinateTransformer::transformContext() return mCoordinateTransform.context(); } -QgsPoint QgsQuickCoordinateTransformer::transformPosition( const QgsPoint &position ) +QgsPoint QgsQuickCoordinateTransformer::transformPosition( const QgsPoint &position ) const { return processPosition( position ); } @@ -118,7 +118,7 @@ void QgsQuickCoordinateTransformer::updatePosition() emit projectedPositionChanged(); } -QgsPoint QgsQuickCoordinateTransformer::processPosition( const QgsPoint &position ) +QgsPoint QgsQuickCoordinateTransformer::processPosition( const QgsPoint &position ) const { double x = position.x(); double y = position.y(); diff --git a/src/core/qgsquick/qgsquickcoordinatetransformer.h b/src/core/qgsquick/qgsquickcoordinatetransformer.h index 36c1286016..add01f58a4 100644 --- a/src/core/qgsquick/qgsquickcoordinatetransformer.h +++ b/src/core/qgsquick/qgsquickcoordinatetransformer.h @@ -125,7 +125,7 @@ class QgsQuickCoordinateTransformer : public QObject //!\copydoc QgsQuickCoordinateTransformer::verticalGrid void setVerticalGrid( const QString &grid ); - Q_INVOKABLE QgsPoint transformPosition( const QgsPoint &position ); + Q_INVOKABLE QgsPoint transformPosition( const QgsPoint &position ) const; signals: //!\copydoc QgsQuickCoordinateTransformer::projectedPosition @@ -156,7 +156,7 @@ class QgsQuickCoordinateTransformer : public QObject private: void updatePosition(); - QgsPoint processPosition( const QgsPoint &position ); + QgsPoint processPosition( const QgsPoint &position ) const; QgsPoint mProjectedPosition; QgsPoint mSourcePosition;