diff --git a/app/activeproject.cpp b/app/activeproject.cpp index acfb53093..9bb7aeb71 100644 --- a/app/activeproject.cpp +++ b/app/activeproject.cpp @@ -50,7 +50,7 @@ ActiveProject::ActiveProject( AppSettings &appSettings QObject::connect( &mLocalProjectsManager, &LocalProjectsManager::aboutToRemoveLocalProject, - this, [this]( const LocalProject & project ) + this, [this]( const LocalProject &project ) { if ( project.id() == mLocalProject.id() ) { @@ -62,7 +62,7 @@ ActiveProject::ActiveProject( AppSettings &appSettings QObject::connect( &mLocalProjectsManager, &LocalProjectsManager::localProjectDataChanged, - this, [this]( const LocalProject & project ) + this, [this]( const LocalProject &project ) { if ( project.projectDir == mLocalProject.projectDir ) { diff --git a/app/attributes/fieldvalidator.cpp b/app/attributes/fieldvalidator.cpp index 4f819b047..d946e294e 100644 --- a/app/attributes/fieldvalidator.cpp +++ b/app/attributes/fieldvalidator.cpp @@ -195,7 +195,7 @@ QString FieldValidator::constructConstraintValidationMessage( const FormItem &it QgsFieldConstraints fldCons = field.constraints(); QStringList validationMessages; - bool hasNotNullConstraint = fldCons.constraints() & QgsFieldConstraints::ConstraintNotNull; + bool hasNotNullConstraint = fldCons.constraints() &QgsFieldConstraints::ConstraintNotNull; bool notNullViolated = unmetConstraints.contains( QStringLiteral( "value is NULL" ) ); if ( hasNotNullConstraint && notNullViolated ) @@ -212,7 +212,7 @@ QString FieldValidator::constructConstraintValidationMessage( const FormItem &it } } - bool hasUniqueConstraint = fldCons.constraints() & QgsFieldConstraints::ConstraintUnique; + bool hasUniqueConstraint = fldCons.constraints() &QgsFieldConstraints::ConstraintUnique; bool uniqueViolated = unmetConstraints.contains( QStringLiteral( "value is not unique" ) ); if ( hasUniqueConstraint && uniqueViolated ) @@ -229,7 +229,7 @@ QString FieldValidator::constructConstraintValidationMessage( const FormItem &it } } - bool hasExpressionConstrain = fldCons.constraints() & QgsFieldConstraints::ConstraintExpression; + bool hasExpressionConstrain = fldCons.constraints() &QgsFieldConstraints::ConstraintExpression; bool expressionViolated = unmetConstraints.filter( QRegularExpression( "(parser error|evaluation error|check failed)" ) ).size() > 0; if ( hasExpressionConstrain && expressionViolated ) diff --git a/app/identifykit.cpp b/app/identifykit.cpp index 2864129e0..8a189d440 100644 --- a/app/identifykit.cpp +++ b/app/identifykit.cpp @@ -214,11 +214,11 @@ QgsFeatureList IdentifyKit::identifyVectorLayer( QgsVectorLayer *layer, const Qg QgsRenderContext context( QgsRenderContext::fromMapSettings( mMapSettings->mapSettings() ) ); context.expressionContext() << QgsExpressionContextUtils::layerScope( layer ); QgsFeatureRenderer *renderer = layer->renderer(); - if ( renderer && renderer->capabilities() & QgsFeatureRenderer::ScaleDependent ) + if ( renderer && renderer->capabilities() &QgsFeatureRenderer::ScaleDependent ) { // setup scale for scale dependent visibility (rule based) renderer->startRender( context, layer->fields() ); - filter = renderer->capabilities() & QgsFeatureRenderer::Filter; + filter = renderer->capabilities() &QgsFeatureRenderer::Filter; } for ( const QgsFeature &feature : featureList ) @@ -231,7 +231,7 @@ QgsFeatureList IdentifyKit::identifyVectorLayer( QgsVectorLayer *layer, const Qg results.append( feature ); } - if ( renderer && renderer->capabilities() & QgsFeatureRenderer::ScaleDependent ) + if ( renderer && renderer->capabilities() &QgsFeatureRenderer::ScaleDependent ) { renderer->stopRender( context ); } @@ -241,7 +241,7 @@ QgsFeatureList IdentifyKit::identifyVectorLayer( QgsVectorLayer *layer, const Qg double IdentifyKit::searchRadiusMU( const QgsRenderContext &context ) const { - return mSearchRadiusMm * context.scaleFactor() * context.mapToPixel().mapUnitsPerPixel(); + return mSearchRadiusMm *context.scaleFactor() * context.mapToPixel().mapUnitsPerPixel(); } double IdentifyKit::searchRadiusMU() const diff --git a/app/inputprojutils.cpp b/app/inputprojutils.cpp index 6841e02bf..2774767fd 100644 --- a/app/inputprojutils.cpp +++ b/app/inputprojutils.cpp @@ -67,9 +67,9 @@ static QStringList detailsToStr( const QgsDatumTransform::TransformDetails &deta void InputProjUtils::initCoordinateOperationHandlers() { - QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [ = ]( const QgsCoordinateReferenceSystem & sourceCrs, - const QgsCoordinateReferenceSystem & destinationCrs, - const QgsDatumTransform::GridDetails & grid ) + QgsCoordinateTransform::setCustomMissingRequiredGridHandler( [ = ]( const QgsCoordinateReferenceSystem &sourceCrs, + const QgsCoordinateReferenceSystem &destinationCrs, + const QgsDatumTransform::GridDetails &grid ) { Q_UNUSED( destinationCrs ) Q_UNUSED( sourceCrs ) @@ -77,10 +77,10 @@ void InputProjUtils::initCoordinateOperationHandlers() warnUser( tr( "Missing required PROJ datum shift grid: %1. For newly downloaded project please restart Mergin Maps." ).arg( grid.shortName ) ); } ); - QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [ = ]( const QgsCoordinateReferenceSystem & sourceCrs, - const QgsCoordinateReferenceSystem & destinationCrs, - const QgsDatumTransform::TransformDetails & preferredOperation, - const QgsDatumTransform::TransformDetails & availableOperation ) + QgsCoordinateTransform::setCustomMissingPreferredGridHandler( [ = ]( const QgsCoordinateReferenceSystem &sourceCrs, + const QgsCoordinateReferenceSystem &destinationCrs, + const QgsDatumTransform::TransformDetails &preferredOperation, + const QgsDatumTransform::TransformDetails &availableOperation ) { Q_UNUSED( destinationCrs ) Q_UNUSED( sourceCrs ) @@ -88,9 +88,9 @@ void InputProjUtils::initCoordinateOperationHandlers() logUser( QStringLiteral( "missing preffered grid: %1" ).arg( detailsToStr( preferredOperation ).join( ";" ) ), mMissingPreferredGridReported ); } ); - QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [ = ]( const QgsCoordinateReferenceSystem & sourceCrs, - const QgsCoordinateReferenceSystem & destinationCrs, - const QString & error ) + QgsCoordinateTransform::setCustomCoordinateOperationCreationErrorHandler( [ = ]( const QgsCoordinateReferenceSystem &sourceCrs, + const QgsCoordinateReferenceSystem &destinationCrs, + const QString &error ) { Q_UNUSED( destinationCrs ) Q_UNUSED( sourceCrs ) @@ -98,9 +98,9 @@ void InputProjUtils::initCoordinateOperationHandlers() warnUser( tr( "Error creating custom PROJ operation. For newly downloaded project please restart Mergin Maps." ) ); } ); - QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [ = ]( const QgsCoordinateReferenceSystem & sourceCrs, - const QgsCoordinateReferenceSystem & destinationCrs, - const QgsDatumTransform::TransformDetails & desired ) + QgsCoordinateTransform::setCustomMissingGridUsedByContextHandler( [ = ]( const QgsCoordinateReferenceSystem &sourceCrs, + const QgsCoordinateReferenceSystem &destinationCrs, + const QgsDatumTransform::TransformDetails &desired ) { Q_UNUSED( destinationCrs ) Q_UNUSED( sourceCrs ) @@ -108,9 +108,9 @@ void InputProjUtils::initCoordinateOperationHandlers() warnUser( tr( "Missing required PROJ datum shift grids: %1. For newly downloaded project please restart Mergin Maps." ).arg( detailsToStr( desired ).join( "
" ) ) ); } ); - QgsCoordinateTransform::setFallbackOperationOccurredHandler( [ = ]( const QgsCoordinateReferenceSystem & sourceCrs, - const QgsCoordinateReferenceSystem & destinationCrs, - const QString & desired ) + QgsCoordinateTransform::setFallbackOperationOccurredHandler( [ = ]( const QgsCoordinateReferenceSystem &sourceCrs, + const QgsCoordinateReferenceSystem &destinationCrs, + const QString &desired ) { Q_UNUSED( destinationCrs ) Q_UNUSED( sourceCrs ) diff --git a/app/inpututils.cpp b/app/inpututils.cpp index c6e26183f..a969f04e6 100644 --- a/app/inpututils.cpp +++ b/app/inpututils.cpp @@ -179,7 +179,7 @@ QString InputUtils::formatDistanceInProjectUnit( const double distanceInMeters, } double factor = QgsUnitTypes::fromUnitToUnitFactor( Qgis::DistanceUnit::Meters, distUnit ); - double distance = distanceInMeters * factor; + double distance = distanceInMeters *factor; QString abbreviation = QgsUnitTypes::toAbbreviatedString( distUnit ); return QString( "%1 %2" ).arg( QString::number( distance, 'f', precision ), abbreviation ); @@ -532,7 +532,7 @@ QString InputUtils::filesToString( QList files ) QString InputUtils::bytesToHumanSize( double bytes ) { const int precision = 1; - if ( bytes < 1e-5 ) + if ( bytes < 1e - 5 ) { return "0.0"; } @@ -567,7 +567,7 @@ bool InputUtils::acquireCameraPermission() if ( Qt::PermissionStatus::Undetermined == status ) { // TODO this is async so it should be treated as such - qApp->requestPermission( QCameraPermission{}, []( const QPermission & permission ) {} ); + qApp->requestPermission( QCameraPermission{}, []( const QPermission &permission ) {} ); return false; } @@ -1355,7 +1355,7 @@ void InputUtils::formatToMetricDistance( double srcDistance, double &destDistance, Qgis::DistanceUnit &destUnits ) { - double dist = srcDistance * QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Millimeters ); + double dist = srcDistance *QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Millimeters ); if ( dist < 0 ) { destDistance = 0; @@ -1396,7 +1396,7 @@ void InputUtils::formatToImperialDistance( double srcDistance, double &destDistance, Qgis::DistanceUnit &destUnits ) { - double dist = srcDistance * QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Feet ); + double dist = srcDistance *QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Feet ); if ( dist < 0 ) { destDistance = 0; @@ -1430,7 +1430,7 @@ void InputUtils::formatToUSCSDistance( double srcDistance, double &destDistance, Qgis::DistanceUnit &destUnits ) { - double dist = srcDistance * QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Feet ); + double dist = srcDistance *QgsUnitTypes::fromUnitToUnitFactor( srcUnits, Qgis::DistanceUnit::Feet ); if ( dist < 0 ) { destDistance = 0; diff --git a/app/inpututils_p.cpp b/app/inpututils_p.cpp index 398918d8a..835428d53 100644 --- a/app/inpututils_p.cpp +++ b/app/inpututils_p.cpp @@ -99,7 +99,7 @@ qreal InputUtilsPrivate::calculateScreenDpr() double dpiY = screen->physicalDotsPerInchY(); qreal realDpi = dpiX < dpiY ? dpiX : dpiY; - realDpi = realDpi * screen->devicePixelRatio(); + realDpi = realDpi *screen->devicePixelRatio(); return realDpi / 160.; } diff --git a/app/ios/iosinterface.mm b/app/ios/iosinterface.mm index 7a8e3cbf1..ae2168e51 100644 --- a/app/ios/iosinterface.mm +++ b/app/ios/iosinterface.mm @@ -200,7 +200,7 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler static IOSViewDelegate *delegate = nullptr; delegate = [[IOSViewDelegate alloc] initWithHandler:handler]; - [[NSNotificationCenter defaultCenter] addObserverForName:@"_UIImagePickerControllerUserDidCaptureItem" object:nil queue:nil usingBlock: ^ ( NSNotification * _Nonnull notification ) + [[NSNotificationCenter defaultCenter] addObserverForName:@"_UIImagePickerControllerUserDidCaptureItem" object:nil queue:nil usingBlock: ^ ( NSNotification *_Nonnull notification ) { Q_UNUSED( notification ) // Fetch GPS data when an image is captured @@ -208,7 +208,7 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler }]; // Confirm event - delegate->imagePickerControllerDidFinishPickingMediaWithInfo = ^( UIImagePickerController * picker, NSDictionary * info ) + delegate->imagePickerControllerDidFinishPickingMediaWithInfo = ^( UIImagePickerController *picker, NSDictionary *info ) { if ( delegate->processingPicture ) { @@ -253,7 +253,7 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler // Cancel event - delegate->imagePickerControllerDidCancel = ^( UIImagePickerController * picker ) + delegate->imagePickerControllerDidCancel = ^( UIImagePickerController *picker ) { qWarning() << "Image Picker: Cancel event (imagePickerControllerDidCancel)"; [picker dismissViewControllerAnimated:YES completion:nil]; diff --git a/app/ios/iosutils.cpp b/app/ios/iosutils.cpp index 4b9c02063..be8e9c8b1 100644 --- a/app/ios/iosutils.cpp +++ b/app/ios/iosutils.cpp @@ -15,7 +15,7 @@ IosUtils::IosUtils( QObject *parent ): QObject( parent ) setIdleTimerDisabled(); #endif mImagePicker = new IOSImagePicker(); - QObject::connect( mImagePicker, &IOSImagePicker::imageCaptured, this, [this]( const QString & absoluteImagePath ) + QObject::connect( mImagePicker, &IOSImagePicker::imageCaptured, this, [this]( const QString &absoluteImagePath ) { emit imageSelected( absoluteImagePath, mLastCode ); } ); diff --git a/app/ios/iosviewdelegate.h b/app/ios/iosviewdelegate.h index 92e5c4d21..6217884dd 100644 --- a/app/ios/iosviewdelegate.h +++ b/app/ios/iosviewdelegate.h @@ -30,8 +30,8 @@ UINavigationControllerDelegate> IOSImagePicker *handler; BOOL processingPicture; - void ( ^ imagePickerControllerDidFinishPickingMediaWithInfo )( UIImagePickerController * picker, NSDictionary * info ); - void ( ^ imagePickerControllerDidCancel )( UIImagePickerController * picker ); + void ( ^imagePickerControllerDidFinishPickingMediaWithInfo )( UIImagePickerController *picker, NSDictionary *info ); + void ( ^imagePickerControllerDidCancel )( UIImagePickerController *picker ); } - ( id ) initWithHandler:( IOSImagePicker * )handler; @end diff --git a/app/layer/layerdetaildata.cpp b/app/layer/layerdetaildata.cpp index 321f6c4e3..6945c6cd7 100644 --- a/app/layer/layerdetaildata.cpp +++ b/app/layer/layerdetaildata.cpp @@ -81,7 +81,7 @@ void LayerDetailData::setLayerTreeNode( QgsLayerTreeNode *newLayerTreeNode ) emit mapLayerChanged( nodeLayer->layer() ); // listen on visibility change - connect( mLayerTreeNode, &QgsLayerTreeNode::visibilityChanged, this, [this]( QgsLayerTreeNode * node ) + connect( mLayerTreeNode, &QgsLayerTreeNode::visibilityChanged, this, [this]( QgsLayerTreeNode *node ) { if ( node && node == mLayerTreeNode && node->isVisible() != this->isVisible() ) { diff --git a/app/layer/layertreeflatsortfiltermodel.cpp b/app/layer/layertreeflatsortfiltermodel.cpp index 794c76621..c89260d74 100644 --- a/app/layer/layertreeflatsortfiltermodel.cpp +++ b/app/layer/layertreeflatsortfiltermodel.cpp @@ -40,7 +40,7 @@ bool LayerTreeFlatSortFilterModel::filterAcceptsRow( int source_row, const QMode if ( layer ) { - bool isPrivate = layer->flags() & QgsMapLayer::LayerFlag::Private; + bool isPrivate = layer->flags() &QgsMapLayer::LayerFlag::Private; if ( isPrivate ) { diff --git a/app/layer/layertreesortfiltermodel.cpp b/app/layer/layertreesortfiltermodel.cpp index c261c3373..5db8e7028 100644 --- a/app/layer/layertreesortfiltermodel.cpp +++ b/app/layer/layertreesortfiltermodel.cpp @@ -34,7 +34,7 @@ bool LayerTreeSortFilterModel::filterAcceptsRow( int source_row, const QModelInd if ( layer ) { - bool isPrivate = layer->flags() & QgsMapLayer::LayerFlag::Private; + bool isPrivate = layer->flags() &QgsMapLayer::LayerFlag::Private; if ( isPrivate ) { diff --git a/app/layersproxymodel.cpp b/app/layersproxymodel.cpp index 6ad74f336..f8b7b50f4 100644 --- a/app/layersproxymodel.cpp +++ b/app/layersproxymodel.cpp @@ -22,7 +22,7 @@ LayersProxyModel::LayersProxyModel( LayersModel *model, LayerModelTypes modelTyp switch ( mModelType ) { case ActiveLayerSelection: - filterFunction = [this]( QgsMapLayer * layer ) { return recordingAllowed( layer ); }; + filterFunction = [this]( QgsMapLayer *layer ) { return recordingAllowed( layer ); }; break; default: filterFunction = []( QgsMapLayer * ) { return true; }; diff --git a/app/main.cpp b/app/main.cpp index 877a653b6..581a9bb33 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -465,7 +465,7 @@ int main( int argc, char *argv[] ) // there seem to be issues with HTTP/2 server support (QTBUG-111417) // so let's stick to HTTP/1 for the time being (Qt5 has HTTP/2 disabled by default) - QgsNetworkAccessManager::instance()->setRequestPreprocessor( []( QNetworkRequest * r ) + QgsNetworkAccessManager::instance()->setRequestPreprocessor( []( QNetworkRequest *r ) { r->setAttribute( QNetworkRequest::Http2AllowedAttribute, false ); } ); @@ -499,7 +499,7 @@ int main( int argc, char *argv[] ) // build position kit, save active provider to QSettings and load previously active provider PositionKit pk; - QObject::connect( &pk, &PositionKit::positionProviderChanged, &as, [&as]( AbstractPositionProvider * provider ) + QObject::connect( &pk, &PositionKit::positionProviderChanged, &as, [ &as]( AbstractPositionProvider *provider ) { as.setActivePositionProviderId( provider ? provider->id() : QLatin1String() ); } ); @@ -527,52 +527,52 @@ int main( int argc, char *argv[] ) CoreUtils::log( QStringLiteral( "AppState" ), QStringLiteral( "Application has quit" ) ); } ); - QObject::connect( &help, &InputHelp::submitReportSuccessful, &lambdaContext, [¬ificationModel]() + QObject::connect( &help, &InputHelp::submitReportSuccessful, &lambdaContext, [ ¬ificationModel]() { notificationModel.addSuccess( QObject::tr( "Report submitted. Please contact us on %1" ).arg( InputHelp::helpdeskMail() ) ); } ); - QObject::connect( &help, &InputHelp::submitReportFailed, &lambdaContext, [¬ificationModel]() + QObject::connect( &help, &InputHelp::submitReportFailed, &lambdaContext, [ ¬ificationModel]() { notificationModel.addError( QObject::tr( "Failed to submit report. Please check your internet connection." ) ); } ); - QObject::connect( &pw, &ProjectWizard::notifySuccess, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( &pw, &ProjectWizard::notifySuccess, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addSuccess( message ); } ); - QObject::connect( &iosUtils, &IosUtils::notifyError, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( &iosUtils, &IosUtils::notifyError, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addError( message ); } ); - QObject::connect( &androidUtils, &AndroidUtils::notifyInfo, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( &androidUtils, &AndroidUtils::notifyInfo, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addInfo( message ); } ); - QObject::connect( &androidUtils, &AndroidUtils::notifyError, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( &androidUtils, &AndroidUtils::notifyError, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addError( message ); } ); - QObject::connect( &activeProject, &ActiveProject::syncActiveProject, &syncManager, [&syncManager]( const LocalProject & project ) + QObject::connect( &activeProject, &ActiveProject::syncActiveProject, &syncManager, [ &syncManager]( const LocalProject &project ) { syncManager.syncProject( project, SyncOptions::Authorized, SyncOptions::Retry ); } ); - QObject::connect( ma.get(), &MerginApi::notifyInfo, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( ma.get(), &MerginApi::notifyInfo, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addInfo( message ); } ); - QObject::connect( ma.get(), &MerginApi::notifySuccess, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( ma.get(), &MerginApi::notifySuccess, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addSuccess( message ); } ); - QObject::connect( ma.get(), &MerginApi::notifyError, &lambdaContext, [¬ificationModel]( const QString & message ) + QObject::connect( ma.get(), &MerginApi::notifyError, &lambdaContext, [ ¬ificationModel]( const QString &message ) { notificationModel.addError( message ); } ); @@ -581,7 +581,7 @@ int main( int argc, char *argv[] ) QObject::connect( &pw, &ProjectWizard::projectCreated, &localProjectsManager, &LocalProjectsManager::addLocalProject ); QObject::connect( &activeProject, &ActiveProject::projectReloaded, vm.get(), &VariablesManager::merginProjectChanged ); QObject::connect( &activeProject, &ActiveProject::projectWillBeReloaded, &inputProjUtils, &InputProjUtils::resetHandlers ); - QObject::connect( &syncManager, &SynchronizationManager::syncFinished, &activeProject, [&activeProject]( const QString & projectFullName, bool successfully, int version, bool reloadNeeded ) + QObject::connect( &syncManager, &SynchronizationManager::syncFinished, &activeProject, [ &activeProject]( const QString &projectFullName, bool successfully, int version, bool reloadNeeded ) { Q_UNUSED( successfully ); Q_UNUSED( version ); diff --git a/app/map/inputmapcanvasmap.cpp b/app/map/inputmapcanvasmap.cpp index e5a62b8ae..70b4f845a 100644 --- a/app/map/inputmapcanvasmap.cpp +++ b/app/map/inputmapcanvasmap.cpp @@ -71,8 +71,8 @@ void InputMapCanvasMap::zoom( QPointF center, qreal scale ) QgsPoint oldCenter( extent.center() ); QgsPoint mousePos( mMapSettings->screenToCoordinate( center ) ); - QgsPointXY newCenter( mousePos.x() + ( ( oldCenter.x() - mousePos.x() ) * scale ), - mousePos.y() + ( ( oldCenter.y() - mousePos.y() ) * scale ) ); + QgsPointXY newCenter( mousePos.x() + ( ( oldCenter.x() - mousePos.x() ) *scale ), + mousePos.y() + ( ( oldCenter.y() - mousePos.y() ) *scale ) ); // same as zoomWithCenter (no coordinate transformations are needed) extent.scale( scale, &newCenter ); @@ -382,11 +382,11 @@ QSGNode *InputMapCanvasMap::updatePaintNode( QSGNode *oldNode, QQuickItem::Updat { if ( qgsDoubleNear( rect.height(), mImage.height() ) ) { - rect.setHeight( rect.width() / size.width() * size.height() ); + rect.setHeight( rect.width() / size.width() *size.height() ); } else { - rect.setWidth( rect.height() / size.height() * size.width() ); + rect.setWidth( rect.height() / size.height() *size.width() ); } } @@ -515,7 +515,7 @@ void InputMapCanvasMap::clearTemporalCache() invalidateLabels = true; } - if ( layer->temporalProperties()->flags() & QgsTemporalProperty::FlagDontInvalidateCachedRendersWhenRangeChanges ) + if ( layer->temporalProperties()->flags() &QgsTemporalProperty::FlagDontInvalidateCachedRendersWhenRangeChanges ) continue; mCache->invalidateCacheForLayer( layer ); diff --git a/app/map/inputmapsettings.cpp b/app/map/inputmapsettings.cpp index a529313e3..69987be89 100644 --- a/app/map/inputmapsettings.cpp +++ b/app/map/inputmapsettings.cpp @@ -165,8 +165,8 @@ QSize InputMapSettings::outputSize() const void InputMapSettings::setOutputSize( QSize outputSize ) { - outputSize.setWidth( outputSize.width() * devicePixelRatio() ); - outputSize.setHeight( outputSize.height() * devicePixelRatio() ); + outputSize.setWidth( outputSize.width() *devicePixelRatio() ); + outputSize.setHeight( outputSize.height() *devicePixelRatio() ); if ( mMapSettings.outputSize() == outputSize ) return; diff --git a/app/maptools/recordingmaptool.cpp b/app/maptools/recordingmaptool.cpp index 61db8c8e1..9ecfdd277 100644 --- a/app/maptools/recordingmaptool.cpp +++ b/app/maptools/recordingmaptool.cpp @@ -572,7 +572,7 @@ void RecordingMapTool::onPositionChanged() { double factor = QgsUnitTypes::fromUnitToUnitFactor( Qgis::DistanceUnit::Degrees, Qgis::DistanceUnit::Meters ); double distance = mLastRecordedPoint.distance( mPositionKit->positionCoordinate() ); - if ( mLastRecordedPoint.isEmpty() || factor * distance >= mRecordingInterval ) + if ( mLastRecordedPoint.isEmpty() || factor *distance >= mRecordingInterval ) { addPoint( QgsPoint() ); // addPoint will take point from GPS } @@ -1102,7 +1102,7 @@ void RecordingMapTool::updateVertex( const Vertex &vertex, const QgsPoint &point return; } - if ( vertex.isValid() && !InputUtils::equals( point, vertex.coordinates(), 1e-8 ) ) + if ( vertex.isValid() && !InputUtils::equals( point, vertex.coordinates(), 1e - 8 ) ) { mActiveLayer->beginEditCommand( QStringLiteral( "Move vertex" ) ); if ( mRecordedGeometry.get()->moveVertex( vertex.vertexId(), point ) ) @@ -1138,12 +1138,12 @@ void RecordingMapTool::cancelGrab() double RecordingMapTool::pixelsToMapUnits( double numPixels ) { QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings()->mapSettings() ); - return numPixels * context.scaleFactor() * context.mapToPixel().mapUnitsPerPixel(); + return numPixels *context.scaleFactor() * context.mapToPixel().mapUnitsPerPixel(); } bool RecordingMapTool::shouldBeVisible( const QgsPoint point ) { - return !mActiveVertex.isValid() || !InputUtils::equals( point, mActiveVertex.coordinates(), 1e-16 ); + return !mActiveVertex.isValid() || !InputUtils::equals( point, mActiveVertex.coordinates(), 1e - 16 ); } void RecordingMapTool::grabNextVertex() @@ -1305,8 +1305,8 @@ QgsPoint RecordingMapTool::handlePoint( QgsPoint p1, QgsPoint p2 ) da.setEllipsoid( QStringLiteral( "WGS84" ) ); da.setSourceCrs( mActiveLayer->crs(), mapSettings()->transformContext() ); double d = da.convertLengthMeasurement( da.measureLine( QgsPointXY( p1 ), QgsPointXY( p2 ) ), mActiveLayer->crs().mapUnits() ); - double x = ( ( p2.x() - p1.x() ) * ( d + h * factor ) / d ) + p1.x(); - double y = ( ( p2.y() - p1.y() ) * ( d + h * factor ) / d ) + p1.y(); + double x = ( ( p2.x() - p1.x() ) * ( d + h *factor ) / d ) + p1.x(); + double y = ( ( p2.y() - p1.y() ) * ( d + h *factor ) / d ) + p1.y(); return QgsPoint( x, y ); } diff --git a/app/mmstyle.h b/app/mmstyle.h index 0b548ad7f..cc48259ee 100644 --- a/app/mmstyle.h +++ b/app/mmstyle.h @@ -729,7 +729,7 @@ class MMStyle: public QObject QFont fontFactory( int pixelSize, bool bold ) { QFont f; - f.setPixelSize( pixelSize * mDp ); + f.setPixelSize( pixelSize *mDp ); if ( bold ) { diff --git a/app/position/providers/simulatedpositionprovider.cpp b/app/position/providers/simulatedpositionprovider.cpp index 75287127d..d0247a132 100644 --- a/app/position/providers/simulatedpositionprovider.cpp +++ b/app/position/providers/simulatedpositionprovider.cpp @@ -75,8 +75,8 @@ void SimulatedPositionProvider::generateNextPosition() void SimulatedPositionProvider::generateRadiusPosition() { double latitude = mLatitude, longitude = mLongitude; - latitude += sin( mAngle * M_PI / 180 ) * mFlightRadius; - longitude += cos( mAngle * M_PI / 180 ) * mFlightRadius; + latitude += sin( mAngle *M_PI / 180 ) * mFlightRadius; + longitude += cos( mAngle *M_PI / 180 ) * mFlightRadius; mAngle += 1; GeoPosition position; diff --git a/app/position/tracking/positiontrackingmanager.cpp b/app/position/tracking/positiontrackingmanager.cpp index 6bd7332a7..4469e3d10 100644 --- a/app/position/tracking/positiontrackingmanager.cpp +++ b/app/position/tracking/positiontrackingmanager.cpp @@ -195,7 +195,7 @@ void PositionTrackingManager::setup() } else { - mTrackingBackend->setNotifyFunction( [ = ]( const QgsPoint & p ) { this->addPoint( p ); } ); + mTrackingBackend->setNotifyFunction( [ = ]( const QgsPoint &p ) { this->addPoint( p ); } ); } connect( mTrackingBackend.get(), &AbstractTrackingBackend::errorOccured, this, &PositionTrackingManager::trackingErrorOccured ); diff --git a/app/projectsmodel.cpp b/app/projectsmodel.cpp index 71b6e62a2..847576ecd 100644 --- a/app/projectsmodel.cpp +++ b/app/projectsmodel.cpp @@ -277,7 +277,7 @@ void ProjectsModel::mergeProjects( const MerginProjectsList &merginProjects, Mer Project project; project.local = localProject; - const auto res = std::find_if( merginProjects.begin(), merginProjects.end(), [&project]( const MerginProject & me ) + const auto res = std::find_if( merginProjects.begin(), merginProjects.end(), [ &project]( const MerginProject &me ) { return ( project.id() == me.id() ); } ); @@ -306,7 +306,7 @@ void ProjectsModel::mergeProjects( const MerginProjectsList &merginProjects, Mer for ( const QString &pendingProjectName : pendingProjects ) { - const auto &match = std::find_if( mProjects.begin(), mProjects.end(), [&pendingProjectName]( const Project & mp ) + const auto &match = std::find_if( mProjects.begin(), mProjects.end(), [ &pendingProjectName]( const Project &mp ) { return ( mp.id() == pendingProjectName ); } ); @@ -331,7 +331,7 @@ void ProjectsModel::mergeProjects( const MerginProjectsList &merginProjects, Mer Project project; project.mergin = remoteEntry; - const auto match = std::find_if( localProjects.begin(), localProjects.end(), [&project]( const LocalProject & le ) + const auto match = std::find_if( localProjects.begin(), localProjects.end(), [ &project]( const LocalProject &le ) { return ( project.id() == le.id() ); } ); diff --git a/app/scalebarkit.cpp b/app/scalebarkit.cpp index 89323611c..4a84ff05a 100644 --- a/app/scalebarkit.cpp +++ b/app/scalebarkit.cpp @@ -107,8 +107,8 @@ void ScaleBarKit::updateScaleBar() else round_digit = 5; - mDistance = int( round_digit * base ); - mWidth = int( mPreferredWidth * mDistance / dist ); + mDistance = int( round_digit *base ); + mWidth = int( mPreferredWidth *mDistance / dist ); emit scaleBarChanged(); } diff --git a/app/snaputils.cpp b/app/snaputils.cpp index 919d45f0c..0ff1947cd 100644 --- a/app/snaputils.cpp +++ b/app/snaputils.cpp @@ -272,7 +272,7 @@ void SnapUtils::setupSnapping() QgsSnappingConfig config = mQgsProject->snappingConfig(); if ( config.units() == Qgis::MapToolUnit::Pixels ) { - config.setTolerance( config.tolerance() * InputUtils::calculateDpRatio() ); + config.setTolerance( config.tolerance() *InputUtils::calculateDpRatio() ); } mSnappingUtils.setConfig( config ); break; diff --git a/app/test/testposition.cpp b/app/test/testposition.cpp index 379edf25c..1a831846c 100644 --- a/app/test/testposition.cpp +++ b/app/test/testposition.cpp @@ -67,7 +67,7 @@ void TestPosition::simulatedPosition() QVERIFY( hasPositionChanged ); QVERIFY( positionKit->hasPosition() ); - COMPARENEAR( positionKit->positionCoordinate().y(), 38.93, 1e-4 ); + COMPARENEAR( positionKit->positionCoordinate().y(), 38.93, 1e - 4 ); QVERIFY( positionKit->horizontalAccuracy() >= 0 ); QVERIFY( positionKit->satellitesVisible() >= 0 ); QVERIFY( positionKit->satellitesUsed() >= 0 ); @@ -83,7 +83,7 @@ void TestPosition::simulatedPosition() QVERIFY( hasPositionChanged ); QVERIFY( positionKit->hasPosition() ); - COMPARENEAR( positionKit->positionCoordinate().y(), 33.93, 1e-4 ); + COMPARENEAR( positionKit->positionCoordinate().y(), 33.93, 1e - 4 ); positionKit->stopUpdates(); diff --git a/app/test/testutilsfunctions.cpp b/app/test/testutilsfunctions.cpp index 603d8e319..48afb5451 100644 --- a/app/test/testutilsfunctions.cpp +++ b/app/test/testutilsfunctions.cpp @@ -94,12 +94,12 @@ void TestUtilsFunctions::screenUnitsToMeters() void TestUtilsFunctions::transformedPointXY() { QgsPointXY pointXY = mUtils->pointXY( 49.9, 16.3 ); - COMPARENEAR( pointXY.x(), 49.9, 1e-4 ); - COMPARENEAR( pointXY.y(), 16.3, 1e-4 ); + COMPARENEAR( pointXY.x(), 49.9, 1e - 4 ); + COMPARENEAR( pointXY.y(), 16.3, 1e - 4 ); QgsPoint point = mUtils->point( 1.0, -1.0 ); - COMPARENEAR( point.x(), 1.0, 1e-4 ); - COMPARENEAR( point.y(), -1.0, 1e-4 ); + COMPARENEAR( point.x(), 1.0, 1e - 4 ); + COMPARENEAR( point.y(), -1.0, 1e - 4 ); QgsCoordinateReferenceSystem crs3857 = QgsCoordinateReferenceSystem::fromEpsgId( 3857 ); QVERIFY( crs3857.authid() == "EPSG:3857" ); @@ -123,15 +123,15 @@ void TestUtilsFunctions::transformedPointXY() ); QVERIFY( !transformedPoint.isEmpty() ); - COMPARENEAR( transformedPoint.x(), 49.9, 1e-4 ); - COMPARENEAR( transformedPoint.y(), 16.3, 1e-4 ); + COMPARENEAR( transformedPoint.x(), 49.9, 1e - 4 ); + COMPARENEAR( transformedPoint.y(), 16.3, 1e - 4 ); } void TestUtilsFunctions::transformedPoint() { QgsPoint point = mUtils->point( 49.9, 16.3 ); - COMPARENEAR( point.x(), 49.9, 1e-4 ); - COMPARENEAR( point.y(), 16.3, 1e-4 ); + COMPARENEAR( point.x(), 49.9, 1e - 4 ); + COMPARENEAR( point.y(), 16.3, 1e - 4 ); QgsCoordinateReferenceSystem crs3857 = QgsCoordinateReferenceSystem::fromEpsgId( 3857 ); QVERIFY( crs3857.authid() == "EPSG:3857" ); @@ -155,8 +155,8 @@ void TestUtilsFunctions::transformedPoint() ); QVERIFY( !transformedPoint.isEmpty() ); - COMPARENEAR( transformedPoint.x(), 49.9, 1e-4 ); - COMPARENEAR( transformedPoint.y(), 16.3, 1e-4 ); + COMPARENEAR( transformedPoint.x(), 49.9, 1e - 4 ); + COMPARENEAR( transformedPoint.y(), 16.3, 1e - 4 ); } void TestUtilsFunctions::formatPoint() diff --git a/core/merginapi.cpp b/core/merginapi.cpp index 781c8e990..68cd227af 100644 --- a/core/merginapi.cpp +++ b/core/merginapi.cpp @@ -556,7 +556,7 @@ void MerginApi::pushFile( const QString &projectFullName, const QString &transac if ( f.open( QIODevice::ReadOnly ) ) { - f.seek( chunkNo * UPLOAD_CHUNK_SIZE ); + f.seek( chunkNo *UPLOAD_CHUNK_SIZE ); data = f.read( UPLOAD_CHUNK_SIZE ); } @@ -2412,7 +2412,7 @@ void MerginApi::startProjectPull( const QString &projectFullName ) // work with parallel downloads std::sort( transaction.downloadQueue.begin(), transaction.downloadQueue.end(), - []( const DownloadQueueItem & a, const DownloadQueueItem & b ) { return a.size > b.size; } + []( const DownloadQueueItem &a, const DownloadQueueItem &b ) { return a.size > b.size; } ); CoreUtils::log( "pull " + projectFullName, QStringLiteral( "%1 update tasks, %2 items to download (total size %3 bytes)" ) @@ -2442,7 +2442,7 @@ void MerginApi::prepareDownloadConfig( const QString &projectFullName, bool down MerginProjectMetadata newServerVersion = MerginProjectMetadata::fromJson( transaction.projectMetadata ); - const auto res = std::find_if( newServerVersion.files.begin(), newServerVersion.files.end(), []( const MerginFile & file ) + const auto res = std::find_if( newServerVersion.files.begin(), newServerVersion.files.end(), []( const MerginFile &file ) { return file.path == sMerginConfigFile; } ); @@ -2459,7 +2459,7 @@ void MerginApi::prepareDownloadConfig( const QString &projectFullName, bool down MerginProjectMetadata oldServerVersion = MerginProjectMetadata::fromCachedJson( transaction.projectDir + "/" + sMetadataFile ); - const auto resOld = std::find_if( oldServerVersion.files.begin(), oldServerVersion.files.end(), []( const MerginFile & file ) + const auto resOld = std::find_if( oldServerVersion.files.begin(), oldServerVersion.files.end(), []( const MerginFile &file ) { return file.path == sMerginConfigFile; } ); diff --git a/gallery/hotreload.cpp b/gallery/hotreload.cpp index a6025c2d4..63997751b 100644 --- a/gallery/hotreload.cpp +++ b/gallery/hotreload.cpp @@ -86,7 +86,7 @@ void HotReload::startHotReload() _watcher->addPath( "HotReload/app/qml/settings/components" ); // send signal for hot reloading - connect( _watcher, &QFileSystemWatcher::directoryChanged, this, [this]( const QString & path ) + connect( _watcher, &QFileSystemWatcher::directoryChanged, this, [this]( const QString &path ) { emit watchedSourceChanged(); } );