From 038036d021a8a38c6a77973e223cdfa7490955b0 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 7 Feb 2025 09:02:02 +1000 Subject: [PATCH] Use "auto" for std::unique_ptr = std::make_unique Refs https://github.com/qgis/QGIS-Enhancement-Proposals/pull/319 --- .../geometry/qgsmultipoint.sip.in | 2 +- .../auto_generated/qgsfeatureiterator.sip.in | 2 +- .../auto_generated/qgsspatialindex.sip.in | 2 +- .../geometry/qgsmultipoint.sip.in | 2 +- .../auto_generated/qgsfeatureiterator.sip.in | 2 +- .../auto_generated/qgsspatialindex.sip.in | 2 +- scripts/qstringfixup.py | 8 + src/3d/mesh/qgsmesh3dmaterial_p.cpp | 2 +- src/3d/qgs3dmapsettings.cpp | 6 +- src/3d/qgs3dutils.cpp | 2 +- src/3d/symbols/qgsline3dsymbol.cpp | 2 +- src/3d/symbols/qgsmesh3dsymbol.cpp | 2 +- src/3d/symbols/qgspolygon3dsymbol.cpp | 2 +- src/3d/terrain/qgs3dterrainregistry.cpp | 8 +- src/3d/terrain/qgsdemterrainsettings.cpp | 2 +- src/3d/terrain/qgsflatterrainsettings.cpp | 2 +- src/3d/terrain/qgsmeshterrainsettings.cpp | 4 +- .../terrain/qgsonlinedemterrainsettings.cpp | 2 +- .../qgsquantizedmeshterrainsettings.cpp | 2 +- .../georeferencing/qgsgcptransformer.cpp | 8 +- .../interpolation/qgsgridfilewriter.cpp | 2 +- src/analysis/mesh/qgsmeshcontours.cpp | 8 +- .../pdal/qgsalgorithmpdaldensity.cpp | 4 +- .../pdal/qgsalgorithmpdalexportraster.cpp | 4 +- .../pdal/qgsalgorithmpdalexportrastertin.cpp | 4 +- .../pdal/qgsalgorithmpdalreproject.cpp | 2 +- .../processing/pdal/qgsalgorithmpdaltile.cpp | 2 +- .../processing/pdal/qgspdalalgorithmbase.cpp | 4 +- .../qgsalgorithmaddincrementalfield.cpp | 6 +- .../processing/qgsalgorithmaddtablefield.cpp | 2 +- .../qgsalgorithmaffinetransform.cpp | 18 +- .../qgsalgorithmarrayoffsetlines.cpp | 4 +- .../qgsalgorithmarraytranslatedfeatures.cpp | 10 +- .../qgsalgorithmcalculateexpression.cpp | 2 +- .../qgsalgorithmcalculateoverlaps.cpp | 2 +- .../qgsalgorithmcategorizeusingstyle.cpp | 4 +- .../processing/qgsalgorithmcellstatistics.cpp | 6 +- .../processing/qgsalgorithmcentroid.cpp | 2 +- .../qgsalgorithmcheckgeometryangle.cpp | 2 +- .../qgsalgorithmcheckgeometryarea.cpp | 2 +- .../qgsalgorithmcheckgeometryhole.cpp | 2 +- ...qgsalgorithmcheckgeometrymissingvertex.cpp | 2 +- .../processing/qgsalgorithmconstantraster.cpp | 4 +- .../qgsalgorithmconverttocurves.cpp | 4 +- .../qgsalgorithmcoveragesimplify.cpp | 2 +- .../qgsalgorithmcoveragevalidate.cpp | 2 +- .../qgsalgorithmdelaunaytriangulation.cpp | 2 +- .../qgsalgorithmdensifygeometriesbycount.cpp | 2 +- ...gsalgorithmdensifygeometriesbyinterval.cpp | 2 +- .../qgsalgorithmdetectdatasetchanges.cpp | 2 +- .../processing/qgsalgorithmdifference.cpp | 2 +- .../processing/qgsalgorithmdissolve.cpp | 2 +- .../qgsalgorithmdownloadvectortiles.cpp | 2 +- src/analysis/processing/qgsalgorithmdrape.cpp | 2 +- .../processing/qgsalgorithmdxfexport.cpp | 6 +- .../processing/qgsalgorithmexplode.cpp | 8 +- .../processing/qgsalgorithmexportmesh.cpp | 6 +- .../qgsalgorithmexporttopostgresql.cpp | 2 +- .../processing/qgsalgorithmextendlines.cpp | 4 +- .../processing/qgsalgorithmextractlabels.cpp | 4 +- .../qgsalgorithmfieldcalculator.cpp | 10 +- .../processing/qgsalgorithmfiledownloader.cpp | 4 +- .../processing/qgsalgorithmfillnodata.cpp | 4 +- .../processing/qgsalgorithmfixgeometries.cpp | 2 +- .../qgsalgorithmfixgeometryangle.cpp | 4 +- .../qgsalgorithmfixgeometryarea.cpp | 4 +- .../qgsalgorithmfixgeometryhole.cpp | 4 +- .../qgsalgorithmfixgeometrymissingvertex.cpp | 4 +- .../processing/qgsalgorithmfuzzifyraster.cpp | 16 +- .../qgsalgorithmgenerateelevationprofile.cpp | 8 +- .../processing/qgsalgorithmgltftovector.cpp | 4 +- .../processing/qgsalgorithmgpsbabeltools.cpp | 10 +- src/analysis/processing/qgsalgorithmgrid.cpp | 6 +- .../processing/qgsalgorithmhttprequest.cpp | 10 +- .../processing/qgsalgorithmimportphotos.cpp | 4 +- .../qgsalgorithminterpolatepoint.cpp | 2 +- .../processing/qgsalgorithmintersection.cpp | 4 +- .../qgsalgorithmjoinbyattribute.cpp | 2 +- .../processing/qgsalgorithmjoinbylocation.cpp | 2 +- .../qgsalgorithmjoinbylocationsummary.cpp | 4 +- .../processing/qgsalgorithmjoinbynearest.cpp | 2 +- .../processing/qgsalgorithmjoinwithlines.cpp | 4 +- .../qgsalgorithmkeepnbiggestparts.cpp | 2 +- .../qgsalgorithmlayoutatlastoimage.cpp | 12 +- .../qgsalgorithmlayoutatlastopdf.cpp | 20 +- .../processing/qgsalgorithmlayouttoimage.cpp | 10 +- .../processing/qgsalgorithmlayouttopdf.cpp | 22 +- .../processing/qgsalgorithmlinedensity.cpp | 4 +- .../qgsalgorithmlineintersection.cpp | 2 +- .../processing/qgsalgorithmlinesubstring.cpp | 4 +- .../qgsalgorithmmeshsurfacetopolygon.cpp | 2 +- .../qgsalgorithmmultiintersection.cpp | 2 +- .../qgsalgorithmmultiringconstantbuffer.cpp | 4 +- .../processing/qgsalgorithmmultiunion.cpp | 2 +- .../qgsalgorithmnetworkanalysisbase.cpp | 14 +- .../processing/qgsalgorithmoffsetlines.cpp | 2 +- .../processing/qgsalgorithmorthogonalize.cpp | 2 +- .../processing/qgsalgorithmpackage.cpp | 2 +- ...qgsalgorithmpixelcentroidsfrompolygons.cpp | 2 +- .../processing/qgsalgorithmpointonsurface.cpp | 2 +- .../qgsalgorithmpointsalonggeometry.cpp | 6 +- .../qgsalgorithmprojectpointcartesian.cpp | 6 +- .../qgsalgorithmrandompointsextent.cpp | 2 +- .../qgsalgorithmrandompointsinpolygons.cpp | 12 +- .../qgsalgorithmrandompointsonlines.cpp | 12 +- .../processing/qgsalgorithmrandomraster.cpp | 30 +- .../qgsalgorithmrastercalculator.cpp | 6 +- .../qgsalgorithmrasterdtmslopebasedfilter.cpp | 14 +- ...thmrasterfrequencybycomparisonoperator.cpp | 8 +- .../qgsalgorithmrasterlogicalop.cpp | 6 +- .../qgsalgorithmrasterstackposition.cpp | 6 +- .../qgsalgorithmrasterzonalstats.cpp | 2 +- .../qgsalgorithmreclassifybylayer.cpp | 10 +- .../qgsalgorithmrectanglesovalsdiamonds.cpp | 2 +- .../processing/qgsalgorithmrefactorfields.cpp | 2 +- .../qgsalgorithmremoveduplicatevertices.cpp | 4 +- .../processing/qgsalgorithmremoveholes.cpp | 2 +- .../qgsalgorithmrepairshapefile.cpp | 2 +- .../processing/qgsalgorithmrescaleraster.cpp | 4 +- .../processing/qgsalgorithmrotate.cpp | 4 +- .../qgsalgorithmroundrastervalues.cpp | 4 +- .../processing/qgsalgorithmsavefeatures.cpp | 4 +- .../processing/qgsalgorithmsegmentize.cpp | 4 +- .../qgsalgorithmserviceareafromlayer.cpp | 10 +- .../qgsalgorithmserviceareafrompoint.cpp | 8 +- .../qgsalgorithmshortestpathlayertopoint.cpp | 2 +- .../qgsalgorithmshortestpathpointtolayer.cpp | 2 +- .../processing/qgsalgorithmsimplify.cpp | 2 +- .../processing/qgsalgorithmsmooth.cpp | 6 +- .../processing/qgsalgorithmsnapgeometries.cpp | 2 +- .../processing/qgsalgorithmsnaptogrid.cpp | 8 +- .../qgsalgorithmsplitlinesbylength.cpp | 2 +- .../qgsalgorithmsplitvectorlayer.cpp | 2 +- .../processing/qgsalgorithmsubdivide.cpp | 2 +- .../qgsalgorithmsymmetricaldifference.cpp | 4 +- .../processing/qgsalgorithmtaperedbuffer.cpp | 8 +- .../qgsalgorithmtinmeshcreation.cpp | 2 +- .../processing/qgsalgorithmtransect.cpp | 4 +- .../processing/qgsalgorithmtranslate.cpp | 8 +- src/analysis/processing/qgsalgorithmunion.cpp | 4 +- .../qgsalgorithmuniquevalueindex.cpp | 4 +- .../qgsalgorithmvirtualrastercalculator.cpp | 6 +- .../qgsalgorithmvoronoipolygons.cpp | 2 +- .../processing/qgsalgorithmwedgebuffers.cpp | 10 +- .../qgsalgorithmwritevectortiles.cpp | 2 +- .../processing/qgsalgorithmxyztiles.cpp | 6 +- .../processing/qgsbookmarkalgorithms.cpp | 4 +- .../processing/qgsrasteranalysisutils.cpp | 2 +- .../processing/qgsreclassifyutils.cpp | 2 +- src/analysis/raster/qgsrastercalcnode.cpp | 4 +- .../geometry_checker/qgsgeometrygapcheck.cpp | 2 +- .../qgsgeometrymissingvertexcheck.cpp | 4 +- .../qgsgeometryselfintersectioncheck.cpp | 6 +- src/app/3d/qgs3danimationwidget.cpp | 2 +- src/app/3d/qgs3dmapconfigwidget.cpp | 8 +- src/app/3d/qgsgoochmaterialwidget.cpp | 2 +- src/app/3d/qgsline3dsymbolwidget.cpp | 2 +- src/app/3d/qgsmetalroughmaterialwidget.cpp | 2 +- src/app/3d/qgsphongmaterialwidget.cpp | 2 +- src/app/3d/qgsphongtexturedmaterialwidget.cpp | 2 +- src/app/3d/qgspoint3dsymbolwidget.cpp | 2 +- src/app/3d/qgspolygon3dsymbolwidget.cpp | 2 +- src/app/3d/qgssimplelinematerialwidget.cpp | 2 +- src/app/decorations/qgsdecorationscalebar.cpp | 12 +- .../networklogger/qgsnetworklogger.cpp | 2 +- .../networklogger/qgsnetworkloggernode.cpp | 16 +- .../querylogger/qgsappquerylogger.cpp | 2 +- .../qgsdatabasequeryloggernode.cpp | 2 +- .../elevation/qgselevationprofilewidget.cpp | 16 +- src/app/georeferencer/qgsgeorefmainwindow.cpp | 10 +- src/app/gps/qgsappgpslogging.cpp | 4 +- src/app/layers/qgsapplayerhandling.cpp | 8 +- src/app/layout/qgslayoutdesignerdialog.cpp | 34 +-- src/app/layout/qgslayoutimagedrophandler.cpp | 4 +- src/app/layout/qgslayoutmanagerdialog.cpp | 6 +- .../qgsreportfieldgroupsectionwidget.cpp | 6 +- .../layout/qgsreportlayoutsectionwidget.cpp | 2 +- src/app/layout/qgsreportorganizerwidget.cpp | 4 +- src/app/layout/qgsreportsectionwidget.cpp | 4 +- src/app/mesh/qgsmaptooleditmeshframe.cpp | 2 +- src/app/mesh/qgsnewmeshlayerdialog.cpp | 2 +- src/app/pluginmanager/qgspluginmanager.cpp | 2 +- src/app/qgisapp.cpp | 8 +- src/app/qgsattributetabledialog.cpp | 2 +- src/app/qgslayertreeviewembeddedindicator.cpp | 2 +- src/app/qgslayertreeviewindicatorprovider.cpp | 2 +- src/app/qgsmaptooladdfeature.cpp | 2 +- src/app/qgsstatisticalsummarydockwidget.cpp | 2 +- src/app/qgstemplateprojectsmodel.cpp | 2 +- src/core/annotations/qgsannotationlayer.cpp | 2 +- .../qgsannotationlayerrenderer.cpp | 2 +- .../annotations/qgsannotationlineitem.cpp | 2 +- .../annotations/qgsannotationlinetextitem.cpp | 2 +- src/core/annotations/qgsannotationmanager.cpp | 8 +- .../annotations/qgsannotationmarkeritem.cpp | 2 +- .../annotations/qgsannotationpictureitem.cpp | 2 +- .../qgsannotationpointtextitem.cpp | 2 +- .../annotations/qgsannotationpolygonitem.cpp | 2 +- .../qgsannotationrectangletextitem.cpp | 2 +- .../browser/qgsfilebaseddataitemprovider.cpp | 6 +- src/core/browser/qgszipitem.cpp | 2 +- src/core/callouts/qgscallout.cpp | 8 +- .../qgsclassificationcustom.cpp | 2 +- .../qgsclassificationequalinterval.cpp | 2 +- .../qgsclassificationfixedinterval.cpp | 4 +- .../classification/qgsclassificationjenks.cpp | 2 +- .../qgsclassificationlogarithmic.cpp | 2 +- .../qgsclassificationprettybreaks.cpp | 2 +- .../qgsclassificationquantile.cpp | 2 +- .../qgsclassificationstandarddeviation.cpp | 2 +- src/core/effects/qgsimageoperation.cpp | 2 +- src/core/elevation/qgsprofilerenderer.cpp | 4 +- .../expression/qgsexpressioncontextutils.cpp | 2 +- src/core/expression/qgsexpressionfunction.cpp | 2 +- src/core/expression/qgsexpressionnodeimpl.cpp | 4 +- .../qgshttpexternalstorage.cpp | 2 +- src/core/geometry/qgscircularstring.cpp | 2 +- src/core/geometry/qgscompoundcurve.cpp | 22 +- src/core/geometry/qgscurvepolygon.cpp | 2 +- src/core/geometry/qgsgeometry.cpp | 270 +++++++++--------- src/core/geometry/qgsgeometrycollection.cpp | 2 +- src/core/geometry/qgsgeometryfactory.cpp | 10 +- src/core/geometry/qgsgeos.cpp | 2 +- .../geometry/qgsinternalgeometryengine.cpp | 30 +- src/core/geometry/qgsmulticurve.cpp | 2 +- src/core/geometry/qgsmultilinestring.cpp | 4 +- src/core/geometry/qgsmultipoint.h | 2 +- src/core/geometry/qgsmultipolygon.cpp | 2 +- src/core/geometry/qgsmultisurface.cpp | 2 +- src/core/geometry/qgspolyhedralsurface.cpp | 8 +- src/core/geometry/qgsquadrilateral.cpp | 4 +- src/core/geometry/qgstriangulatedsurface.cpp | 2 +- src/core/gps/qgsgpsdetector.cpp | 2 +- src/core/labeling/qgslabelingengine.cpp | 2 +- src/core/labeling/qgslabelsearchtree.cpp | 6 +- src/core/labeling/qgspallabeling.cpp | 4 +- .../labeling/qgsvectorlayerlabelprovider.cpp | 4 +- .../rules/qgslabelingenginerule_impl.cpp | 8 +- src/core/layertree/qgslayertreegroup.cpp | 2 +- src/core/layertree/qgslayertreemodel.cpp | 2 +- .../layertree/qgslayertreemodellegendnode.cpp | 2 +- src/core/layout/qgsabstractreportsection.cpp | 4 +- src/core/layout/qgscompositionconverter.cpp | 8 +- src/core/layout/qgslayout.cpp | 2 +- .../layout/qgslayoutitemattributetable.cpp | 2 +- src/core/layout/qgslayoutitemscalebar.cpp | 12 +- src/core/layout/qgslayoutmanager.cpp | 4 +- src/core/layout/qgslayoutmultiframe.cpp | 4 +- src/core/layout/qgslayoutpagecollection.cpp | 4 +- src/core/layout/qgslayouttable.cpp | 8 +- src/core/layout/qgsprintlayout.cpp | 2 +- src/core/layout/qgsreport.cpp | 2 +- .../layout/qgsreportsectionfieldgroup.cpp | 4 +- src/core/layout/qgsreportsectionlayout.cpp | 4 +- src/core/maprenderer/qgsmaprendererjob.cpp | 8 +- src/core/mesh/qgsmeshcalculator.cpp | 2 +- src/core/mesh/qgsmesheditor.cpp | 2 +- .../mesh/qgsmeshlayerelevationproperties.cpp | 6 +- src/core/mesh/qgsmeshlayerinterpolator.cpp | 4 +- src/core/mesh/qgsmeshvirtualdatasetgroup.cpp | 2 +- src/core/mesh/qgstriangularmesh.cpp | 2 +- .../network/qgsblockingnetworkrequest.cpp | 2 +- .../numericformats/qgsbasicnumericformat.cpp | 2 +- .../qgsbearingnumericformat.cpp | 2 +- .../qgscoordinatenumericformat.cpp | 2 +- .../qgscurrencynumericformat.cpp | 2 +- .../qgsexpressionbasednumericformat.cpp | 2 +- .../qgsfractionnumericformat.cpp | 2 +- .../qgspercentagenumericformat.cpp | 2 +- .../qgsscientificnumericformat.cpp | 2 +- src/core/painting/qgsgeometrypaintdevice.cpp | 4 +- src/core/pal/feature.cpp | 10 +- src/core/pal/layer.cpp | 8 +- src/core/pal/pal.cpp | 8 +- src/core/pal/pointset.cpp | 2 +- src/core/plot/qgsplot.cpp | 8 +- src/core/pointcloud/qgseptdecoder.cpp | 10 +- src/core/pointcloud/qgslazdecoder.cpp | 18 +- .../qgspointcloudattributebyramprenderer.cpp | 6 +- .../qgspointcloudclassifiedrenderer.cpp | 6 +- .../pointcloud/qgspointclouddataprovider.cpp | 2 +- .../qgspointcloudextentrenderer.cpp | 6 +- .../qgspointcloudlayerelevationproperties.cpp | 2 +- .../qgspointcloudrendererregistry.cpp | 6 +- .../pointcloud/qgspointcloudrgbrenderer.cpp | 6 +- src/core/processing/qgsprocessingutils.cpp | 18 +- src/core/project/qgsproject.cpp | 2 +- .../providers/arcgis/qgsarcgisrestutils.cpp | 52 ++-- src/core/providers/gdal/qgsgdalprovider.cpp | 6 +- .../providers/ogr/qgsgeopackagedataitems.cpp | 4 +- .../providers/qgsprovidersublayermodel.cpp | 2 +- src/core/qgsabstractgeopdfexporter.cpp | 4 +- src/core/qgsdatadefinedsizelegend.cpp | 2 +- src/core/qgsdiagramrenderer.cpp | 6 +- src/core/qgsdistancearea.cpp | 2 +- src/core/qgsfeatureiterator.h | 2 +- src/core/qgsgrouplayer.cpp | 2 +- src/core/qgsjsonutils.cpp | 10 +- src/core/qgslocaldefaultsettings.cpp | 4 +- src/core/qgsmaphittest.cpp | 4 +- src/core/qgsmaplayermodel.cpp | 2 +- src/core/qgsmaptopixelgeometrysimplifier.cpp | 24 +- src/core/qgsogrutils.cpp | 22 +- src/core/qgsrunprocess.cpp | 2 +- src/core/qgsruntimeprofiler.cpp | 10 +- src/core/qgsspatialindex.h | 2 +- src/core/qgstemporalnavigationobject.cpp | 2 +- src/core/qgstessellator.cpp | 2 +- src/core/raster/qgscolorrampshader.cpp | 2 +- src/core/raster/qgshillshaderenderer.cpp | 2 +- src/core/raster/qgspalettedrasterrenderer.cpp | 2 +- src/core/raster/qgsrasterattributetable.cpp | 2 +- src/core/raster/qgsrasterdataprovider.cpp | 6 +- src/core/raster/qgsrasterlabeling.cpp | 16 +- src/core/raster/qgsrasterlayer.cpp | 6 +- .../qgsrasterlayerelevationproperties.cpp | 6 +- src/core/raster/qgsrasterprojector.cpp | 2 +- src/core/raster/qgsrasterrendererregistry.cpp | 2 +- src/core/raster/qgssinglebandgrayrenderer.cpp | 2 +- .../scalebar/qgsdoubleboxscalebarrenderer.cpp | 4 +- .../scalebar/qgshollowscalebarrenderer.cpp | 4 +- .../scalebar/qgssingleboxscalebarrenderer.cpp | 4 +- src/core/stac/qgsstacparser.cpp | 34 +-- src/core/symbology/qgs25drenderer.cpp | 2 +- .../symbology/qgsembeddedsymbolrenderer.cpp | 2 +- src/core/symbology/qgsfillsymbollayer.cpp | 48 ++-- .../qgsgeometrygeneratorsymbollayer.cpp | 2 +- .../symbology/qgsgraduatedsymbolrenderer.cpp | 4 +- src/core/symbology/qgsheatmaprenderer.cpp | 2 +- .../symbology/qgsinvertedpolygonrenderer.cpp | 4 +- .../qgslinearreferencingsymbollayer.cpp | 8 +- src/core/symbology/qgslinesymbollayer.cpp | 18 +- .../symbology/qgsmapinfosymbolconverter.cpp | 56 ++-- src/core/symbology/qgsmarkersymbollayer.cpp | 8 +- .../symbology/qgsmergedfeaturerenderer.cpp | 4 +- src/core/symbology/qgsnullsymbolrenderer.cpp | 2 +- src/core/symbology/qgsrulebasedrenderer.cpp | 14 +- src/core/symbology/qgsstyle.cpp | 10 +- src/core/symbology/qgssvgcache.cpp | 4 +- src/core/symbology/qgssymbollayerutils.cpp | 2 +- .../textrenderer/qgstextrendererutils.cpp | 2 +- .../tiledscene/qgscesiumtilesdataprovider.cpp | 4 +- .../qgstiledsceneboundingvolume.cpp | 4 +- .../qgstiledscenelayerelevationproperties.cpp | 2 +- .../qgstiledscenetexturerenderer.cpp | 4 +- .../qgstiledscenewireframerenderer.cpp | 4 +- src/core/vector/qgsfielddomain.cpp | 6 +- src/core/vector/qgsvectorlayer.cpp | 2 +- .../qgsvectorlayerelevationproperties.cpp | 8 +- .../vector/qgsvectorlayerfeatureiterator.cpp | 2 +- .../vector/qgsvectorlayerprofilegenerator.cpp | 18 +- src/core/vector/qgsvectorlayerrenderer.cpp | 2 +- .../qgsvectorlayerselectionproperties.cpp | 2 +- .../vectortile/qgsmapboxglstyleconverter.cpp | 4 +- .../qgscreateannotationitemmaptool_impl.cpp | 16 +- src/gui/codeeditors/qgscodeeditorpython.cpp | 2 +- .../editorwidgets/qgsvaluemapconfigdlg.cpp | 2 +- .../labeling/qgslabelingenginerulewidget.cpp | 8 +- .../labeling/qgsrulebasedlabelingwidget.cpp | 2 +- .../layout/qgslayoutattributetablewidget.cpp | 2 +- src/gui/layout/qgslayoutguiutils.cpp | 38 +-- src/gui/layout/qgslayoutmanualtablewidget.cpp | 2 +- ...ointcloudattributebyramprendererwidget.cpp | 2 +- .../qgspointcloudclassifiedrendererwidget.cpp | 2 +- .../qgspointcloudextentrendererwidget.cpp | 2 +- .../qgspointcloudrgbrendererwidget.cpp | 2 +- .../models/qgsmodeldesignerdialog.cpp | 14 +- .../qgsmodeldesignerinputstreewidget.cpp | 2 +- .../models/qgsmodelgraphicsscene.cpp | 4 +- .../qgsprocessingmeshdatasetwidget.cpp | 4 +- .../qgsprocessingmultipleselectiondialog.cpp | 2 +- .../qgsprocessingoutputdestinationwidget.cpp | 2 +- .../processing/qgsprocessingtoolboxmodel.cpp | 14 +- .../processing/qgsprocessingwidgetwrapper.cpp | 6 +- src/gui/proj/qgscoordinateoperationwidget.cpp | 2 +- .../qgscoordinatereferencesystemmodel.cpp | 10 +- src/gui/proj/qgscrsdefinitionwidget.cpp | 2 +- .../providers/ogr/qgsogrdbsourceselect.cpp | 2 +- src/gui/qgsattributeform.cpp | 2 +- src/gui/qgsfieldmappingmodel.cpp | 2 +- src/gui/qgslayermetadataresultsmodel.cpp | 4 +- src/gui/qgsmasksourceselectionwidget.cpp | 2 +- src/gui/qgsnewgeopackagelayerdialog.cpp | 2 +- src/gui/qgsvaliditycheckresultswidget.cpp | 4 +- .../qgsloadrasterattributetabledialog.cpp | 2 +- src/gui/raster/qgsrasterlabelingwidget.cpp | 4 +- .../qgscategorizedsymbolrendererwidget.cpp | 2 +- .../symbology/qgslayerpropertieswidget.cpp | 6 +- .../qgstiledscenetexturerendererwidget.cpp | 2 +- .../qgstiledscenewireframerendererwidget.cpp | 2 +- src/gui/vector/qgsdiagramproperties.cpp | 6 +- src/gui/vector/qgsfieldcalculator.cpp | 2 +- .../vector/qgsstackeddiagramproperties.cpp | 4 +- .../qgsarcgisrestdataitemguiprovider.cpp | 2 +- .../arcgisrest/qgsarcgisrestdataitems.cpp | 22 +- .../mssql/qgsmssqlfeatureiterator.cpp | 2 +- .../mssql/qgsmssqlgeometryparser.cpp | 16 +- src/providers/mssql/qgsmssqlprovider.cpp | 2 +- .../mssql/qgsmssqlproviderconnection.cpp | 2 +- src/providers/mssql/qgsmssqlsourceselect.cpp | 2 +- .../oracle/qgsoracleproviderconnection.cpp | 4 +- src/providers/postgres/qgspostgresconn.cpp | 8 +- .../postgres/qgspostgresprovider.cpp | 2 +- .../qgspostgresproviderconnection.cpp | 2 +- .../raster/qgspostgresrastershareddata.cpp | 4 +- .../qgsspatialiteproviderconnection.cpp | 2 +- .../qgsvirtualrasterprovider.cpp | 2 +- src/providers/wfs/oapif/qgsoapifprovider.cpp | 2 +- src/providers/wfs/qgsbasenetworkrequest.cpp | 2 +- src/providers/wfs/qgswfsprovider.cpp | 2 +- src/providers/wfs/qgswfsprovidermetadata.cpp | 2 +- src/server/services/wms/qgsdxfwriter.cpp | 2 +- src/server/services/wms/qgswmsrenderer.cpp | 6 +- tests/src/3d/testqgs3drendering.cpp | 12 +- tests/src/analysis/testqgsgeometrysnapper.cpp | 26 +- tests/src/analysis/testqgsinterpolator.cpp | 4 +- tests/src/analysis/testqgsnetworkanalysis.cpp | 30 +- tests/src/analysis/testqgsprocessing.cpp | 20 +- .../src/analysis/testqgsprocessingalgspt1.cpp | 174 +++++------ .../src/analysis/testqgsprocessingalgspt2.cpp | 106 +++---- .../analysis/testqgsprocessingfixgeometry.cpp | 8 +- .../testqgsprocessingmodelalgorithm.cpp | 4 +- .../analysis/testqgsprocessingpdalalgs.cpp | 32 +-- .../src/analysis/testqgsrastercalculator.cpp | 6 +- tests/src/analysis/testqgsreclassifyutils.cpp | 2 +- tests/src/analysis/testqgstriangulation.cpp | 10 +- tests/src/analysis/testqgszonalstatistics.cpp | 6 +- tests/src/app/testqgisappclipboard.cpp | 2 +- tests/src/app/testqgsattributetable.cpp | 8 +- tests/src/app/testqgsidentify.cpp | 8 +- .../src/app/testqgslayerpropertiesdialogs.cpp | 28 +- tests/src/app/testqgsmaptooleditmesh.cpp | 16 +- tests/src/app/testqgsmaptoollabel.cpp | 12 +- tests/src/app/testqgsprojectproperties.cpp | 12 +- .../geometry/testqgspolyhedralsurface.cpp | 2 +- tests/src/core/testqgscallout.cpp | 4 +- tests/src/core/testqgsclipper.cpp | 2 +- tests/src/core/testqgscolorschemeregistry.cpp | 2 +- .../src/core/testqgscompositionconverter.cpp | 2 +- tests/src/core/testqgsdataitem.cpp | 6 +- tests/src/core/testqgsdxfexport.cpp | 52 ++-- tests/src/core/testqgsexpression.cpp | 2 +- tests/src/core/testqgsexpressioncontext.cpp | 2 +- tests/src/core/testqgsgdalprovider.cpp | 4 +- tests/src/core/testqgsgeopdfexport.cpp | 2 +- .../core/testqgsinvertedpolygonrenderer.cpp | 2 +- tests/src/core/testqgslabelingengine.cpp | 4 +- tests/src/core/testqgslayertree.cpp | 2 +- tests/src/core/testqgslayoutgeopdfexport.cpp | 6 +- tests/src/core/testqgslayoutitem.cpp | 14 +- tests/src/core/testqgslayoutmanualtable.cpp | 2 +- tests/src/core/testqgslayoutmap.cpp | 4 +- tests/src/core/testqgslayoutpage.cpp | 6 +- tests/src/core/testqgslayoutscalebar.cpp | 66 ++--- tests/src/core/testqgslayoutshapes.cpp | 6 +- tests/src/core/testqgslayouttable.cpp | 8 +- tests/src/core/testqgslegendrenderer.cpp | 8 +- tests/src/core/testqgslinefillsymbol.cpp | 20 +- tests/src/core/testqgsmaplayer.cpp | 6 +- .../src/core/testqgsmaplayerstylemanager.cpp | 4 +- tests/src/core/testqgsmaprendererjob.cpp | 54 ++-- tests/src/core/testqgsmapsettings.cpp | 8 +- tests/src/core/testqgsmesheditor.cpp | 8 +- tests/src/core/testqgsmeshlayer.cpp | 14 +- .../src/core/testqgsmeshlayerinterpolator.cpp | 2 +- tests/src/core/testqgsogrprovider.cpp | 4 +- tests/src/core/testqgspainteffect.cpp | 2 +- tests/src/core/testqgspointcloudediting.cpp | 14 +- .../core/testqgspointpatternfillsymbol.cpp | 26 +- tests/src/core/testqgsproject.cpp | 32 +-- tests/src/core/testqgsrasterfilewriter.cpp | 12 +- tests/src/core/testqgsrasterlayer.cpp | 32 +-- tests/src/core/testqgsrenderers.cpp | 6 +- tests/src/core/testqgsrulebasedrenderer.cpp | 68 ++--- tests/src/core/testqgsspatialindex.cpp | 2 +- tests/src/core/testqgsspatialindexkdbush.cpp | 6 +- .../core/testqgssqliteexpressioncompiler.cpp | 2 +- tests/src/core/testqgsvectorlayerutils.cpp | 2 +- tests/src/core/testqgsvectortilelayer.cpp | 16 +- .../testqgsgeometrychecks.cpp | 2 +- .../testqgsvectorlayerfeaturepool.cpp | 2 +- tests/src/gui/testprocessinggui.cpp | 110 +++---- tests/src/gui/testqgsattributeform.cpp | 2 +- .../gui/testqgscategorizedrendererwidget.cpp | 12 +- tests/src/gui/testqgsmapcanvas.cpp | 14 +- tests/src/gui/testqgsmaptooledit.cpp | 6 +- tests/src/gui/testqgsmaskingwidget.cpp | 2 +- .../gui/testqgsmeshlayerpropertiesdialog.cpp | 2 +- tests/src/gui/testqgsrangewidgetwrapper.cpp | 2 +- tests/src/gui/testqgsrubberband.cpp | 12 +- tests/src/gui/testqgstableeditor.cpp | 24 +- .../src/gui/testqgsvaluemapwidgetwrapper.cpp | 2 +- .../gui/testqgsvaluerelationwidgetwrapper.cpp | 4 +- .../providers/grass/testqgsgrassprovider.cpp | 2 +- tests/src/providers/testqgscopcprovider.cpp | 28 +- tests/src/providers/testqgseptprovider.cpp | 22 +- tests/src/providers/testqgspdalprovider.cpp | 4 +- .../testqgsvirtualpointcloudprovider.cpp | 8 +- .../testqgsvirtualrasterprovider.cpp | 18 +- tests/src/providers/testqgswmsprovider.cpp | 2 +- 500 files changed, 1880 insertions(+), 1872 deletions(-) diff --git a/python/PyQt6/core/auto_generated/geometry/qgsmultipoint.sip.in b/python/PyQt6/core/auto_generated/geometry/qgsmultipoint.sip.in index 5fd56c1ab2f0..d6c56daea4f1 100644 --- a/python/PyQt6/core/auto_generated/geometry/qgsmultipoint.sip.in +++ b/python/PyQt6/core/auto_generated/geometry/qgsmultipoint.sip.in @@ -120,7 +120,7 @@ The multipoint Z and M type will be set based on the type of the first point in break; } - std::unique_ptr< QgsPoint > point = std::make_unique< QgsPoint >( x, y ); + auto point = std::make_unique< QgsPoint >( x, y ); if ( elementSize > 2 ) { element = PySequence_GetItem( value, 2 ); diff --git a/python/PyQt6/core/auto_generated/qgsfeatureiterator.sip.in b/python/PyQt6/core/auto_generated/qgsfeatureiterator.sip.in index f77128560fce..a8a2d2890fcc 100644 --- a/python/PyQt6/core/auto_generated/qgsfeatureiterator.sip.in +++ b/python/PyQt6/core/auto_generated/qgsfeatureiterator.sip.in @@ -222,7 +222,7 @@ Wrapper for iterator of features from vector data provider or vector layer SIP_PYOBJECT __next__() /TypeHint="QgsFeature"/; %MethodCode - std::unique_ptr< QgsFeature > f = std::make_unique< QgsFeature >(); + auto f = std::make_unique< QgsFeature >(); bool result = false; Py_BEGIN_ALLOW_THREADS result = ( sipCpp->nextFeature( *f ) ); diff --git a/python/PyQt6/core/auto_generated/qgsspatialindex.sip.in b/python/PyQt6/core/auto_generated/qgsspatialindex.sip.in index 9e3ef92e480c..371168fceff4 100644 --- a/python/PyQt6/core/auto_generated/qgsspatialindex.sip.in +++ b/python/PyQt6/core/auto_generated/qgsspatialindex.sip.in @@ -205,7 +205,7 @@ Geometry is only stored if the QgsSpatialIndex was created with the FlagStoreFea .. versionadded:: 3.6 %End %MethodCode - std::unique_ptr< QgsGeometry > g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); + auto g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); if ( g->isNull() ) { PyErr_SetString( PyExc_KeyError, QStringLiteral( "No geometry with feature id %1 exists in the index." ).arg( a0 ).toUtf8().constData() ); diff --git a/python/core/auto_generated/geometry/qgsmultipoint.sip.in b/python/core/auto_generated/geometry/qgsmultipoint.sip.in index 5fd56c1ab2f0..d6c56daea4f1 100644 --- a/python/core/auto_generated/geometry/qgsmultipoint.sip.in +++ b/python/core/auto_generated/geometry/qgsmultipoint.sip.in @@ -120,7 +120,7 @@ The multipoint Z and M type will be set based on the type of the first point in break; } - std::unique_ptr< QgsPoint > point = std::make_unique< QgsPoint >( x, y ); + auto point = std::make_unique< QgsPoint >( x, y ); if ( elementSize > 2 ) { element = PySequence_GetItem( value, 2 ); diff --git a/python/core/auto_generated/qgsfeatureiterator.sip.in b/python/core/auto_generated/qgsfeatureiterator.sip.in index 2d9ddbea908c..9c958586c3df 100644 --- a/python/core/auto_generated/qgsfeatureiterator.sip.in +++ b/python/core/auto_generated/qgsfeatureiterator.sip.in @@ -222,7 +222,7 @@ Wrapper for iterator of features from vector data provider or vector layer SIP_PYOBJECT __next__() /TypeHint="QgsFeature"/; %MethodCode - std::unique_ptr< QgsFeature > f = std::make_unique< QgsFeature >(); + auto f = std::make_unique< QgsFeature >(); bool result = false; Py_BEGIN_ALLOW_THREADS result = ( sipCpp->nextFeature( *f ) ); diff --git a/python/core/auto_generated/qgsspatialindex.sip.in b/python/core/auto_generated/qgsspatialindex.sip.in index 03799f08936e..53e32de3fcc4 100644 --- a/python/core/auto_generated/qgsspatialindex.sip.in +++ b/python/core/auto_generated/qgsspatialindex.sip.in @@ -205,7 +205,7 @@ Geometry is only stored if the QgsSpatialIndex was created with the FlagStoreFea .. versionadded:: 3.6 %End %MethodCode - std::unique_ptr< QgsGeometry > g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); + auto g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); if ( g->isNull() ) { PyErr_SetString( PyExc_KeyError, QStringLiteral( "No geometry with feature id %1 exists in the index." ).arg( a0 ).toUtf8().constData() ); diff --git a/scripts/qstringfixup.py b/scripts/qstringfixup.py index fff0d0446adc..e021351f686d 100644 --- a/scripts/qstringfixup.py +++ b/scripts/qstringfixup.py @@ -93,6 +93,10 @@ r"""(.*)(.startsWith\(|.endsWith\(|.indexOf\(|.lastIndexOf\(|\+=) QLatin1String\( ("[^"]") \)(.*)""" ) +make_unique = re.compile( + r"""^(\s*)std::unique_ptr<\s*(.*?)\s*>(\s*.*?\s*=\s*std::make_unique<\s*(.*?)\s*>.*)$""" +) + def qlatin1char_or_string(x): """x is a double quoted string""" @@ -225,5 +229,9 @@ def qlatin1char_or_string(x): else: break + m = make_unique.match(line) + if m and m.group(2) == m.group(4): + line = m.group(1) + "auto" + m.group(3) + print(line) i += 1 diff --git a/src/3d/mesh/qgsmesh3dmaterial_p.cpp b/src/3d/mesh/qgsmesh3dmaterial_p.cpp index e7880304fc32..67140bef778e 100644 --- a/src/3d/mesh/qgsmesh3dmaterial_p.cpp +++ b/src/3d/mesh/qgsmesh3dmaterial_p.cpp @@ -208,7 +208,7 @@ void QgsMesh3DMaterial::configureArrows( QgsMeshLayer *layer, const QgsDateTimeR QVector vectors( 1 ); QSize gridSize( 1, 1 ); QgsPointXY minCorner; - std::unique_ptr arrowsEnabledParameter = std::make_unique( "arrowsEnabled", nullptr ); + auto arrowsEnabledParameter = std::make_unique( "arrowsEnabled", nullptr ); if ( !layer || mMagnitudeType != MagnitudeType::ScalarDataSet || !mSymbol->arrowsEnabled() || meta.isScalar() || !datasetIndex.isValid() ) arrowsEnabledParameter->setValue( false ); else diff --git a/src/3d/qgs3dmapsettings.cpp b/src/3d/qgs3dmapsettings.cpp index be5af2bd27da..43193c663933 100644 --- a/src/3d/qgs3dmapsettings.cpp +++ b/src/3d/qgs3dmapsettings.cpp @@ -200,7 +200,7 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte QDomElement elemPointLight = elemPointLights.firstChildElement( QStringLiteral( "point-light" ) ); while ( !elemPointLight.isNull() ) { - std::unique_ptr pointLight = std::make_unique(); + auto pointLight = std::make_unique(); pointLight->readXml( elemPointLight, context ); mLightSources << pointLight.release(); elemPointLight = elemPointLight.nextSiblingElement( QStringLiteral( "point-light" ) ); @@ -209,7 +209,7 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte else { // QGIS <= 3.4 did not have light configuration - std::unique_ptr defaultLight = std::make_unique(); + auto defaultLight = std::make_unique(); defaultLight->setPosition( QgsVector3D( 0, 1000, 0 ) ); mLightSources << defaultLight.release(); } @@ -220,7 +220,7 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte QDomElement elemDirectionalLight = elemDirectionalLights.firstChildElement( QStringLiteral( "directional-light" ) ); while ( !elemDirectionalLight.isNull() ) { - std::unique_ptr directionalLight = std::make_unique(); + auto directionalLight = std::make_unique(); directionalLight->readXml( elemDirectionalLight, context ); mLightSources << directionalLight.release(); elemDirectionalLight = elemDirectionalLight.nextSiblingElement( QStringLiteral( "directional-light" ) ); diff --git a/src/3d/qgs3dutils.cpp b/src/3d/qgs3dutils.cpp index db6010839948..053c94586110 100644 --- a/src/3d/qgs3dutils.cpp +++ b/src/3d/qgs3dutils.cpp @@ -813,7 +813,7 @@ std::unique_ptr Qgs3DUtils::convert2DPointCloudRen if ( symbol3D ) { - std::unique_ptr renderer3D = std::make_unique(); + auto renderer3D = std::make_unique(); renderer3D->setSymbol( symbol3D.release() ); return renderer3D; } diff --git a/src/3d/symbols/qgsline3dsymbol.cpp b/src/3d/symbols/qgsline3dsymbol.cpp index 93107c4475e9..57dd1a92fd04 100644 --- a/src/3d/symbols/qgsline3dsymbol.cpp +++ b/src/3d/symbols/qgsline3dsymbol.cpp @@ -31,7 +31,7 @@ QgsLine3DSymbol::~QgsLine3DSymbol() = default; QgsAbstract3DSymbol *QgsLine3DSymbol::clone() const { - std::unique_ptr result = std::make_unique(); + auto result = std::make_unique(); result->mAltClamping = mAltClamping; result->mAltBinding = mAltBinding; result->mWidth = mWidth; diff --git a/src/3d/symbols/qgsmesh3dsymbol.cpp b/src/3d/symbols/qgsmesh3dsymbol.cpp index eaaee4cc8523..f9e57ddece17 100644 --- a/src/3d/symbols/qgsmesh3dsymbol.cpp +++ b/src/3d/symbols/qgsmesh3dsymbol.cpp @@ -28,7 +28,7 @@ QgsMesh3DSymbol::~QgsMesh3DSymbol() = default; QgsMesh3DSymbol *QgsMesh3DSymbol::clone() const { - std::unique_ptr result = std::make_unique(); + auto result = std::make_unique(); result->mAltClamping = mAltClamping; result->mHeight = mHeight; diff --git a/src/3d/symbols/qgspolygon3dsymbol.cpp b/src/3d/symbols/qgspolygon3dsymbol.cpp index 3629b7f2796f..7b25d53af076 100644 --- a/src/3d/symbols/qgspolygon3dsymbol.cpp +++ b/src/3d/symbols/qgspolygon3dsymbol.cpp @@ -35,7 +35,7 @@ QgsPolygon3DSymbol::~QgsPolygon3DSymbol() = default; QgsAbstract3DSymbol *QgsPolygon3DSymbol::clone() const { - std::unique_ptr result = std::make_unique(); + auto result = std::make_unique(); result->mAltClamping = mAltClamping; result->mAltBinding = mAltBinding; result->mOffset = mOffset; diff --git a/src/3d/terrain/qgs3dterrainregistry.cpp b/src/3d/terrain/qgs3dterrainregistry.cpp index cf5e5e9bcb37..e75e4bb29bd4 100644 --- a/src/3d/terrain/qgs3dterrainregistry.cpp +++ b/src/3d/terrain/qgs3dterrainregistry.cpp @@ -76,7 +76,7 @@ QgsAbstractTerrainSettings *Qgs3DTerrainRegistry::configureTerrainFromProject( Q { if ( properties->terrainProvider()->type() == QLatin1String( "flat" ) ) { - std::unique_ptr flatTerrain = std::make_unique(); + auto flatTerrain = std::make_unique(); flatTerrain->setElevationOffset( properties->terrainProvider()->offset() ); return flatTerrain.release(); } @@ -84,7 +84,7 @@ QgsAbstractTerrainSettings *Qgs3DTerrainRegistry::configureTerrainFromProject( Q { QgsRasterDemTerrainProvider *rasterProvider = qgis::down_cast( properties->terrainProvider() ); - std::unique_ptr demTerrain = std::make_unique(); + auto demTerrain = std::make_unique(); demTerrain->setLayer( rasterProvider->layer() ); demTerrain->setElevationOffset( properties->terrainProvider()->offset() ); demTerrain->setVerticalScale( properties->terrainProvider()->scale() ); @@ -94,7 +94,7 @@ QgsAbstractTerrainSettings *Qgs3DTerrainRegistry::configureTerrainFromProject( Q { QgsMeshTerrainProvider *meshProvider = qgis::down_cast( properties->terrainProvider() ); - std::unique_ptr meshTerrain = std::make_unique(); + auto meshTerrain = std::make_unique(); meshTerrain->setLayer( meshProvider->layer() ); meshTerrain->setElevationOffset( properties->terrainProvider()->offset() ); meshTerrain->setVerticalScale( properties->terrainProvider()->scale() ); @@ -102,7 +102,7 @@ QgsAbstractTerrainSettings *Qgs3DTerrainRegistry::configureTerrainFromProject( Q } else { - std::unique_ptr flatTerrain = std::make_unique(); + auto flatTerrain = std::make_unique(); return flatTerrain.release(); } } diff --git a/src/3d/terrain/qgsdemterrainsettings.cpp b/src/3d/terrain/qgsdemterrainsettings.cpp index 980b37f1897a..1ba2072c3c3a 100644 --- a/src/3d/terrain/qgsdemterrainsettings.cpp +++ b/src/3d/terrain/qgsdemterrainsettings.cpp @@ -82,7 +82,7 @@ bool QgsDemTerrainSettings::equals( const QgsAbstractTerrainSettings *other ) co std::unique_ptr QgsDemTerrainSettings::createTerrainGenerator( const Qgs3DRenderContext &context ) const { - std::unique_ptr generator = std::make_unique(); + auto generator = std::make_unique(); generator->setCrs( context.crs(), context.transformContext() ); generator->setExtent( context.extent() ); generator->setLayer( layer() ); diff --git a/src/3d/terrain/qgsflatterrainsettings.cpp b/src/3d/terrain/qgsflatterrainsettings.cpp index c509b2862da6..130181c7c7d0 100644 --- a/src/3d/terrain/qgsflatterrainsettings.cpp +++ b/src/3d/terrain/qgsflatterrainsettings.cpp @@ -54,7 +54,7 @@ bool QgsFlatTerrainSettings::equals( const QgsAbstractTerrainSettings *other ) c std::unique_ptr QgsFlatTerrainSettings::createTerrainGenerator( const Qgs3DRenderContext &context ) const { - std::unique_ptr generator = std::make_unique(); + auto generator = std::make_unique(); generator->setCrs( context.crs(), context.transformContext() ); generator->setExtent( context.extent() ); return generator; diff --git a/src/3d/terrain/qgsmeshterrainsettings.cpp b/src/3d/terrain/qgsmeshterrainsettings.cpp index cdd048b2c2d4..b6ed0171bf4b 100644 --- a/src/3d/terrain/qgsmeshterrainsettings.cpp +++ b/src/3d/terrain/qgsmeshterrainsettings.cpp @@ -32,7 +32,7 @@ QgsMeshTerrainSettings::~QgsMeshTerrainSettings() = default; QgsMeshTerrainSettings *QgsMeshTerrainSettings::clone() const { - std::unique_ptr cloned = std::make_unique(); + auto cloned = std::make_unique(); cloned->mSymbol.reset( mSymbol->clone() ); cloned->mLayer = mLayer; cloned->copyCommonProperties( this ); @@ -97,7 +97,7 @@ bool QgsMeshTerrainSettings::equals( const QgsAbstractTerrainSettings *other ) c std::unique_ptr QgsMeshTerrainSettings::createTerrainGenerator( const Qgs3DRenderContext &context ) const { - std::unique_ptr generator = std::make_unique(); + auto generator = std::make_unique(); generator->setLayer( layer() ); std::unique_ptr symbol( mSymbol->clone() ); symbol->setVerticalScale( verticalScale() ); diff --git a/src/3d/terrain/qgsonlinedemterrainsettings.cpp b/src/3d/terrain/qgsonlinedemterrainsettings.cpp index 0b879707197c..3abaf85e02f0 100644 --- a/src/3d/terrain/qgsonlinedemterrainsettings.cpp +++ b/src/3d/terrain/qgsonlinedemterrainsettings.cpp @@ -76,7 +76,7 @@ bool QgsOnlineDemTerrainSettings::equals( const QgsAbstractTerrainSettings *othe std::unique_ptr QgsOnlineDemTerrainSettings::createTerrainGenerator( const Qgs3DRenderContext &context ) const { - std::unique_ptr generator = std::make_unique(); + auto generator = std::make_unique(); generator->setResolution( mResolution ); generator->setSkirtHeight( static_cast( mSkirtHeight ) ); generator->setCrs( context.crs(), context.transformContext() ); diff --git a/src/3d/terrain/qgsquantizedmeshterrainsettings.cpp b/src/3d/terrain/qgsquantizedmeshterrainsettings.cpp index 3cf46c6bb087..a4b157701a86 100644 --- a/src/3d/terrain/qgsquantizedmeshterrainsettings.cpp +++ b/src/3d/terrain/qgsquantizedmeshterrainsettings.cpp @@ -74,7 +74,7 @@ bool QgsQuantizedMeshTerrainSettings::equals( const QgsAbstractTerrainSettings * std::unique_ptr QgsQuantizedMeshTerrainSettings::createTerrainGenerator( const Qgs3DRenderContext &context ) const { - std::unique_ptr generator = std::make_unique(); + auto generator = std::make_unique(); generator->setLayer( layer() ); generator->setCrs( context.crs(), context.transformContext() ); generator->setExtent( context.extent() ); diff --git a/src/analysis/georeferencing/qgsgcptransformer.cpp b/src/analysis/georeferencing/qgsgcptransformer.cpp index 132d7afae1b3..ad6bd7b8f5b0 100644 --- a/src/analysis/georeferencing/qgsgcptransformer.cpp +++ b/src/analysis/georeferencing/qgsgcptransformer.cpp @@ -118,7 +118,7 @@ bool QgsLinearGeorefTransform::getOriginScale( QgsPointXY &origin, double &scale QgsGcpTransformerInterface *QgsLinearGeorefTransform::clone() const { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->mParameters = mParameters; return res.release(); } @@ -234,7 +234,7 @@ bool QgsHelmertGeorefTransform::getOriginScaleRotation( QgsPointXY &origin, doub QgsGcpTransformerInterface *QgsHelmertGeorefTransform::clone() const { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->mHelmertParameters = mHelmertParameters; return res.release(); } @@ -329,7 +329,7 @@ QgsGDALGeorefTransform::~QgsGDALGeorefTransform() QgsGcpTransformerInterface *QgsGDALGeorefTransform::clone() const { - std::unique_ptr res = std::make_unique( mIsTPSTransform, mPolynomialOrder ); + auto res = std::make_unique( mIsTPSTransform, mPolynomialOrder ); res->updateParametersFromGcps( mSourceCoords, mDestCoordinates, mInvertYAxis ); return res.release(); } @@ -436,7 +436,7 @@ QgsProjectiveGeorefTransform::QgsProjectiveGeorefTransform() QgsGcpTransformerInterface *QgsProjectiveGeorefTransform::clone() const { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->mParameters = mParameters; return res.release(); } diff --git a/src/analysis/interpolation/qgsgridfilewriter.cpp b/src/analysis/interpolation/qgsgridfilewriter.cpp index 38bc26b429a2..2b17a766c5fd 100644 --- a/src/analysis/interpolation/qgsgridfilewriter.cpp +++ b/src/analysis/interpolation/qgsgridfilewriter.cpp @@ -42,7 +42,7 @@ int QgsGridFileWriter::writeFile( QgsFeedback *feedback ) QgsInterpolator::LayerData ld = mInterpolator->layerData().at( 0 ); const QgsCoordinateReferenceSystem crs = ld.source->sourceCrs(); - std::unique_ptr writer = std::make_unique( mOutputFilePath ); + auto writer = std::make_unique( mOutputFilePath ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); writer->setOutputFormat( outputFormat ); diff --git a/src/analysis/mesh/qgsmeshcontours.cpp b/src/analysis/mesh/qgsmeshcontours.cpp index 8ecc7febad2e..d07784ff10dc 100644 --- a/src/analysis/mesh/qgsmeshcontours.cpp +++ b/src/analysis/mesh/qgsmeshcontours.cpp @@ -137,8 +137,8 @@ QgsGeometry QgsMeshContours::exportPolygons( double min_value, double max_value, { QVector ring = coords; ring.push_back( coords[0] ); - std::unique_ptr ext = std::make_unique( coords ); - std::unique_ptr poly = std::make_unique(); + auto ext = std::make_unique( coords ); + auto poly = std::make_unique(); poly->setExteriorRing( ext.release() ); multiPolygon.push_back( QgsGeometry( std::move( poly ) ) ); continue; @@ -236,8 +236,8 @@ QgsGeometry QgsMeshContours::exportPolygons( double min_value, double max_value, // add if the polygon is not degraded if ( ring.size() > 2 ) { - std::unique_ptr ext = std::make_unique( ring ); - std::unique_ptr poly = std::make_unique(); + auto ext = std::make_unique( ring ); + auto poly = std::make_unique(); poly->setExteriorRing( ext.release() ); multiPolygon.push_back( QgsGeometry( std::move( poly ) ) ); } diff --git a/src/analysis/processing/pdal/qgsalgorithmpdaldensity.cpp b/src/analysis/processing/pdal/qgsalgorithmpdaldensity.cpp index 498a989104ab..da767cdf1b20 100644 --- a/src/analysis/processing/pdal/qgsalgorithmpdaldensity.cpp +++ b/src/analysis/processing/pdal/qgsalgorithmpdaldensity.cpp @@ -65,10 +65,10 @@ void QgsPdalDensityAlgorithm::initAlgorithm( const QVariantMap & ) createCommonParameters(); - std::unique_ptr paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); paramOriginX->setFlags( paramOriginX->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginX.release() ); - std::unique_ptr paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); + auto paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); paramOriginY->setFlags( paramOriginY->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginY.release() ); diff --git a/src/analysis/processing/pdal/qgsalgorithmpdalexportraster.cpp b/src/analysis/processing/pdal/qgsalgorithmpdalexportraster.cpp index 1ea89c316434..fe6a6b419a89 100644 --- a/src/analysis/processing/pdal/qgsalgorithmpdalexportraster.cpp +++ b/src/analysis/processing/pdal/qgsalgorithmpdalexportraster.cpp @@ -66,10 +66,10 @@ void QgsPdalExportRasterAlgorithm::initAlgorithm( const QVariantMap & ) createCommonParameters(); - std::unique_ptr paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); paramOriginX->setFlags( paramOriginX->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginX.release() ); - std::unique_ptr paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); + auto paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); paramOriginY->setFlags( paramOriginY->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginY.release() ); diff --git a/src/analysis/processing/pdal/qgsalgorithmpdalexportrastertin.cpp b/src/analysis/processing/pdal/qgsalgorithmpdalexportrastertin.cpp index fe614283142d..73d3be04f007 100644 --- a/src/analysis/processing/pdal/qgsalgorithmpdalexportrastertin.cpp +++ b/src/analysis/processing/pdal/qgsalgorithmpdalexportrastertin.cpp @@ -65,10 +65,10 @@ void QgsPdalExportRasterTinAlgorithm::initAlgorithm( const QVariantMap & ) createCommonParameters(); - std::unique_ptr paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto paramOriginX = std::make_unique( QStringLiteral( "ORIGIN_X" ), QObject::tr( "X origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); paramOriginX->setFlags( paramOriginX->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginX.release() ); - std::unique_ptr paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); + auto paramOriginY = std::make_unique( QStringLiteral( "ORIGIN_Y" ), QObject::tr( "Y origin of a tile for parallel runs" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 0 ); paramOriginY->setFlags( paramOriginY->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramOriginY.release() ); diff --git a/src/analysis/processing/pdal/qgsalgorithmpdalreproject.cpp b/src/analysis/processing/pdal/qgsalgorithmpdalreproject.cpp index 5989793147ae..726b2167de7c 100644 --- a/src/analysis/processing/pdal/qgsalgorithmpdalreproject.cpp +++ b/src/analysis/processing/pdal/qgsalgorithmpdalreproject.cpp @@ -62,7 +62,7 @@ void QgsPdalReprojectAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterPointCloudLayer( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterCrs( QStringLiteral( "CRS" ), QObject::tr( "Target CRS" ), QStringLiteral( "EPSG:4326" ) ) ); - std::unique_ptr crsOpParam = std::make_unique( QStringLiteral( "OPERATION" ), QObject::tr( "Coordinate operation" ), QVariant(), QStringLiteral( "INPUT" ), QStringLiteral( "CRS" ), QVariant(), QVariant(), true ); + auto crsOpParam = std::make_unique( QStringLiteral( "OPERATION" ), QObject::tr( "Coordinate operation" ), QVariant(), QStringLiteral( "INPUT" ), QStringLiteral( "CRS" ), QVariant(), QVariant(), true ); crsOpParam->setFlags( crsOpParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( crsOpParam.release() ); diff --git a/src/analysis/processing/pdal/qgsalgorithmpdaltile.cpp b/src/analysis/processing/pdal/qgsalgorithmpdaltile.cpp index e44d6d1193e8..ff7dc7d44be8 100644 --- a/src/analysis/processing/pdal/qgsalgorithmpdaltile.cpp +++ b/src/analysis/processing/pdal/qgsalgorithmpdaltile.cpp @@ -63,7 +63,7 @@ void QgsPdalTileAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "LAYERS" ), QObject::tr( "Input layers" ), Qgis::ProcessingSourceType::PointCloud ) ); addParameter( new QgsProcessingParameterNumber( QStringLiteral( "LENGTH" ), QObject::tr( "Tile length" ), Qgis::ProcessingNumberParameterType::Double, 1000.0, false, 1 ) ); - std::unique_ptr paramCrs = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Assign CRS" ), QVariant(), true ); + auto paramCrs = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Assign CRS" ), QVariant(), true ); paramCrs->setFlags( paramCrs->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramCrs.release() ); diff --git a/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp b/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp index dcb51ffb3418..061d5204ac8a 100644 --- a/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp +++ b/src/analysis/processing/pdal/qgspdalalgorithmbase.cpp @@ -57,11 +57,11 @@ QString QgsPdalAlgorithmBase::wrenchExecutableBinary() const void QgsPdalAlgorithmBase::createCommonParameters() { - std::unique_ptr filterParam = std::make_unique( QStringLiteral( "FILTER_EXPRESSION" ), QObject::tr( "Filter expression" ), QVariant(), QStringLiteral( "INPUT" ), true, Qgis::ExpressionType::PointCloud ); + auto filterParam = std::make_unique( QStringLiteral( "FILTER_EXPRESSION" ), QObject::tr( "Filter expression" ), QVariant(), QStringLiteral( "INPUT" ), true, Qgis::ExpressionType::PointCloud ); filterParam->setFlags( filterParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( filterParam.release() ); - std::unique_ptr extentParam = std::make_unique( QStringLiteral( "FILTER_EXTENT" ), QObject::tr( "Cropping extent" ), QVariant(), true ); + auto extentParam = std::make_unique( QStringLiteral( "FILTER_EXTENT" ), QObject::tr( "Cropping extent" ), QVariant(), true ); extentParam->setFlags( extentParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( extentParam.release() ); } diff --git a/src/analysis/processing/qgsalgorithmaddincrementalfield.cpp b/src/analysis/processing/qgsalgorithmaddincrementalfield.cpp index f1b75b5dfd42..c59b33a2dc5f 100644 --- a/src/analysis/processing/qgsalgorithmaddincrementalfield.cpp +++ b/src/analysis/processing/qgsalgorithmaddincrementalfield.cpp @@ -86,13 +86,13 @@ void QgsAddIncrementalFieldAlgorithm::initParameters( const QVariantMap & ) addParameter( new QgsProcessingParameterField( QStringLiteral( "GROUP_FIELDS" ), QObject::tr( "Group values by" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Any, true, true ) ); // sort params - std::unique_ptr sortExp = std::make_unique( QStringLiteral( "SORT_EXPRESSION" ), QObject::tr( "Sort expression" ), QVariant(), QStringLiteral( "INPUT" ), true ); + auto sortExp = std::make_unique( QStringLiteral( "SORT_EXPRESSION" ), QObject::tr( "Sort expression" ), QVariant(), QStringLiteral( "INPUT" ), true ); sortExp->setFlags( sortExp->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( sortExp.release() ); - std::unique_ptr sortAscending = std::make_unique( QStringLiteral( "SORT_ASCENDING" ), QObject::tr( "Sort ascending" ), true ); + auto sortAscending = std::make_unique( QStringLiteral( "SORT_ASCENDING" ), QObject::tr( "Sort ascending" ), true ); sortAscending->setFlags( sortAscending->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( sortAscending.release() ); - std::unique_ptr sortNullsFirst = std::make_unique( QStringLiteral( "SORT_NULLS_FIRST" ), QObject::tr( "Sort nulls first" ), false ); + auto sortNullsFirst = std::make_unique( QStringLiteral( "SORT_NULLS_FIRST" ), QObject::tr( "Sort nulls first" ), false ); sortNullsFirst->setFlags( sortNullsFirst->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( sortNullsFirst.release() ); } diff --git a/src/analysis/processing/qgsalgorithmaddtablefield.cpp b/src/analysis/processing/qgsalgorithmaddtablefield.cpp index c176e13c2323..5564423842bc 100644 --- a/src/analysis/processing/qgsalgorithmaddtablefield.cpp +++ b/src/analysis/processing/qgsalgorithmaddtablefield.cpp @@ -99,7 +99,7 @@ void QgsAddTableFieldAlgorithm::initParameters( const QVariantMap & ) icons << QgsFields::iconForFieldType( type.first, type.second ); } - std::unique_ptr fieldTypes = std::make_unique( QStringLiteral( "FIELD_TYPE" ), QObject::tr( "Field type" ), typeStrings, false, 0 ); + auto fieldTypes = std::make_unique( QStringLiteral( "FIELD_TYPE" ), QObject::tr( "Field type" ), typeStrings, false, 0 ); fieldTypes->setMetadata( { QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "icons" ), icons } } ) } } ) } diff --git a/src/analysis/processing/qgsalgorithmaffinetransform.cpp b/src/analysis/processing/qgsalgorithmaffinetransform.cpp index adc8d6b05a58..e90b70f45e93 100644 --- a/src/analysis/processing/qgsalgorithmaffinetransform.cpp +++ b/src/analysis/processing/qgsalgorithmaffinetransform.cpp @@ -70,55 +70,55 @@ QgsAffineTransformationAlgorithm *QgsAffineTransformationAlgorithm::createInstan void QgsAffineTransformationAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Translation (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Translation (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); xOffset->setIsDynamic( true ); xOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_X" ), QObject::tr( "Offset distance (x-axis)" ), QgsPropertyDefinition::Double ) ); xOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( xOffset.release() ); - std::unique_ptr yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Translation (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Translation (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); yOffset->setIsDynamic( true ); yOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Y" ), QObject::tr( "Offset distance (y-axis)" ), QgsPropertyDefinition::Double ) ); yOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( yOffset.release() ); - std::unique_ptr zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Translation (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Translation (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); zOffset->setIsDynamic( true ); zOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Z" ), QObject::tr( "Offset distance (z-axis)" ), QgsPropertyDefinition::Double ) ); zOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( zOffset.release() ); - std::unique_ptr mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Translation (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Translation (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); mOffset->setIsDynamic( true ); mOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_M" ), QObject::tr( "Offset distance (m values)" ), QgsPropertyDefinition::Double ) ); mOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( mOffset.release() ); - std::unique_ptr xScale = std::make_unique( QStringLiteral( "SCALE_X" ), QObject::tr( "Scale factor (x-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); + auto xScale = std::make_unique( QStringLiteral( "SCALE_X" ), QObject::tr( "Scale factor (x-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); xScale->setIsDynamic( true ); xScale->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SCALE_X" ), QObject::tr( "Scale factor (x-axis)" ), QgsPropertyDefinition::Double ) ); xScale->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( xScale.release() ); - std::unique_ptr yScale = std::make_unique( QStringLiteral( "SCALE_Y" ), QObject::tr( "Scale factor (y-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); + auto yScale = std::make_unique( QStringLiteral( "SCALE_Y" ), QObject::tr( "Scale factor (y-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); yScale->setIsDynamic( true ); yScale->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SCALE_Y" ), QObject::tr( "Scale factor (y-axis)" ), QgsPropertyDefinition::Double ) ); yScale->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( yScale.release() ); - std::unique_ptr zScale = std::make_unique( QStringLiteral( "SCALE_Z" ), QObject::tr( "Scale factor (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); + auto zScale = std::make_unique( QStringLiteral( "SCALE_Z" ), QObject::tr( "Scale factor (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); zScale->setIsDynamic( true ); zScale->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SCALE_Z" ), QObject::tr( "Scale factor (z-axis)" ), QgsPropertyDefinition::Double ) ); zScale->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( zScale.release() ); - std::unique_ptr mScale = std::make_unique( QStringLiteral( "SCALE_M" ), QObject::tr( "Scale factor (m values)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); + auto mScale = std::make_unique( QStringLiteral( "SCALE_M" ), QObject::tr( "Scale factor (m values)" ), Qgis::ProcessingNumberParameterType::Double, 1.0 ); mScale->setIsDynamic( true ); mScale->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SCALE_M" ), QObject::tr( "Scale factor (m values)" ), QgsPropertyDefinition::Double ) ); mScale->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( mScale.release() ); - std::unique_ptr rotation = std::make_unique( QStringLiteral( "ROTATION_Z" ), QObject::tr( "Rotation around z-axis (degrees counter-clockwise)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto rotation = std::make_unique( QStringLiteral( "ROTATION_Z" ), QObject::tr( "Rotation around z-axis (degrees counter-clockwise)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); rotation->setIsDynamic( true ); rotation->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ROTATION_Z" ), QObject::tr( "Rotation around z-axis (degrees counter-clockwise)" ), QgsPropertyDefinition::Double ) ); rotation->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmarrayoffsetlines.cpp b/src/analysis/processing/qgsalgorithmarrayoffsetlines.cpp index 90c6cec1e444..3df70932319c 100644 --- a/src/analysis/processing/qgsalgorithmarrayoffsetlines.cpp +++ b/src/analysis/processing/qgsalgorithmarrayoffsetlines.cpp @@ -72,13 +72,13 @@ QgsCreateArrayOffsetLinesAlgorithm *QgsCreateArrayOffsetLinesAlgorithm::createIn void QgsCreateArrayOffsetLinesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr count = std::make_unique( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), Qgis::ProcessingNumberParameterType::Integer, 10, false, 1 ); + auto count = std::make_unique( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), Qgis::ProcessingNumberParameterType::Integer, 10, false, 1 ); count->setIsDynamic( true ); count->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); count->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( count.release() ); - std::unique_ptr offset = std::make_unique( QStringLiteral( "OFFSET" ), QObject::tr( "Offset step distance" ), 1.0, QStringLiteral( "INPUT" ) ); + auto offset = std::make_unique( QStringLiteral( "OFFSET" ), QObject::tr( "Offset step distance" ), 1.0, QStringLiteral( "INPUT" ) ); offset->setIsDynamic( true ); offset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "OFFSET" ), QObject::tr( "Step distance" ), QgsPropertyDefinition::Double ) ); offset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmarraytranslatedfeatures.cpp b/src/analysis/processing/qgsalgorithmarraytranslatedfeatures.cpp index a8b183c0b9b0..35e1222bc3a9 100644 --- a/src/analysis/processing/qgsalgorithmarraytranslatedfeatures.cpp +++ b/src/analysis/processing/qgsalgorithmarraytranslatedfeatures.cpp @@ -72,31 +72,31 @@ QgsArrayTranslatedFeaturesAlgorithm *QgsArrayTranslatedFeaturesAlgorithm::create void QgsArrayTranslatedFeaturesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr count = std::make_unique( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), Qgis::ProcessingNumberParameterType::Integer, 10, false, 1 ); + auto count = std::make_unique( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), Qgis::ProcessingNumberParameterType::Integer, 10, false, 1 ); count->setIsDynamic( true ); count->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "COUNT" ), QObject::tr( "Number of features to create" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); count->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( count.release() ); - std::unique_ptr xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Step distance (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Step distance (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); xOffset->setIsDynamic( true ); xOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_X" ), QObject::tr( "Offset distance (x-axis)" ), QgsPropertyDefinition::Double ) ); xOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( xOffset.release() ); - std::unique_ptr yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Step distance (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Step distance (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); yOffset->setIsDynamic( true ); yOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Y" ), QObject::tr( "Offset distance (y-axis)" ), QgsPropertyDefinition::Double ) ); yOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( yOffset.release() ); - std::unique_ptr zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Step distance (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Step distance (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); zOffset->setIsDynamic( true ); zOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Z" ), QObject::tr( "Offset distance (z-axis)" ), QgsPropertyDefinition::Double ) ); zOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( zOffset.release() ); - std::unique_ptr mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Step distance (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Step distance (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); mOffset->setIsDynamic( true ); mOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_M" ), QObject::tr( "Offset distance (m values)" ), QgsPropertyDefinition::Double ) ); mOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmcalculateexpression.cpp b/src/analysis/processing/qgsalgorithmcalculateexpression.cpp index 955e67fb9f90..eb4ddd1c36ce 100644 --- a/src/analysis/processing/qgsalgorithmcalculateexpression.cpp +++ b/src/analysis/processing/qgsalgorithmcalculateexpression.cpp @@ -63,7 +63,7 @@ void QgsCalculateExpressionAlgorithm::initAlgorithm( const QVariantMap & ) { // possibly this should be a new dedicated parameter type for "QgsProcessingParameterVariant", as the values specified for the parameter will // be whatever the model calculates as the result of the expression. But this works for now... - std::unique_ptr inputParameter = std::make_unique( QStringLiteral( "INPUT" ), QObject::tr( "Input" ), QVariant(), false, false ); + auto inputParameter = std::make_unique( QStringLiteral( "INPUT" ), QObject::tr( "Input" ), QVariant(), false, false ); // we limit the available sources for this parameter to just precalculated expressions -- otherwise it's confusing if we allow users // to enter a literal value for this parameter, as they could enter an expression in there and expect it to be evaluated. inputParameter->setMetadata( diff --git a/src/analysis/processing/qgsalgorithmcalculateoverlaps.cpp b/src/analysis/processing/qgsalgorithmcalculateoverlaps.cpp index 3295e808c24a..2275c1960492 100644 --- a/src/analysis/processing/qgsalgorithmcalculateoverlaps.cpp +++ b/src/analysis/processing/qgsalgorithmcalculateoverlaps.cpp @@ -54,7 +54,7 @@ void QgsCalculateVectorOverlapsAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "LAYERS" ), QObject::tr( "Overlay layers" ), Qgis::ProcessingSourceType::VectorPolygon ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Overlap" ) ) ); - std::unique_ptr gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); gridSize->setFlags( gridSize->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( gridSize.release() ); } diff --git a/src/analysis/processing/qgsalgorithmcategorizeusingstyle.cpp b/src/analysis/processing/qgsalgorithmcategorizeusingstyle.cpp index d90aa6d54c5f..402a0c2c6119 100644 --- a/src/analysis/processing/qgsalgorithmcategorizeusingstyle.cpp +++ b/src/analysis/processing/qgsalgorithmcategorizeusingstyle.cpp @@ -38,12 +38,12 @@ void QgsCategorizeUsingStyleAlgorithm::initAlgorithm( const QVariantMap & ) addOutput( new QgsProcessingOutputVectorLayer( QStringLiteral( "OUTPUT" ), QObject::tr( "Categorized layer" ) ) ); - std::unique_ptr failCategories = std::make_unique( QStringLiteral( "NON_MATCHING_CATEGORIES" ), QObject::tr( "Non-matching categories" ), Qgis::ProcessingSourceType::Vector, QVariant(), true, false ); + auto failCategories = std::make_unique( QStringLiteral( "NON_MATCHING_CATEGORIES" ), QObject::tr( "Non-matching categories" ), Qgis::ProcessingSourceType::Vector, QVariant(), true, false ); // not supported for outputs yet! //failCategories->setFlags( failCategories->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( failCategories.release() ); - std::unique_ptr failSymbols = std::make_unique( QStringLiteral( "NON_MATCHING_SYMBOLS" ), QObject::tr( "Non-matching symbol names" ), Qgis::ProcessingSourceType::Vector, QVariant(), true, false ); + auto failSymbols = std::make_unique( QStringLiteral( "NON_MATCHING_SYMBOLS" ), QObject::tr( "Non-matching symbol names" ), Qgis::ProcessingSourceType::Vector, QVariant(), true, false ); //failSymbols->setFlags( failSymbols->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( failSymbols.release() ); } diff --git a/src/analysis/processing/qgsalgorithmcellstatistics.cpp b/src/analysis/processing/qgsalgorithmcellstatistics.cpp index 34233ae2cae0..a07b2b688c05 100644 --- a/src/analysis/processing/qgsalgorithmcellstatistics.cpp +++ b/src/analysis/processing/qgsalgorithmcellstatistics.cpp @@ -43,11 +43,11 @@ void QgsCellStatisticsAlgorithmBase::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterRasterLayer( QStringLiteral( "REFERENCE_LAYER" ), QObject::tr( "Reference layer" ) ) ); - std::unique_ptr output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, false ); + auto output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, false ); output_nodata_parameter->setFlags( output_nodata_parameter->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( output_nodata_parameter.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -130,7 +130,7 @@ QVariantMap QgsCellStatisticsAlgorithmBase::processAlgorithm( const QVariantMap QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmcentroid.cpp b/src/analysis/processing/qgsalgorithmcentroid.cpp index 3022245c9ba5..68cc13e8d8bc 100644 --- a/src/analysis/processing/qgsalgorithmcentroid.cpp +++ b/src/analysis/processing/qgsalgorithmcentroid.cpp @@ -76,7 +76,7 @@ QgsCentroidAlgorithm *QgsCentroidAlgorithm::createInstance() const void QgsCentroidAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr allParts = std::make_unique( + auto allParts = std::make_unique( QStringLiteral( "ALL_PARTS" ), QObject::tr( "Create centroid for each part" ), false diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp index 44543a037449..0a5e1fccbf63 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryangle.cpp @@ -83,7 +83,7 @@ void QgsGeometryCheckAngleAlgorithm::initAlgorithm( const QVariantMap &configura addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "ERRORS" ), QObject::tr( "Error layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp index cb82b20f30c8..3f305fd49dce 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryarea.cpp @@ -83,7 +83,7 @@ void QgsGeometryCheckAreaAlgorithm::initAlgorithm( const QVariantMap &configurat addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "ERRORS" ), QObject::tr( "Error layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorPolygon ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } diff --git a/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp b/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp index 18cab9ee10f8..abba86a27ff4 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometryhole.cpp @@ -82,7 +82,7 @@ void QgsGeometryCheckHoleAlgorithm::initAlgorithm( const QVariantMap &configurat addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "ERRORS" ), QObject::tr( "Error layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorPolygon ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } diff --git a/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp b/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp index 1e7fb5a7f338..0cdae4f2ae6a 100644 --- a/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp +++ b/src/analysis/processing/qgsalgorithmcheckgeometrymissingvertex.cpp @@ -82,7 +82,7 @@ void QgsGeometryCheckMissingVertexAlgorithm::initAlgorithm( const QVariantMap &c addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "ERRORS" ), QObject::tr( "Error layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorPolygon ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } diff --git a/src/analysis/processing/qgsalgorithmconstantraster.cpp b/src/analysis/processing/qgsalgorithmconstantraster.cpp index af5e308fa1ee..8446f2cc4b8b 100644 --- a/src/analysis/processing/qgsalgorithmconstantraster.cpp +++ b/src/analysis/processing/qgsalgorithmconstantraster.cpp @@ -82,7 +82,7 @@ void QgsConstantRasterAlgorithm::initAlgorithm( const QVariantMap & ) rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -168,7 +168,7 @@ QVariantMap QgsConstantRasterAlgorithm::processAlgorithm( const QVariantMap &par //this prevents output cellsize being calculated too small const QgsRectangle rasterExtent = QgsRectangle( extent.xMinimum(), extent.yMaximum() - ( rows * pixelSize ), extent.xMinimum() + ( cols * pixelSize ), extent.yMaximum() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmconverttocurves.cpp b/src/analysis/processing/qgsalgorithmconverttocurves.cpp index c2df04d45283..b3f174b4c5bd 100644 --- a/src/analysis/processing/qgsalgorithmconverttocurves.cpp +++ b/src/analysis/processing/qgsalgorithmconverttocurves.cpp @@ -67,13 +67,13 @@ QList QgsConvertToCurvesAlgorithm::inputLayerTypes() const void QgsConvertToCurvesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum distance tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0.000001, false, 0, 10000000.0 ); + auto tolerance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum distance tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0.000001, false, 0, 10000000.0 ); tolerance->setIsDynamic( true ); tolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum distance tolerance" ), QgsPropertyDefinition::DoublePositive ) ); tolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( tolerance.release() ); - std::unique_ptr angleTolerance = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0.000001, false, 0, 45.0 ); + auto angleTolerance = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0.000001, false, 0, 45.0 ); angleTolerance->setIsDynamic( true ); angleTolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle tolerance" ), QgsPropertyDefinition::DoublePositive ) ); angleTolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmcoveragesimplify.cpp b/src/analysis/processing/qgsalgorithmcoveragesimplify.cpp index 5b549d4f0122..5440107538e1 100644 --- a/src/analysis/processing/qgsalgorithmcoveragesimplify.cpp +++ b/src/analysis/processing/qgsalgorithmcoveragesimplify.cpp @@ -52,7 +52,7 @@ void QgsCoverageSimplifyAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); addParameter( new QgsProcessingParameterDistance( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 1.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ) ); - std::unique_ptr boundaryParameter = std::make_unique( QStringLiteral( "PRESERVE_BOUNDARY" ), QObject::tr( "Preserve boundary" ), false ); + auto boundaryParameter = std::make_unique( QStringLiteral( "PRESERVE_BOUNDARY" ), QObject::tr( "Preserve boundary" ), false ); boundaryParameter->setHelp( QObject::tr( "When enabled the outside edges of the coverage will be preserved without simplification." ) ); addParameter( boundaryParameter.release() ); diff --git a/src/analysis/processing/qgsalgorithmcoveragevalidate.cpp b/src/analysis/processing/qgsalgorithmcoveragevalidate.cpp index 0861df33c7ed..a59776042154 100644 --- a/src/analysis/processing/qgsalgorithmcoveragevalidate.cpp +++ b/src/analysis/processing/qgsalgorithmcoveragevalidate.cpp @@ -52,7 +52,7 @@ QString QgsCoverageValidateAlgorithm::groupId() const void QgsCoverageValidateAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); - std::unique_ptr gapWidthParam = std::make_unique( QStringLiteral( "GAP_WIDTH" ), QObject::tr( "Gap width" ), 0.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); + auto gapWidthParam = std::make_unique( QStringLiteral( "GAP_WIDTH" ), QObject::tr( "Gap width" ), 0.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); gapWidthParam->setHelp( QObject::tr( "The maximum width of gaps to detect" ) ); addParameter( gapWidthParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmdelaunaytriangulation.cpp b/src/analysis/processing/qgsalgorithmdelaunaytriangulation.cpp index 1779e50950bb..d949289aacb7 100644 --- a/src/analysis/processing/qgsalgorithmdelaunaytriangulation.cpp +++ b/src/analysis/processing/qgsalgorithmdelaunaytriangulation.cpp @@ -60,7 +60,7 @@ QgsDelaunayTriangulationAlgorithm *QgsDelaunayTriangulationAlgorithm::createInst void QgsDelaunayTriangulationAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPoint ) ) ); - std::unique_ptr toleranceParam = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); + auto toleranceParam = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); toleranceParam->setHelp( QObject::tr( "Specifies an optional snapping tolerance which can be used to improve the robustness of the triangulation" ) ); addParameter( toleranceParam.release() ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "ADD_ATTRIBUTES" ), QObject::tr( "Add point IDs to output" ), true ) ); diff --git a/src/analysis/processing/qgsalgorithmdensifygeometriesbycount.cpp b/src/analysis/processing/qgsalgorithmdensifygeometriesbycount.cpp index 61eecaaaa121..258c00000689 100644 --- a/src/analysis/processing/qgsalgorithmdensifygeometriesbycount.cpp +++ b/src/analysis/processing/qgsalgorithmdensifygeometriesbycount.cpp @@ -75,7 +75,7 @@ QList QgsDensifyGeometriesByCountAlgorithm::inputLayerTypes() const void QgsDensifyGeometriesByCountAlgorithm::initParameters( const QVariantMap &configuration ) { Q_UNUSED( configuration ) - std::unique_ptr verticesCnt = std::make_unique( QStringLiteral( "VERTICES" ), QObject::tr( "Number of vertices to add" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1, 10000000 ); + auto verticesCnt = std::make_unique( QStringLiteral( "VERTICES" ), QObject::tr( "Number of vertices to add" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1, 10000000 ); verticesCnt->setIsDynamic( true ); verticesCnt->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "VerticesCount" ), QObject::tr( "Vertices count" ), QgsPropertyDefinition::IntegerPositive ) ); verticesCnt->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmdensifygeometriesbyinterval.cpp b/src/analysis/processing/qgsalgorithmdensifygeometriesbyinterval.cpp index 2061c6ac0a71..2a96265f2d1a 100644 --- a/src/analysis/processing/qgsalgorithmdensifygeometriesbyinterval.cpp +++ b/src/analysis/processing/qgsalgorithmdensifygeometriesbyinterval.cpp @@ -70,7 +70,7 @@ QList QgsDensifyGeometriesByIntervalAlgorithm::inputLayerTypes() const void QgsDensifyGeometriesByIntervalAlgorithm::initParameters( const QVariantMap &configuration ) { Q_UNUSED( configuration ) - std::unique_ptr interval = std::make_unique( QStringLiteral( "INTERVAL" ), QObject::tr( "Interval between vertices to add" ), 1, QStringLiteral( "INPUT" ), false, 0, 10000000 ); + auto interval = std::make_unique( QStringLiteral( "INTERVAL" ), QObject::tr( "Interval between vertices to add" ), 1, QStringLiteral( "INPUT" ), false, 0, 10000000 ); interval->setIsDynamic( true ); interval->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Interval" ), QObject::tr( "Interval" ), QgsPropertyDefinition::DoublePositive ) ); interval->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmdetectdatasetchanges.cpp b/src/analysis/processing/qgsalgorithmdetectdatasetchanges.cpp index 99baab2818ca..21eb7746a3bb 100644 --- a/src/analysis/processing/qgsalgorithmdetectdatasetchanges.cpp +++ b/src/analysis/processing/qgsalgorithmdetectdatasetchanges.cpp @@ -51,7 +51,7 @@ void QgsDetectVectorChangesAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "ORIGINAL" ), QObject::tr( "Original layer" ) ) ); addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "REVISED" ), QObject::tr( "Revised layer" ) ) ); - std::unique_ptr compareAttributesParam = std::make_unique( QStringLiteral( "COMPARE_ATTRIBUTES" ), QObject::tr( "Attributes to consider for match (or none to compare geometry only)" ), QVariant(), QStringLiteral( "ORIGINAL" ), Qgis::ProcessingFieldParameterDataType::Any, true, true ); + auto compareAttributesParam = std::make_unique( QStringLiteral( "COMPARE_ATTRIBUTES" ), QObject::tr( "Attributes to consider for match (or none to compare geometry only)" ), QVariant(), QStringLiteral( "ORIGINAL" ), Qgis::ProcessingFieldParameterDataType::Any, true, true ); compareAttributesParam->setDefaultToAllFields( true ); addParameter( compareAttributesParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmdifference.cpp b/src/analysis/processing/qgsalgorithmdifference.cpp index 4a4d7d0aeabe..17591bddeb77 100644 --- a/src/analysis/processing/qgsalgorithmdifference.cpp +++ b/src/analysis/processing/qgsalgorithmdifference.cpp @@ -84,7 +84,7 @@ void QgsDifferenceAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ) ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Difference" ) ) ); - std::unique_ptr gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); gridSize->setFlags( gridSize->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( gridSize.release() ); } diff --git a/src/analysis/processing/qgsalgorithmdissolve.cpp b/src/analysis/processing/qgsalgorithmdissolve.cpp index c3f405deb960..c2c7552a1609 100644 --- a/src/analysis/processing/qgsalgorithmdissolve.cpp +++ b/src/analysis/processing/qgsalgorithmdissolve.cpp @@ -242,7 +242,7 @@ void QgsDissolveAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterField( QStringLiteral( "FIELD" ), QObject::tr( "Dissolve field(s)" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Any, true, true ) ); - std::unique_ptr disjointParam = std::make_unique( QStringLiteral( "SEPARATE_DISJOINT" ), QObject::tr( "Keep disjoint features separate" ), false ); + auto disjointParam = std::make_unique( QStringLiteral( "SEPARATE_DISJOINT" ), QObject::tr( "Keep disjoint features separate" ), false ); disjointParam->setFlags( disjointParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( disjointParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmdownloadvectortiles.cpp b/src/analysis/processing/qgsalgorithmdownloadvectortiles.cpp index bdfc7eb5b9ea..321cf3debe0d 100644 --- a/src/analysis/processing/qgsalgorithmdownloadvectortiles.cpp +++ b/src/analysis/processing/qgsalgorithmdownloadvectortiles.cpp @@ -141,7 +141,7 @@ QVariantMap QgsDownloadVectorTilesAlgorithm::processAlgorithm( const QVariantMap throw QgsProcessingException( QObject::tr( "Requested number of tiles %1 exceeds limit of %2 tiles. Please, select a smaller extent, reduce maximum zoom level or increase tile limit." ).arg( tileCount ).arg( mTileLimit ) ); } - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); if ( !writer->create() ) { throw QgsProcessingException( QObject::tr( "Failed to create MBTiles file %1" ).arg( outputFile ) ); diff --git a/src/analysis/processing/qgsalgorithmdrape.cpp b/src/analysis/processing/qgsalgorithmdrape.cpp index d1a1c8fcf5df..59ce2caab79f 100644 --- a/src/analysis/processing/qgsalgorithmdrape.cpp +++ b/src/analysis/processing/qgsalgorithmdrape.cpp @@ -42,7 +42,7 @@ void QgsDrapeAlgorithmBase::initParameters( const QVariantMap & ) addParameter( new QgsProcessingParameterBand( QStringLiteral( "BAND" ), QObject::tr( "Band number" ), 1, QStringLiteral( "RASTER" ) ) ); // nodata value - std::unique_ptr nodata = std::make_unique( QStringLiteral( "NODATA" ), QObject::tr( "Value for NoData or non-intersecting vertices" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto nodata = std::make_unique( QStringLiteral( "NODATA" ), QObject::tr( "Value for NoData or non-intersecting vertices" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); nodata->setIsDynamic( true ); nodata->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "NODATA" ), QObject::tr( "Value for NoData or non-intersecting vertices" ), QgsPropertyDefinition::Double ) ); nodata->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmdxfexport.cpp b/src/analysis/processing/qgsalgorithmdxfexport.cpp index 369ddb6bcd6d..ddfdd0088e08 100644 --- a/src/analysis/processing/qgsalgorithmdxfexport.cpp +++ b/src/analysis/processing/qgsalgorithmdxfexport.cpp @@ -61,17 +61,17 @@ void QgsDxfExportAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterDxfLayers( QStringLiteral( "LAYERS" ), QObject::tr( "Input layers" ) ) ); addParameter( new QgsProcessingParameterEnum( QStringLiteral( "SYMBOLOGY_MODE" ), QObject::tr( "Symbology mode" ), QStringList() << QObject::tr( "No Symbology" ) << QObject::tr( "Feature Symbology" ) << QObject::tr( "Symbol Layer Symbology" ), false, 0 ) ); addParameter( new QgsProcessingParameterScale( QStringLiteral( "SYMBOLOGY_SCALE" ), QObject::tr( "Symbology scale" ), 1000000 ) ); - std::unique_ptr mapThemeParam = std::make_unique( QStringLiteral( "MAP_THEME" ), QObject::tr( "Map theme" ), QVariant(), true ); + auto mapThemeParam = std::make_unique( QStringLiteral( "MAP_THEME" ), QObject::tr( "Map theme" ), QVariant(), true ); mapThemeParam->setHelp( QObject::tr( "Match layer styling to the provided map theme" ) ); addParameter( mapThemeParam.release() ); const QStringList encodings = QgsDxfExport::encodings(); addParameter( new QgsProcessingParameterEnum( QStringLiteral( "ENCODING" ), QObject::tr( "Encoding" ), encodings, false, encodings.at( 0 ), false, true ) ); addParameter( new QgsProcessingParameterCrs( QStringLiteral( "CRS" ), QObject::tr( "CRS" ), QStringLiteral( "EPSG:4326" ) ) ); - std::unique_ptr extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Extent" ), QVariant(), true ); + auto extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Extent" ), QVariant(), true ); extentParam->setHelp( QObject::tr( "Limit exported features to those with geometries intersecting the provided extent" ) ); addParameter( extentParam.release() ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SELECTED_FEATURES_ONLY" ), QObject::tr( "Use only selected features" ), false ) ); - std::unique_ptr useTitleParam = std::make_unique( QStringLiteral( "USE_LAYER_TITLE" ), QObject::tr( "Use layer title as name" ), false ); + auto useTitleParam = std::make_unique( QStringLiteral( "USE_LAYER_TITLE" ), QObject::tr( "Use layer title as name" ), false ); useTitleParam->setHelp( QObject::tr( "If no attribute is chosen and layer name is not being overridden, prefer layer title (set in layer properties) to layer name" ) ); addParameter( useTitleParam.release() ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "FORCE_2D" ), QObject::tr( "Force 2D output" ), false ) ); diff --git a/src/analysis/processing/qgsalgorithmexplode.cpp b/src/analysis/processing/qgsalgorithmexplode.cpp index 9ef10fc95e39..21b57a19d052 100644 --- a/src/analysis/processing/qgsalgorithmexplode.cpp +++ b/src/analysis/processing/qgsalgorithmexplode.cpp @@ -154,14 +154,14 @@ std::vector QgsExplodeAlgorithm::curveAsSingleSegments( const QgsCu { const QgsPoint ptA = line->pointN( i ); const QgsPoint ptB = line->pointN( i + 1 ); - std::unique_ptr ls = std::make_unique( QVector() << ptA << ptB ); + auto ls = std::make_unique( QVector() << ptA << ptB ); if ( !useCompoundCurves ) { parts.emplace_back( QgsGeometry( std::move( ls ) ) ); } else { - std::unique_ptr cc = std::make_unique(); + auto cc = std::make_unique(); cc->addCurve( ls.release() ); parts.emplace_back( QgsGeometry( std::move( cc ) ) ); } @@ -177,7 +177,7 @@ std::vector QgsExplodeAlgorithm::curveAsSingleSegments( const QgsCu const QgsPoint ptA = string->pointN( i ); const QgsPoint ptB = string->pointN( i + 1 ); const QgsPoint ptC = string->pointN( i + 2 ); - std::unique_ptr cs = std::make_unique(); + auto cs = std::make_unique(); cs->setPoints( QgsPointSequence() << ptA << ptB << ptC ); if ( !useCompoundCurves ) { @@ -185,7 +185,7 @@ std::vector QgsExplodeAlgorithm::curveAsSingleSegments( const QgsCu } else { - std::unique_ptr cc = std::make_unique(); + auto cc = std::make_unique(); cc->addCurve( cs.release() ); parts.emplace_back( QgsGeometry( std::move( cc ) ) ); } diff --git a/src/analysis/processing/qgsalgorithmexportmesh.cpp b/src/analysis/processing/qgsalgorithmexportmesh.cpp index 99ce29a6f9b2..3730b7ecee77 100644 --- a/src/analysis/processing/qgsalgorithmexportmesh.cpp +++ b/src/analysis/processing/qgsalgorithmexportmesh.cpp @@ -427,7 +427,7 @@ QgsGeometry QgsExportMeshFacesAlgorithm::meshElement( int index ) const QVector vertices( face.size() ); for ( int i = 0; i < face.size(); ++i ) vertices[i] = mNativeMesh.vertex( face.at( i ) ); - std::unique_ptr polygon = std::make_unique(); + auto polygon = std::make_unique(); polygon->setExteriorRing( new QgsLineString( vertices ) ); return QgsGeometry( polygon.release() ); } @@ -774,7 +774,7 @@ void QgsMeshRasterizeAlgorithm::initAlgorithm( const QVariantMap &configuration addParameter( new QgsProcessingParameterDistance( QStringLiteral( "PIXEL_SIZE" ), QObject::tr( "Pixel size" ), 1, QStringLiteral( "INPUT" ), false ) ); addParameter( new QgsProcessingParameterCrs( QStringLiteral( "CRS_OUTPUT" ), QObject::tr( "Output coordinate system" ), QVariant(), true ) ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -985,7 +985,7 @@ void QgsMeshContoursAlgorithm::initAlgorithm( const QVariantMap &configuration ) QStringLiteral( "MAXIMUM" ), QObject::tr( "Maximum contour level" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ) ); - std::unique_ptr contourLevelList = std::make_unique( + auto contourLevelList = std::make_unique( QStringLiteral( "CONTOUR_LEVEL_LIST" ), QObject::tr( "List of contours level" ), QVariant(), false, true ); contourLevelList->setHelp( QObject::tr( "Comma separated list of values to export. If filled, the increment, minimum and maximum settings are ignored." ) ); diff --git a/src/analysis/processing/qgsalgorithmexporttopostgresql.cpp b/src/analysis/processing/qgsalgorithmexporttopostgresql.cpp index c76af2495aa9..3542de34553e 100644 --- a/src/analysis/processing/qgsalgorithmexporttopostgresql.cpp +++ b/src/analysis/processing/qgsalgorithmexporttopostgresql.cpp @@ -150,7 +150,7 @@ QVariantMap QgsExportToPostgresqlAlgorithm::processAlgorithm( const QVariantMap uri.setKeyColumn( mPrimaryKeyField ); uri.setGeometryColumn( mGeomColumn ); - std::unique_ptr exporter = std::make_unique( uri.uri(), mProviderName, mSource->fields(), mSource->wkbType(), mSource->sourceCrs(), mOverwrite, mOptions ); + auto exporter = std::make_unique( uri.uri(), mProviderName, mSource->fields(), mSource->wkbType(), mSource->sourceCrs(), mOverwrite, mOptions ); if ( exporter->errorCode() != Qgis::VectorExportResult::Success ) throw QgsProcessingException( QObject::tr( "Error exporting to PostGIS\n%1" ).arg( exporter->errorMessage() ) ); diff --git a/src/analysis/processing/qgsalgorithmextendlines.cpp b/src/analysis/processing/qgsalgorithmextendlines.cpp index dcbbf327f932..c070c86ed631 100644 --- a/src/analysis/processing/qgsalgorithmextendlines.cpp +++ b/src/analysis/processing/qgsalgorithmextendlines.cpp @@ -78,13 +78,13 @@ QgsExtendLinesAlgorithm *QgsExtendLinesAlgorithm::createInstance() const void QgsExtendLinesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr startDistance = std::make_unique( QStringLiteral( "START_DISTANCE" ), QObject::tr( "Start distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto startDistance = std::make_unique( QStringLiteral( "START_DISTANCE" ), QObject::tr( "Start distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); startDistance->setIsDynamic( true ); startDistance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Start Distance" ), QObject::tr( "Start distance" ), QgsPropertyDefinition::DoublePositive ) ); startDistance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( startDistance.release() ); - std::unique_ptr endDistance = std::make_unique( QStringLiteral( "END_DISTANCE" ), QObject::tr( "End distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto endDistance = std::make_unique( QStringLiteral( "END_DISTANCE" ), QObject::tr( "End distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); endDistance->setIsDynamic( true ); endDistance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "End Distance" ), QObject::tr( "End distance" ), QgsPropertyDefinition::DoublePositive ) ); endDistance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmextractlabels.cpp b/src/analysis/processing/qgsalgorithmextractlabels.cpp index 33f31d124853..44c50abde28d 100644 --- a/src/analysis/processing/qgsalgorithmextractlabels.cpp +++ b/src/analysis/processing/qgsalgorithmextractlabels.cpp @@ -78,7 +78,7 @@ void QgsExtractLabelsAlgorithm::initAlgorithm( const QVariantMap & ) QObject::tr( "Map scale" ) ) ); - std::unique_ptr mapThemeParameter = std::make_unique( + auto mapThemeParameter = std::make_unique( QStringLiteral( "MAP_THEME" ), QObject::tr( "Map theme" ), QVariant(), true @@ -92,7 +92,7 @@ void QgsExtractLabelsAlgorithm::initAlgorithm( const QVariantMap & ) QVariant( true ) ) ); - std::unique_ptr dpiParameter = std::make_unique( + auto dpiParameter = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "Map resolution (in DPI)" ), Qgis::ProcessingNumberParameterType::Double, diff --git a/src/analysis/processing/qgsalgorithmfieldcalculator.cpp b/src/analysis/processing/qgsalgorithmfieldcalculator.cpp index 6405f71875f4..22f7cbeac88c 100644 --- a/src/analysis/processing/qgsalgorithmfieldcalculator.cpp +++ b/src/analysis/processing/qgsalgorithmfieldcalculator.cpp @@ -89,16 +89,16 @@ void QgsFieldCalculatorAlgorithm::initParameters( const QVariantMap &configurati icons << QgsFields::iconForFieldType( type.first, type.second ); } - std::unique_ptr fieldName = std::make_unique( QStringLiteral( "FIELD_NAME" ), QObject::tr( "Field name" ), QVariant(), false ); - std::unique_ptr fieldType = std::make_unique( QStringLiteral( "FIELD_TYPE" ), QObject::tr( "Result field type" ), fieldTypes, false, 0 ); + auto fieldName = std::make_unique( QStringLiteral( "FIELD_NAME" ), QObject::tr( "Field name" ), QVariant(), false ); + auto fieldType = std::make_unique( QStringLiteral( "FIELD_TYPE" ), QObject::tr( "Result field type" ), fieldTypes, false, 0 ); fieldType->setMetadata( { QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "icons" ), icons } } ) } } ) } ); - std::unique_ptr fieldLength = std::make_unique( QStringLiteral( "FIELD_LENGTH" ), QObject::tr( "Result field length" ), Qgis::ProcessingNumberParameterType::Integer, QVariant( 0 ), false, 0 ); - std::unique_ptr fieldPrecision = std::make_unique( QStringLiteral( "FIELD_PRECISION" ), QObject::tr( "Result field precision" ), Qgis::ProcessingNumberParameterType::Integer, QVariant( 0 ), false, 0 ); - std::unique_ptr expression = std::make_unique( QStringLiteral( "FORMULA" ), QObject::tr( "Formula" ), QVariant(), QStringLiteral( "INPUT" ), false ); + auto fieldLength = std::make_unique( QStringLiteral( "FIELD_LENGTH" ), QObject::tr( "Result field length" ), Qgis::ProcessingNumberParameterType::Integer, QVariant( 0 ), false, 0 ); + auto fieldPrecision = std::make_unique( QStringLiteral( "FIELD_PRECISION" ), QObject::tr( "Result field precision" ), Qgis::ProcessingNumberParameterType::Integer, QVariant( 0 ), false, 0 ); + auto expression = std::make_unique( QStringLiteral( "FORMULA" ), QObject::tr( "Formula" ), QVariant(), QStringLiteral( "INPUT" ), false ); expression->setMetadata( QVariantMap( { { "inlineEditor", true } } ) ); diff --git a/src/analysis/processing/qgsalgorithmfiledownloader.cpp b/src/analysis/processing/qgsalgorithmfiledownloader.cpp index e21536fb89de..45432eb92b75 100644 --- a/src/analysis/processing/qgsalgorithmfiledownloader.cpp +++ b/src/analysis/processing/qgsalgorithmfiledownloader.cpp @@ -73,7 +73,7 @@ void QgsFileDownloaderAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterString( QStringLiteral( "URL" ), tr( "URL" ), QVariant(), false, false ) ); - std::unique_ptr methodParam = std::make_unique( + auto methodParam = std::make_unique( QStringLiteral( "METHOD" ), QObject::tr( "Method" ), QStringList() @@ -86,7 +86,7 @@ void QgsFileDownloaderAlgorithm::initAlgorithm( const QVariantMap & ) methodParam->setFlags( methodParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( methodParam.release() ); - std::unique_ptr dataParam = std::make_unique( + auto dataParam = std::make_unique( QStringLiteral( "DATA" ), tr( "Data" ), QVariant(), false, true ); dataParam->setHelp( QObject::tr( "The data to add in the body if the request is a POST" ) ); diff --git a/src/analysis/processing/qgsalgorithmfillnodata.cpp b/src/analysis/processing/qgsalgorithmfillnodata.cpp index a3767832dc14..df4eba501dad 100644 --- a/src/analysis/processing/qgsalgorithmfillnodata.cpp +++ b/src/analysis/processing/qgsalgorithmfillnodata.cpp @@ -51,7 +51,7 @@ void QgsFillNoDataAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterBand( QStringLiteral( "BAND" ), QObject::tr( "Band Number" ), 1, QStringLiteral( "INPUT" ) ) ); addParameter( new QgsProcessingParameterNumber( QStringLiteral( "FILL_VALUE" ), QObject::tr( "Fill value" ), Qgis::ProcessingNumberParameterType::Double, 1, false ) ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -108,7 +108,7 @@ QVariantMap QgsFillNoDataAlgorithm::processAlgorithm( const QVariantMap ¶met const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral( "OUTPUT" ), context ); const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmfixgeometries.cpp b/src/analysis/processing/qgsalgorithmfixgeometries.cpp index f883e86d8812..14951a4597bd 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometries.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometries.cpp @@ -89,7 +89,7 @@ bool QgsFixGeometriesAlgorithm::supportInPlaceEdit( const QgsMapLayer *l ) const void QgsFixGeometriesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr methodParameter = std::make_unique( + auto methodParameter = std::make_unique( QStringLiteral( "METHOD" ), QObject::tr( "Repair method" ), QStringList { QObject::tr( "Linework" ), QObject::tr( "Structure" ) }, diff --git a/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp b/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp index 82ae71499332..864e59c239c1 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryangle.cpp @@ -100,7 +100,7 @@ void QgsFixGeometryAngleAlgorithm::initAlgorithm( const QVariantMap &configurati addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "REPORT" ), QObject::tr( "Report layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } @@ -153,7 +153,7 @@ auto QgsFixGeometryAngleAlgorithm::processAlgorithm( const QVariantMap ¶mete throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "REPORT" ) ) ); const QgsProject *project = QgsProject::instance(); - std::unique_ptr checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); + auto checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); QStringList messages; QVariantMap configurationCheck; diff --git a/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp b/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp index fc1a51ae60fe..662e653cee88 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryarea.cpp @@ -113,7 +113,7 @@ void QgsFixGeometryAreaAlgorithm::initAlgorithm( const QVariantMap &configuratio addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorPolygon ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "REPORT" ), QObject::tr( "Report layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } @@ -170,7 +170,7 @@ auto QgsFixGeometryAreaAlgorithm::processAlgorithm( const QVariantMap ¶meter throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "REPORT" ) ) ); const QgsProject *project = QgsProject::instance(); - std::unique_ptr checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); + auto checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); QStringList messages; QVariantMap configurationCheck; diff --git a/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp b/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp index aacfdc2e4c59..0c4162de5fbd 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometryhole.cpp @@ -98,7 +98,7 @@ void QgsFixGeometryHoleAlgorithm::initAlgorithm( const QVariantMap &configuratio addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "REPORT" ), QObject::tr( "Report layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } @@ -151,7 +151,7 @@ auto QgsFixGeometryHoleAlgorithm::processAlgorithm( const QVariantMap ¶meter throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "REPORT" ) ) ); const QgsProject *project = QgsProject::instance(); - std::unique_ptr checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); + auto checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); QStringList messages; const QgsGeometryHoleCheck check( checkContext.get(), QVariantMap() ); diff --git a/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp b/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp index f04fee6aa633..1f408da60047 100644 --- a/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp +++ b/src/analysis/processing/qgsalgorithmfixgeometrymissingvertex.cpp @@ -97,7 +97,7 @@ void QgsFixGeometryMissingVertexAlgorithm::initAlgorithm( const QVariantMap &con addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorPolygon ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "REPORT" ), QObject::tr( "Report layer" ), Qgis::ProcessingSourceType::VectorPoint ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13 ); tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( tolerance.release() ); } @@ -150,7 +150,7 @@ auto QgsFixGeometryMissingVertexAlgorithm::processAlgorithm( const QVariantMap & throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "REPORT" ) ) ); const QgsProject *project = QgsProject::instance(); - std::unique_ptr checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); + auto checkContext = std::make_unique( mTolerance, input->sourceCrs(), project->transformContext(), project ); QStringList messages; const QgsGeometryMissingVertexCheck check( checkContext.get(), QVariantMap() ); diff --git a/src/analysis/processing/qgsalgorithmfuzzifyraster.cpp b/src/analysis/processing/qgsalgorithmfuzzifyraster.cpp index a5b0c9126796..fa2071f02d27 100644 --- a/src/analysis/processing/qgsalgorithmfuzzifyraster.cpp +++ b/src/analysis/processing/qgsalgorithmfuzzifyraster.cpp @@ -49,7 +49,7 @@ void QgsFuzzifyRasterAlgorithmBase::initAlgorithm( const QVariantMap & ) addOutput( new QgsProcessingOutputNumber( QStringLiteral( "HEIGHT_IN_PIXELS" ), QObject::tr( "Height in pixels" ) ) ); addOutput( new QgsProcessingOutputNumber( QStringLiteral( "TOTAL_PIXEL_COUNT" ), QObject::tr( "Total pixel count" ) ) ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -89,7 +89,7 @@ QVariantMap QgsFuzzifyRasterAlgorithmBase::processAlgorithm( const QVariantMap & const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { @@ -195,7 +195,7 @@ void QgsFuzzifyRasterLinearMembershipAlgorithm::fuzzify( QgsRasterDataProvider * { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { @@ -321,7 +321,7 @@ void QgsFuzzifyRasterPowerMembershipAlgorithm::fuzzify( QgsRasterDataProvider *d { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { @@ -442,7 +442,7 @@ void QgsFuzzifyRasterLargeMembershipAlgorithm::fuzzify( QgsRasterDataProvider *d { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { @@ -546,7 +546,7 @@ void QgsFuzzifyRasterSmallMembershipAlgorithm::fuzzify( QgsRasterDataProvider *d { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { @@ -650,7 +650,7 @@ void QgsFuzzifyRasterGaussianMembershipAlgorithm::fuzzify( QgsRasterDataProvider { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { @@ -755,7 +755,7 @@ void QgsFuzzifyRasterNearMembershipAlgorithm::fuzzify( QgsRasterDataProvider *de { if ( feedback ) feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); - std::unique_ptr fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); + auto fuzzifiedBlock = std::make_unique( destinationProvider->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { diff --git a/src/analysis/processing/qgsalgorithmgenerateelevationprofile.cpp b/src/analysis/processing/qgsalgorithmgenerateelevationprofile.cpp index 56f9ce9c1077..74aff4336bf4 100644 --- a/src/analysis/processing/qgsalgorithmgenerateelevationprofile.cpp +++ b/src/analysis/processing/qgsalgorithmgenerateelevationprofile.cpp @@ -189,13 +189,13 @@ bool QgsGenerateElevationProfileAlgorithm::prepareAlgorithm( const QVariantMap & { if ( QgsRasterLayer *rasterLayer = dynamic_cast( terrainLayer ) ) { - std::unique_ptr terrainProvider = std::make_unique(); + auto terrainProvider = std::make_unique(); terrainProvider->setLayer( rasterLayer ); request.setTerrainProvider( terrainProvider.release() ); } else if ( QgsMeshLayer *meshLayer = dynamic_cast( terrainLayer ) ) { - std::unique_ptr terrainProvider = std::make_unique(); + auto terrainProvider = std::make_unique(); terrainProvider->setLayer( meshLayer ); request.setTerrainProvider( terrainProvider.release() ); } @@ -244,7 +244,7 @@ QVariantMap QgsGenerateElevationProfileAlgorithm::processAlgorithm( const QVaria if ( borderColor.isValid() ) { - std::unique_ptr lineSymbolLayer = std::make_unique( borderColor, 0.1 ); + auto lineSymbolLayer = std::make_unique( borderColor, 0.1 ); lineSymbolLayer->setPenCapStyle( Qt::FlatCap ); plotItem.xAxis().setGridMinorSymbol( new QgsLineSymbol( QgsSymbolLayerList( { lineSymbolLayer->clone() } ) ) ); plotItem.yAxis().setGridMinorSymbol( new QgsLineSymbol( QgsSymbolLayerList( { lineSymbolLayer->clone() } ) ) ); @@ -255,7 +255,7 @@ QVariantMap QgsGenerateElevationProfileAlgorithm::processAlgorithm( const QVaria if ( backgroundColor.isValid() ) { - std::unique_ptr fillSymbolLayer = std::make_unique( backgroundColor, Qt::SolidPattern, backgroundColor ); + auto fillSymbolLayer = std::make_unique( backgroundColor, Qt::SolidPattern, backgroundColor ); plotItem.setChartBackgroundSymbol( new QgsFillSymbol( QgsSymbolLayerList( { fillSymbolLayer.release() } ) ) ); } diff --git a/src/analysis/processing/qgsalgorithmgltftovector.cpp b/src/analysis/processing/qgsalgorithmgltftovector.cpp index 85c6e8e84f1c..6fb09ddc838f 100644 --- a/src/analysis/processing/qgsalgorithmgltftovector.cpp +++ b/src/analysis/processing/qgsalgorithmgltftovector.cpp @@ -105,7 +105,7 @@ std::unique_ptr extractTriangles( x, y, z ); - std::unique_ptr mp = std::make_unique(); + auto mp = std::make_unique(); if ( primitive.indices == -1 ) { @@ -206,7 +206,7 @@ std::unique_ptr extractLines( x, y, z ); - std::unique_ptr ml = std::make_unique(); + auto ml = std::make_unique(); if ( primitive.indices == -1 ) { diff --git a/src/analysis/processing/qgsalgorithmgpsbabeltools.cpp b/src/analysis/processing/qgsalgorithmgpsbabeltools.cpp index bf750582cb4b..6f0c6f52d1a7 100644 --- a/src/analysis/processing/qgsalgorithmgpsbabeltools.cpp +++ b/src/analysis/processing/qgsalgorithmgpsbabeltools.cpp @@ -247,7 +247,7 @@ void QgsConvertGpsDataAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFile( QStringLiteral( "INPUT" ), QObject::tr( "Input file" ), Qgis::ProcessingFileParameterBehavior::File, QString(), QVariant(), false, QgsApplication::gpsBabelFormatRegistry()->importFileFilter() + QStringLiteral( ";;%1" ).arg( QObject::tr( "All files (*.*)" ) ) ) ); - std::unique_ptr formatParam = std::make_unique( QStringLiteral( "FORMAT" ), QObject::tr( "Format" ) ); + auto formatParam = std::make_unique( QStringLiteral( "FORMAT" ), QObject::tr( "Format" ) ); QStringList formats; const QStringList formatNames = QgsApplication::gpsBabelFormatRegistry()->importFormatNames(); @@ -439,7 +439,7 @@ QString QgsDownloadGpsDataAlgorithm::groupId() const void QgsDownloadGpsDataAlgorithm::initAlgorithm( const QVariantMap & ) { - std::unique_ptr deviceParam = std::make_unique( QStringLiteral( "DEVICE" ), QObject::tr( "Device" ) ); + auto deviceParam = std::make_unique( QStringLiteral( "DEVICE" ), QObject::tr( "Device" ) ); QStringList deviceNames = QgsApplication::gpsBabelFormatRegistry()->deviceNames(); std::sort( deviceNames.begin(), deviceNames.end(), []( const QString &a, const QString &b ) { @@ -452,7 +452,7 @@ void QgsDownloadGpsDataAlgorithm::initAlgorithm( const QVariantMap & ) const QList> devices = QgsGpsDetector::availablePorts() << QPair( QStringLiteral( "usb:" ), QStringLiteral( "usb:" ) ); - std::unique_ptr portParam = std::make_unique( QStringLiteral( "PORT" ), QObject::tr( "Port" ) ); + auto portParam = std::make_unique( QStringLiteral( "PORT" ), QObject::tr( "Port" ) ); QStringList ports; for ( auto it = devices.constBegin(); it != devices.constEnd(); ++it ) @@ -658,7 +658,7 @@ void QgsUploadGpsDataAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFile( QStringLiteral( "INPUT" ), QObject::tr( "Input file" ), Qgis::ProcessingFileParameterBehavior::File, QString(), QVariant(), false, QObject::tr( "GPX files" ) + QStringLiteral( " (*.gpx *.GPX)" ) ) ); - std::unique_ptr deviceParam = std::make_unique( QStringLiteral( "DEVICE" ), QObject::tr( "Device" ) ); + auto deviceParam = std::make_unique( QStringLiteral( "DEVICE" ), QObject::tr( "Device" ) ); QStringList deviceNames = QgsApplication::gpsBabelFormatRegistry()->deviceNames(); std::sort( deviceNames.begin(), deviceNames.end(), []( const QString &a, const QString &b ) { @@ -670,7 +670,7 @@ void QgsUploadGpsDataAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( deviceParam.release() ); const QList> devices = QgsGpsDetector::availablePorts() << QPair( QStringLiteral( "usb:" ), QStringLiteral( "usb:" ) ); - std::unique_ptr portParam = std::make_unique( QStringLiteral( "PORT" ), QObject::tr( "Port" ) ); + auto portParam = std::make_unique( QStringLiteral( "PORT" ), QObject::tr( "Port" ) ); QStringList ports; for ( auto it = devices.constBegin(); it != devices.constEnd(); ++it ) diff --git a/src/analysis/processing/qgsalgorithmgrid.cpp b/src/analysis/processing/qgsalgorithmgrid.cpp index 31b92f1afcd1..a95085d751c4 100644 --- a/src/analysis/processing/qgsalgorithmgrid.cpp +++ b/src/analysis/processing/qgsalgorithmgrid.cpp @@ -355,7 +355,7 @@ void QgsGridAlgorithm::createRectangleGrid( std::unique_ptr &sin ringX = { x1, x2, x2, x1, x1 }; ringY = { y1, y1, y2, y2, y1 }; - std::unique_ptr poly = std::make_unique(); + auto poly = std::make_unique(); poly->setExteriorRing( new QgsLineString( ringX, ringY ) ); f.setGeometry( std::move( poly ) ); f.setAttributes( QgsAttributes() << id << x1 << y1 << x2 << y2 << row << col ); @@ -433,7 +433,7 @@ void QgsGridAlgorithm::createDiamondGrid( std::unique_ptr &sink, ringX = { x1, x2, x3, x2, x1 }; ringY = { y2, y1, y2, y3, y2 }; - std::unique_ptr poly = std::make_unique(); + auto poly = std::make_unique(); poly->setExteriorRing( new QgsLineString( ringX, ringY ) ); f.setGeometry( std::move( poly ) ); f.setAttributes( QgsAttributes() << id << x1 << y1 << x3 << y3 ); @@ -522,7 +522,7 @@ void QgsGridAlgorithm::createHexagonGrid( std::unique_ptr &sink, ringX = { x1, x2, x3, x4, x3, x2, x1 }; ringY = { y2, y1, y1, y2, y3, y3, y2 }; - std::unique_ptr poly = std::make_unique(); + auto poly = std::make_unique(); poly->setExteriorRing( new QgsLineString( ringX, ringY ) ); f.setGeometry( std::move( poly ) ); f.setAttributes( QgsAttributes() << id << x1 << y1 << x4 << y3 << row << col ); diff --git a/src/analysis/processing/qgsalgorithmhttprequest.cpp b/src/analysis/processing/qgsalgorithmhttprequest.cpp index 27e7fa98fa24..c0004c8b21fc 100644 --- a/src/analysis/processing/qgsalgorithmhttprequest.cpp +++ b/src/analysis/processing/qgsalgorithmhttprequest.cpp @@ -76,7 +76,7 @@ void QgsHttpRequestAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterString( QStringLiteral( "URL" ), tr( "URL" ), QVariant(), false, false ) ); - std::unique_ptr methodParam = std::make_unique( + auto methodParam = std::make_unique( QStringLiteral( "METHOD" ), QObject::tr( "Method" ), QStringList() @@ -88,25 +88,25 @@ void QgsHttpRequestAlgorithm::initAlgorithm( const QVariantMap & ) methodParam->setHelp( QObject::tr( "The HTTP method to use for the request" ) ); addParameter( methodParam.release() ); - std::unique_ptr dataParam = std::make_unique( + auto dataParam = std::make_unique( QStringLiteral( "DATA" ), tr( "POST data" ), QVariant(), false, true ); dataParam->setHelp( QObject::tr( "The data to add in the body if the request is a POST" ) ); addParameter( dataParam.release() ); - std::unique_ptr outputFileParam = std::make_unique( + auto outputFileParam = std::make_unique( QStringLiteral( "OUTPUT" ), tr( "File destination" ), QObject::tr( "All files (*.*)" ), QVariant(), true, false ); outputFileParam->setHelp( tr( "The result can be written to a file instead of being returned as a string" ) ); addParameter( outputFileParam.release() ); - std::unique_ptr authConfigParam = std::make_unique( + auto authConfigParam = std::make_unique( QStringLiteral( "AUTH_CONFIG" ), tr( "Authentication" ), QVariant(), true ); authConfigParam->setHelp( tr( "An authentication configuration to pass" ) ); addParameter( authConfigParam.release() ); - std::unique_ptr failureParam = std::make_unique( + auto failureParam = std::make_unique( QStringLiteral( "FAIL_ON_ERROR" ), tr( "Consider HTTP errors as failures" ), false ); failureParam->setHelp( tr( "If set, the algorithm will fail on encountering a HTTP error" ) ); diff --git a/src/analysis/processing/qgsalgorithmimportphotos.cpp b/src/analysis/processing/qgsalgorithmimportphotos.cpp index c09789366f87..57f4e8bea475 100644 --- a/src/analysis/processing/qgsalgorithmimportphotos.cpp +++ b/src/analysis/processing/qgsalgorithmimportphotos.cpp @@ -54,11 +54,11 @@ void QgsImportPhotosAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFile( QStringLiteral( "FOLDER" ), QObject::tr( "Input folder" ), Qgis::ProcessingFileParameterBehavior::Folder ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "RECURSIVE" ), QObject::tr( "Scan recursively" ), false ) ); - std::unique_ptr output = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Photos" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto output = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Photos" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); output->setCreateByDefault( true ); addParameter( output.release() ); - std::unique_ptr invalid = std::make_unique( QStringLiteral( "INVALID" ), QObject::tr( "Invalid photos table" ), Qgis::ProcessingSourceType::Vector, QVariant(), true ); + auto invalid = std::make_unique( QStringLiteral( "INVALID" ), QObject::tr( "Invalid photos table" ), Qgis::ProcessingSourceType::Vector, QVariant(), true ); invalid->setCreateByDefault( false ); addParameter( invalid.release() ); } diff --git a/src/analysis/processing/qgsalgorithminterpolatepoint.cpp b/src/analysis/processing/qgsalgorithminterpolatepoint.cpp index 3e8f216e96f2..7e192478b20f 100644 --- a/src/analysis/processing/qgsalgorithminterpolatepoint.cpp +++ b/src/analysis/processing/qgsalgorithminterpolatepoint.cpp @@ -92,7 +92,7 @@ QgsInterpolatePointAlgorithm *QgsInterpolatePointAlgorithm::createInstance() con void QgsInterpolatePointAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); distance->setIsDynamic( true ); distance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), QgsPropertyDefinition::DoublePositive ) ); distance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmintersection.cpp b/src/analysis/processing/qgsalgorithmintersection.cpp index deeab5573f02..1ea7dc665cb4 100644 --- a/src/analysis/processing/qgsalgorithmintersection.cpp +++ b/src/analysis/processing/qgsalgorithmintersection.cpp @@ -75,13 +75,13 @@ void QgsIntersectionAlgorithm::initAlgorithm( const QVariantMap & ) QStringLiteral( "OVERLAY" ), Qgis::ProcessingFieldParameterDataType::Any, true, true ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Intersection" ) ) ); - std::unique_ptr gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); gridSize->setFlags( gridSize->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( gridSize.release() ); } diff --git a/src/analysis/processing/qgsalgorithmjoinbyattribute.cpp b/src/analysis/processing/qgsalgorithmjoinbyattribute.cpp index f599dd7d9137..4382b22e4adb 100644 --- a/src/analysis/processing/qgsalgorithmjoinbyattribute.cpp +++ b/src/analysis/processing/qgsalgorithmjoinbyattribute.cpp @@ -66,7 +66,7 @@ void QgsJoinByAttributeAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Joined layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, true ) ); - std::unique_ptr nonMatchingSink = std::make_unique( + auto nonMatchingSink = std::make_unique( QStringLiteral( "NON_MATCHING" ), QObject::tr( "Unjoinable features from first layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ); // TODO GUI doesn't support advanced outputs yet diff --git a/src/analysis/processing/qgsalgorithmjoinbylocation.cpp b/src/analysis/processing/qgsalgorithmjoinbylocation.cpp index aaeefade03ed..d4f819315f77 100644 --- a/src/analysis/processing/qgsalgorithmjoinbylocation.cpp +++ b/src/analysis/processing/qgsalgorithmjoinbylocation.cpp @@ -30,7 +30,7 @@ void QgsJoinByLocationAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Join to features in" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorAnyGeometry ) ) ); - std::unique_ptr predicateParam = std::make_unique( QStringLiteral( "PREDICATE" ), QObject::tr( "Features they (geometric predicate)" ), translatedPredicates(), true, 0 ); + auto predicateParam = std::make_unique( QStringLiteral( "PREDICATE" ), QObject::tr( "Features they (geometric predicate)" ), translatedPredicates(), true, 0 ); QVariantMap predicateMetadata; QVariantMap widgetMetadata; widgetMetadata.insert( QStringLiteral( "useCheckBoxes" ), true ); diff --git a/src/analysis/processing/qgsalgorithmjoinbylocationsummary.cpp b/src/analysis/processing/qgsalgorithmjoinbylocationsummary.cpp index 7ac1b525d4fc..b4b24f607c05 100644 --- a/src/analysis/processing/qgsalgorithmjoinbylocationsummary.cpp +++ b/src/analysis/processing/qgsalgorithmjoinbylocationsummary.cpp @@ -33,7 +33,7 @@ void QgsJoinByLocationSummaryAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Join to features in" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorAnyGeometry ) ) ); - std::unique_ptr predicateParam = std::make_unique( QStringLiteral( "PREDICATE" ), QObject::tr( "Where the features" ), QgsJoinByLocationAlgorithm::translatedPredicates(), true, 0 ); + auto predicateParam = std::make_unique( QStringLiteral( "PREDICATE" ), QObject::tr( "Where the features" ), QgsJoinByLocationAlgorithm::translatedPredicates(), true, 0 ); QVariantMap predicateMetadata; QVariantMap widgetMetadata; widgetMetadata.insert( QStringLiteral( "useCheckBoxes" ), true ); @@ -66,7 +66,7 @@ void QgsJoinByLocationSummaryAlgorithm::initAlgorithm( const QVariantMap & ) << QObject::tr( "max_length" ) << QObject::tr( "mean_length" ); - std::unique_ptr summaryParam = std::make_unique( QStringLiteral( "SUMMARIES" ), QObject::tr( "Summaries to calculate (leave empty to use all available)" ), mAllSummaries, true, QVariant(), true ); + auto summaryParam = std::make_unique( QStringLiteral( "SUMMARIES" ), QObject::tr( "Summaries to calculate (leave empty to use all available)" ), mAllSummaries, true, QVariant(), true ); addParameter( summaryParam.release() ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "DISCARD_NONMATCHING" ), QObject::tr( "Discard records which could not be joined" ), false ) ); diff --git a/src/analysis/processing/qgsalgorithmjoinbynearest.cpp b/src/analysis/processing/qgsalgorithmjoinbynearest.cpp index e5356331cb9f..e4ccc17a0aaf 100644 --- a/src/analysis/processing/qgsalgorithmjoinbynearest.cpp +++ b/src/analysis/processing/qgsalgorithmjoinbynearest.cpp @@ -65,7 +65,7 @@ void QgsJoinByNearestAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Joined layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, true ) ); - std::unique_ptr nonMatchingSink = std::make_unique( + auto nonMatchingSink = std::make_unique( QStringLiteral( "NON_MATCHING" ), QObject::tr( "Unjoinable features from first layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true, false ); // TODO GUI doesn't support advanced outputs yet diff --git a/src/analysis/processing/qgsalgorithmjoinwithlines.cpp b/src/analysis/processing/qgsalgorithmjoinwithlines.cpp index de5db0a2470e..d9b474d551ec 100644 --- a/src/analysis/processing/qgsalgorithmjoinwithlines.cpp +++ b/src/analysis/processing/qgsalgorithmjoinwithlines.cpp @@ -292,8 +292,8 @@ QVariantMap QgsJoinWithLinesAlgorithm::processAlgorithm( const QVariantMap ¶ distance = geodesicDistanceProperty.valueAsDouble( expressionContext, distance ); } - std::unique_ptr ml = std::make_unique(); - std::unique_ptr l = std::make_unique( QVector() << hubPoint ); + auto ml = std::make_unique(); + auto l = std::make_unique( QVector() << hubPoint ); const QVector> points = da.geodesicLine( QgsPointXY( hubPoint ), QgsPointXY( spokePoint ), distance, splitAntimeridian ); QVector points1 = points.at( 0 ); points1.pop_front(); diff --git a/src/analysis/processing/qgsalgorithmkeepnbiggestparts.cpp b/src/analysis/processing/qgsalgorithmkeepnbiggestparts.cpp index b642c58f1074..0c5082546c37 100644 --- a/src/analysis/processing/qgsalgorithmkeepnbiggestparts.cpp +++ b/src/analysis/processing/qgsalgorithmkeepnbiggestparts.cpp @@ -82,7 +82,7 @@ Qgis::ProcessingFeatureSourceFlags QgsKeepNBiggestPartsAlgorithm::sourceFlags() void QgsKeepNBiggestPartsAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr partsToKeep = std::make_unique( QStringLiteral( "PARTS" ), QObject::tr( "Parts to keep" ), Qgis::ProcessingNumberParameterType::Integer, 1.0, false, 1.0 ); + auto partsToKeep = std::make_unique( QStringLiteral( "PARTS" ), QObject::tr( "Parts to keep" ), Qgis::ProcessingNumberParameterType::Integer, 1.0, false, 1.0 ); partsToKeep->setIsDynamic( true ); partsToKeep->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "PARTS" ), QObject::tr( "Parts to keep" ), QgsPropertyDefinition::IntegerPositive ) ); partsToKeep->setDynamicLayerParameterName( QStringLiteral( "POLYGONS" ) ); diff --git a/src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp b/src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp index eaa824f5a8e8..c58c7f7ada1a 100644 --- a/src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp +++ b/src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp @@ -79,7 +79,7 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFile( QStringLiteral( "FOLDER" ), QObject::tr( "Output folder" ), Qgis::ProcessingFileParameterBehavior::Folder ) ); - std::unique_ptr layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); + auto layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( layersParam.release() ); @@ -91,23 +91,23 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & ) continue; imageFormats << QString( format ); } - std::unique_ptr extensionParam = std::make_unique( QStringLiteral( "EXTENSION" ), QObject::tr( "Image format" ), imageFormats, false, imageFormats.indexOf( QLatin1String( "png" ) ) ); + auto extensionParam = std::make_unique( QStringLiteral( "EXTENSION" ), QObject::tr( "Image format" ), imageFormats, false, imageFormats.indexOf( QLatin1String( "png" ) ) ); extensionParam->setFlags( extensionParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( extensionParam.release() ); - std::unique_ptr dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( dpiParam.release() ); - std::unique_ptr appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Generate world file" ), true ); + auto appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Generate world file" ), true ); appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( appendGeorefParam.release() ); - std::unique_ptr exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); + auto exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( exportRDFParam.release() ); - std::unique_ptr antialias = std::make_unique( QStringLiteral( "ANTIALIAS" ), QObject::tr( "Enable antialiasing" ), true ); + auto antialias = std::make_unique( QStringLiteral( "ANTIALIAS" ), QObject::tr( "Enable antialiasing" ), true ); antialias->setFlags( antialias->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( antialias.release() ); } diff --git a/src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp b/src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp index a8b3fbd90584..f678c6c2bec1 100644 --- a/src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp +++ b/src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp @@ -57,35 +57,35 @@ void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterExpression( QStringLiteral( "SORTBY_EXPRESSION" ), QObject::tr( "Sort expression" ), QString(), QStringLiteral( "COVERAGE_LAYER" ), true ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "SORTBY_REVERSE" ), QObject::tr( "Reverse sort order (used when a sort expression is provided)" ), false ) ); - std::unique_ptr layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); + auto layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( layersParam.release() ); - std::unique_ptr dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( dpiParam.release() ); - std::unique_ptr forceVectorParam = std::make_unique( QStringLiteral( "FORCE_VECTOR" ), QObject::tr( "Always export as vectors" ), false ); + auto forceVectorParam = std::make_unique( QStringLiteral( "FORCE_VECTOR" ), QObject::tr( "Always export as vectors" ), false ); forceVectorParam->setFlags( forceVectorParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( forceVectorParam.release() ); - std::unique_ptr forceRasterParam = std::make_unique( QStringLiteral( "FORCE_RASTER" ), QObject::tr( "Always export as raster" ), false ); + auto forceRasterParam = std::make_unique( QStringLiteral( "FORCE_RASTER" ), QObject::tr( "Always export as raster" ), false ); forceRasterParam->setFlags( forceRasterParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( forceRasterParam.release() ); - std::unique_ptr appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Append georeference information" ), true ); + auto appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Append georeference information" ), true ); appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( appendGeorefParam.release() ); - std::unique_ptr exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); + auto exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( exportRDFParam.release() ); - std::unique_ptr disableTiled = std::make_unique( QStringLiteral( "DISABLE_TILED" ), QObject::tr( "Disable tiled raster layer exports" ), false ); + auto disableTiled = std::make_unique( QStringLiteral( "DISABLE_TILED" ), QObject::tr( "Disable tiled raster layer exports" ), false ); disableTiled->setFlags( disableTiled->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( disableTiled.release() ); - std::unique_ptr simplify = std::make_unique( QStringLiteral( "SIMPLIFY" ), QObject::tr( "Simplify geometries to reduce output file size" ), true ); + auto simplify = std::make_unique( QStringLiteral( "SIMPLIFY" ), QObject::tr( "Simplify geometries to reduce output file size" ), true ); simplify->setFlags( simplify->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( simplify.release() ); @@ -95,7 +95,7 @@ void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & ) QObject::tr( "Prefer Exporting Text as Text Objects" ), }; - std::unique_ptr textFormat = std::make_unique( QStringLiteral( "TEXT_FORMAT" ), QObject::tr( "Text export" ), textExportOptions, false, 0 ); + auto textFormat = std::make_unique( QStringLiteral( "TEXT_FORMAT" ), QObject::tr( "Text export" ), textExportOptions, false, 0 ); textFormat->setFlags( textFormat->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( textFormat.release() ); @@ -104,7 +104,7 @@ void QgsLayoutAtlasToPdfAlgorithmBase::initAlgorithm( const QVariantMap & ) QObject::tr( "Lossless" ) }; - std::unique_ptr imageCompression = std::make_unique( QStringLiteral( "IMAGE_COMPRESSION" ), QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 ); + auto imageCompression = std::make_unique( QStringLiteral( "IMAGE_COMPRESSION" ), QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 ); imageCompression->setFlags( imageCompression->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( imageCompression.release() ); } diff --git a/src/analysis/processing/qgsalgorithmlayouttoimage.cpp b/src/analysis/processing/qgsalgorithmlayouttoimage.cpp index c493f0c151ac..9aa2e40d7448 100644 --- a/src/analysis/processing/qgsalgorithmlayouttoimage.cpp +++ b/src/analysis/processing/qgsalgorithmlayouttoimage.cpp @@ -64,23 +64,23 @@ void QgsLayoutToImageAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterLayout( QStringLiteral( "LAYOUT" ), QObject::tr( "Print layout" ) ) ); - std::unique_ptr layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); + auto layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( layersParam.release() ); - std::unique_ptr dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( dpiParam.release() ); - std::unique_ptr appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Generate world file" ), true ); + auto appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Generate world file" ), true ); appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( appendGeorefParam.release() ); - std::unique_ptr exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); + auto exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( exportRDFParam.release() ); - std::unique_ptr antialias = std::make_unique( QStringLiteral( "ANTIALIAS" ), QObject::tr( "Enable antialiasing" ), true ); + auto antialias = std::make_unique( QStringLiteral( "ANTIALIAS" ), QObject::tr( "Enable antialiasing" ), true ); antialias->setFlags( antialias->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( antialias.release() ); diff --git a/src/analysis/processing/qgsalgorithmlayouttopdf.cpp b/src/analysis/processing/qgsalgorithmlayouttopdf.cpp index 855c5b28987a..506c156ffebc 100644 --- a/src/analysis/processing/qgsalgorithmlayouttopdf.cpp +++ b/src/analysis/processing/qgsalgorithmlayouttopdf.cpp @@ -63,35 +63,35 @@ void QgsLayoutToPdfAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterLayout( QStringLiteral( "LAYOUT" ), QObject::tr( "Print layout" ) ) ); - std::unique_ptr layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); + auto layersParam = std::make_unique( QStringLiteral( "LAYERS" ), QObject::tr( "Map layers to assign to unlocked map item(s)" ), Qgis::ProcessingSourceType::MapLayer, QVariant(), true ); layersParam->setFlags( layersParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( layersParam.release() ); - std::unique_ptr dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto dpiParam = std::make_unique( QStringLiteral( "DPI" ), QObject::tr( "DPI (leave blank for default layout DPI)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( dpiParam.release() ); - std::unique_ptr forceVectorParam = std::make_unique( QStringLiteral( "FORCE_VECTOR" ), QObject::tr( "Always export as vectors" ), false ); + auto forceVectorParam = std::make_unique( QStringLiteral( "FORCE_VECTOR" ), QObject::tr( "Always export as vectors" ), false ); forceVectorParam->setFlags( forceVectorParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( forceVectorParam.release() ); - std::unique_ptr forceRasterParam = std::make_unique( QStringLiteral( "FORCE_RASTER" ), QObject::tr( "Always export as raster" ), false ); + auto forceRasterParam = std::make_unique( QStringLiteral( "FORCE_RASTER" ), QObject::tr( "Always export as raster" ), false ); forceRasterParam->setFlags( forceRasterParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( forceRasterParam.release() ); - std::unique_ptr appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Append georeference information" ), true ); + auto appendGeorefParam = std::make_unique( QStringLiteral( "GEOREFERENCE" ), QObject::tr( "Append georeference information" ), true ); appendGeorefParam->setFlags( appendGeorefParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( appendGeorefParam.release() ); - std::unique_ptr exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); + auto exportRDFParam = std::make_unique( QStringLiteral( "INCLUDE_METADATA" ), QObject::tr( "Export RDF metadata (title, author, etc.)" ), true ); exportRDFParam->setFlags( exportRDFParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( exportRDFParam.release() ); - std::unique_ptr disableTiled = std::make_unique( QStringLiteral( "DISABLE_TILED" ), QObject::tr( "Disable tiled raster layer exports" ), false ); + auto disableTiled = std::make_unique( QStringLiteral( "DISABLE_TILED" ), QObject::tr( "Disable tiled raster layer exports" ), false ); disableTiled->setFlags( disableTiled->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( disableTiled.release() ); - std::unique_ptr simplify = std::make_unique( QStringLiteral( "SIMPLIFY" ), QObject::tr( "Simplify geometries to reduce output file size" ), true ); + auto simplify = std::make_unique( QStringLiteral( "SIMPLIFY" ), QObject::tr( "Simplify geometries to reduce output file size" ), true ); simplify->setFlags( simplify->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( simplify.release() ); @@ -101,7 +101,7 @@ void QgsLayoutToPdfAlgorithm::initAlgorithm( const QVariantMap & ) QObject::tr( "Prefer Exporting Text as Text Objects" ) }; - std::unique_ptr textFormat = std::make_unique( QStringLiteral( "TEXT_FORMAT" ), QObject::tr( "Text export" ), textExportOptions, false, 0 ); + auto textFormat = std::make_unique( QStringLiteral( "TEXT_FORMAT" ), QObject::tr( "Text export" ), textExportOptions, false, 0 ); textFormat->setFlags( textFormat->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( textFormat.release() ); @@ -110,11 +110,11 @@ void QgsLayoutToPdfAlgorithm::initAlgorithm( const QVariantMap & ) QObject::tr( "Lossless" ) }; - std::unique_ptr imageCompression = std::make_unique( QStringLiteral( "IMAGE_COMPRESSION" ), QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 ); + auto imageCompression = std::make_unique( QStringLiteral( "IMAGE_COMPRESSION" ), QObject::tr( "Image compression" ), imageCompressionOptions, false, 0 ); imageCompression->setFlags( imageCompression->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( imageCompression.release() ); - std::unique_ptr layeredExport = std::make_unique( QStringLiteral( "SEPARATE_LAYERS" ), QObject::tr( "Export layers as separate PDF files" ), false ); + auto layeredExport = std::make_unique( QStringLiteral( "SEPARATE_LAYERS" ), QObject::tr( "Export layers as separate PDF files" ), false ); layeredExport->setFlags( layeredExport->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( layeredExport.release() ); diff --git a/src/analysis/processing/qgsalgorithmlinedensity.cpp b/src/analysis/processing/qgsalgorithmlinedensity.cpp index 16430aa9c507..5b80afa9a43d 100644 --- a/src/analysis/processing/qgsalgorithmlinedensity.cpp +++ b/src/analysis/processing/qgsalgorithmlinedensity.cpp @@ -54,7 +54,7 @@ void QgsLineDensityAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterDistance( QStringLiteral( "RADIUS" ), QObject::tr( "Search radius" ), 10, QStringLiteral( "INPUT" ), false, 0 ) ); addParameter( new QgsProcessingParameterDistance( QStringLiteral( "PIXEL_SIZE" ), QObject::tr( "Pixel size" ), 10, QStringLiteral( "INPUT" ), false ) ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -162,7 +162,7 @@ QVariantMap QgsLineDensityAlgorithm::processAlgorithm( const QVariantMap ¶me const qgssize totalCellcnt = static_cast( rows ) * cols; int cellcnt = 0; - std::unique_ptr rasterDataLine = std::make_unique( Qgis::DataType::Float32, cols, 1 ); + auto rasterDataLine = std::make_unique( Qgis::DataType::Float32, cols, 1 ); for ( int row = 0; row < rows; row++ ) { diff --git a/src/analysis/processing/qgsalgorithmlineintersection.cpp b/src/analysis/processing/qgsalgorithmlineintersection.cpp index 4c15e9351ece..52e56ffefbdb 100644 --- a/src/analysis/processing/qgsalgorithmlineintersection.cpp +++ b/src/analysis/processing/qgsalgorithmlineintersection.cpp @@ -64,7 +64,7 @@ void QgsLineIntersectionAlgorithm::initAlgorithm( const QVariantMap & ) true, true ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "INTERSECT_FIELDS_PREFIX" ), QObject::tr( "Intersect fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "INTERSECT_FIELDS_PREFIX" ), QObject::tr( "Intersect fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); diff --git a/src/analysis/processing/qgsalgorithmlinesubstring.cpp b/src/analysis/processing/qgsalgorithmlinesubstring.cpp index bb81966bd5ad..cede413e8d96 100644 --- a/src/analysis/processing/qgsalgorithmlinesubstring.cpp +++ b/src/analysis/processing/qgsalgorithmlinesubstring.cpp @@ -83,13 +83,13 @@ QgsLineSubstringAlgorithm *QgsLineSubstringAlgorithm::createInstance() const void QgsLineSubstringAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr startDistance = std::make_unique( QStringLiteral( "START_DISTANCE" ), QObject::tr( "Start distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto startDistance = std::make_unique( QStringLiteral( "START_DISTANCE" ), QObject::tr( "Start distance" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); startDistance->setIsDynamic( true ); startDistance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Start Distance" ), QObject::tr( "Start distance" ), QgsPropertyDefinition::DoublePositive ) ); startDistance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( startDistance.release() ); - std::unique_ptr endDistance = std::make_unique( QStringLiteral( "END_DISTANCE" ), QObject::tr( "End distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0 ); + auto endDistance = std::make_unique( QStringLiteral( "END_DISTANCE" ), QObject::tr( "End distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0 ); endDistance->setIsDynamic( true ); endDistance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "End Distance" ), QObject::tr( "End distance" ), QgsPropertyDefinition::DoublePositive ) ); endDistance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmmeshsurfacetopolygon.cpp b/src/analysis/processing/qgsalgorithmmeshsurfacetopolygon.cpp index 7f1d0a1b8589..9ebdf4ba3933 100644 --- a/src/analysis/processing/qgsalgorithmmeshsurfacetopolygon.cpp +++ b/src/analysis/processing/qgsalgorithmmeshsurfacetopolygon.cpp @@ -268,7 +268,7 @@ QVariantMap QgsMeshSurfaceToPolygonAlgorithm::processAlgorithm( const QVariantMa } // create resulting multipolygon - std::unique_ptr multiPolygon = std::make_unique(); + auto multiPolygon = std::make_unique(); multiPolygon->addGeometries( polygons ); if ( feedback ) diff --git a/src/analysis/processing/qgsalgorithmmultiintersection.cpp b/src/analysis/processing/qgsalgorithmmultiintersection.cpp index 7170e0c9ed29..2aa1ce177ec4 100644 --- a/src/analysis/processing/qgsalgorithmmultiintersection.cpp +++ b/src/analysis/processing/qgsalgorithmmultiintersection.cpp @@ -70,7 +70,7 @@ void QgsMultiIntersectionAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "OVERLAYS" ), QObject::tr( "Overlay layers" ), Qgis::ProcessingSourceType::VectorAnyGeometry ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); diff --git a/src/analysis/processing/qgsalgorithmmultiringconstantbuffer.cpp b/src/analysis/processing/qgsalgorithmmultiringconstantbuffer.cpp index 9c3982503a8b..3a86a939e7d0 100644 --- a/src/analysis/processing/qgsalgorithmmultiringconstantbuffer.cpp +++ b/src/analysis/processing/qgsalgorithmmultiringconstantbuffer.cpp @@ -67,13 +67,13 @@ QgsMultiRingConstantBufferAlgorithm *QgsMultiRingConstantBufferAlgorithm::create void QgsMultiRingConstantBufferAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr rings = std::make_unique( QStringLiteral( "RINGS" ), QObject::tr( "Number of rings" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 0 ); + auto rings = std::make_unique( QStringLiteral( "RINGS" ), QObject::tr( "Number of rings" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 0 ); rings->setIsDynamic( true ); rings->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "RINGS" ), QObject::tr( "Number of rings" ), QgsPropertyDefinition::IntegerPositive ) ); rings->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( rings.release() ); - std::unique_ptr distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance between rings" ), 1, QStringLiteral( "INPUT" ), false ); + auto distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance between rings" ), 1, QStringLiteral( "INPUT" ), false ); distance->setIsDynamic( true ); distance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance between rings" ), QgsPropertyDefinition::DoublePositive ) ); distance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmmultiunion.cpp b/src/analysis/processing/qgsalgorithmmultiunion.cpp index 880df9406b22..63bb82b73e66 100644 --- a/src/analysis/processing/qgsalgorithmmultiunion.cpp +++ b/src/analysis/processing/qgsalgorithmmultiunion.cpp @@ -75,7 +75,7 @@ void QgsMultiUnionAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "OVERLAYS" ), QObject::tr( "Overlay layers" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); diff --git a/src/analysis/processing/qgsalgorithmnetworkanalysisbase.cpp b/src/analysis/processing/qgsalgorithmnetworkanalysisbase.cpp index fd43274e4eae..b1e21a44c0c8 100644 --- a/src/analysis/processing/qgsalgorithmnetworkanalysisbase.cpp +++ b/src/analysis/processing/qgsalgorithmnetworkanalysisbase.cpp @@ -49,31 +49,31 @@ void QgsNetworkAnalysisAlgorithmBase::addCommonParams() addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Vector layer representing network" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorLine ) ) ); addParameter( new QgsProcessingParameterEnum( QStringLiteral( "STRATEGY" ), QObject::tr( "Path type to calculate" ), QStringList() << QObject::tr( "Shortest" ) << QObject::tr( "Fastest" ), false, 0 ) ); - std::unique_ptr directionField = std::make_unique( QStringLiteral( "DIRECTION_FIELD" ), QObject::tr( "Direction field" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Any, false, true ); + auto directionField = std::make_unique( QStringLiteral( "DIRECTION_FIELD" ), QObject::tr( "Direction field" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Any, false, true ); directionField->setFlags( directionField->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( directionField.release() ); - std::unique_ptr forwardValue = std::make_unique( QStringLiteral( "VALUE_FORWARD" ), QObject::tr( "Value for forward direction" ), QVariant(), false, true ); + auto forwardValue = std::make_unique( QStringLiteral( "VALUE_FORWARD" ), QObject::tr( "Value for forward direction" ), QVariant(), false, true ); forwardValue->setFlags( forwardValue->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( forwardValue.release() ); - std::unique_ptr backwardValue = std::make_unique( QStringLiteral( "VALUE_BACKWARD" ), QObject::tr( "Value for backward direction" ), QVariant(), false, true ); + auto backwardValue = std::make_unique( QStringLiteral( "VALUE_BACKWARD" ), QObject::tr( "Value for backward direction" ), QVariant(), false, true ); backwardValue->setFlags( backwardValue->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( backwardValue.release() ); - std::unique_ptr bothValue = std::make_unique( QStringLiteral( "VALUE_BOTH" ), QObject::tr( "Value for both directions" ), QVariant(), false, true ); + auto bothValue = std::make_unique( QStringLiteral( "VALUE_BOTH" ), QObject::tr( "Value for both directions" ), QVariant(), false, true ); bothValue->setFlags( bothValue->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( bothValue.release() ); - std::unique_ptr directionValue = std::make_unique( QStringLiteral( "DEFAULT_DIRECTION" ), QObject::tr( "Default direction" ), QStringList() << QObject::tr( "Forward direction" ) << QObject::tr( "Backward direction" ) << QObject::tr( "Both directions" ), false, 2 ); + auto directionValue = std::make_unique( QStringLiteral( "DEFAULT_DIRECTION" ), QObject::tr( "Default direction" ), QStringList() << QObject::tr( "Forward direction" ) << QObject::tr( "Backward direction" ) << QObject::tr( "Both directions" ), false, 2 ); directionValue->setFlags( directionValue->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( directionValue.release() ); - std::unique_ptr speedField = std::make_unique( QStringLiteral( "SPEED_FIELD" ), QObject::tr( "Speed field" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Numeric, false, true ); + auto speedField = std::make_unique( QStringLiteral( "SPEED_FIELD" ), QObject::tr( "Speed field" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Numeric, false, true ); speedField->setFlags( speedField->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( speedField.release() ); - std::unique_ptr speed = std::make_unique( QStringLiteral( "DEFAULT_SPEED" ), QObject::tr( "Default speed (km/h)" ), Qgis::ProcessingNumberParameterType::Double, 50, false, 0 ); + auto speed = std::make_unique( QStringLiteral( "DEFAULT_SPEED" ), QObject::tr( "Default speed (km/h)" ), Qgis::ProcessingNumberParameterType::Double, 50, false, 0 ); speed->setFlags( speed->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( speed.release() ); diff --git a/src/analysis/processing/qgsalgorithmoffsetlines.cpp b/src/analysis/processing/qgsalgorithmoffsetlines.cpp index 34b9f0c37293..31146ca06621 100644 --- a/src/analysis/processing/qgsalgorithmoffsetlines.cpp +++ b/src/analysis/processing/qgsalgorithmoffsetlines.cpp @@ -82,7 +82,7 @@ QgsOffsetLinesAlgorithm *QgsOffsetLinesAlgorithm::createInstance() const void QgsOffsetLinesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr offset = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 10.0, QStringLiteral( "INPUT" ) ); + auto offset = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 10.0, QStringLiteral( "INPUT" ) ); offset->setIsDynamic( true ); offset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), QgsPropertyDefinition::Double ) ); offset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmorthogonalize.cpp b/src/analysis/processing/qgsalgorithmorthogonalize.cpp index 0ddc60602a43..8e1be3dfbf57 100644 --- a/src/analysis/processing/qgsalgorithmorthogonalize.cpp +++ b/src/analysis/processing/qgsalgorithmorthogonalize.cpp @@ -85,7 +85,7 @@ void QgsOrthogonalizeAlgorithm::initParameters( const QVariantMap & ) angleToleranceParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( angleToleranceParam.release() ); - std::unique_ptr maxIterations = std::make_unique( + auto maxIterations = std::make_unique( QStringLiteral( "MAX_ITERATIONS" ), QObject::tr( "Maximum algorithm iterations" ), Qgis::ProcessingNumberParameterType::Integer, diff --git a/src/analysis/processing/qgsalgorithmpackage.cpp b/src/analysis/processing/qgsalgorithmpackage.cpp index 1260fdfff64c..673072987999 100644 --- a/src/analysis/processing/qgsalgorithmpackage.cpp +++ b/src/analysis/processing/qgsalgorithmpackage.cpp @@ -457,7 +457,7 @@ bool QgsPackageAlgorithm::packageVectorLayer( QgsVectorLayer *layer, const QStri { if ( saveStyles ) { - std::unique_ptr res = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( newFilename, newLayer ) ); + auto res = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( newFilename, newLayer ) ); if ( res ) { QString errorMsg; diff --git a/src/analysis/processing/qgsalgorithmpixelcentroidsfrompolygons.cpp b/src/analysis/processing/qgsalgorithmpixelcentroidsfrompolygons.cpp index 33a61358c60e..db9957db8905 100644 --- a/src/analysis/processing/qgsalgorithmpixelcentroidsfrompolygons.cpp +++ b/src/analysis/processing/qgsalgorithmpixelcentroidsfrompolygons.cpp @@ -130,7 +130,7 @@ QVariantMap QgsPixelCentroidsFromPolygonsAlgorithm::processAlgorithm( const QVar QgsRasterAnalysisUtils::mapToPixel( xMin, yMax, extent, xPixel, yPixel, startRow, startColumn ); QgsRasterAnalysisUtils::mapToPixel( xMax, yMin, extent, xPixel, yPixel, endRow, endColumn ); - std::unique_ptr engine = std::make_unique( f.geometry().constGet() ); + auto engine = std::make_unique( f.geometry().constGet() ); engine->prepareGeometry(); for ( int row = startRow; row <= endRow; row++ ) diff --git a/src/analysis/processing/qgsalgorithmpointonsurface.cpp b/src/analysis/processing/qgsalgorithmpointonsurface.cpp index 6fc6eceb1ef1..9f771350d602 100644 --- a/src/analysis/processing/qgsalgorithmpointonsurface.cpp +++ b/src/analysis/processing/qgsalgorithmpointonsurface.cpp @@ -75,7 +75,7 @@ QgsPointOnSurfaceAlgorithm *QgsPointOnSurfaceAlgorithm::createInstance() const void QgsPointOnSurfaceAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr allParts = std::make_unique( + auto allParts = std::make_unique( QStringLiteral( "ALL_PARTS" ), QObject::tr( "Create point on surface for each part" ), false diff --git a/src/analysis/processing/qgsalgorithmpointsalonggeometry.cpp b/src/analysis/processing/qgsalgorithmpointsalonggeometry.cpp index 938e2071b08f..7c4d8f372b23 100644 --- a/src/analysis/processing/qgsalgorithmpointsalonggeometry.cpp +++ b/src/analysis/processing/qgsalgorithmpointsalonggeometry.cpp @@ -106,19 +106,19 @@ QgsPointsAlongGeometryAlgorithm *QgsPointsAlongGeometryAlgorithm::createInstance void QgsPointsAlongGeometryAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0 ); + auto distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0 ); distance->setIsDynamic( true ); distance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), QgsPropertyDefinition::DoublePositive ) ); distance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( distance.release() ); - std::unique_ptr startOffset = std::make_unique( QStringLiteral( "START_OFFSET" ), QObject::tr( "Start offset" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto startOffset = std::make_unique( QStringLiteral( "START_OFFSET" ), QObject::tr( "Start offset" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); startOffset->setIsDynamic( true ); startOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "START_OFFSET" ), QObject::tr( "Start offset" ), QgsPropertyDefinition::DoublePositive ) ); startOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( startOffset.release() ); - std::unique_ptr endOffset = std::make_unique( QStringLiteral( "END_OFFSET" ), QObject::tr( "End offset" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto endOffset = std::make_unique( QStringLiteral( "END_OFFSET" ), QObject::tr( "End offset" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); endOffset->setIsDynamic( true ); endOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "END_OFFSET" ), QObject::tr( "End offset" ), QgsPropertyDefinition::DoublePositive ) ); endOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmprojectpointcartesian.cpp b/src/analysis/processing/qgsalgorithmprojectpointcartesian.cpp index e0cf842d702e..63f2234c8791 100644 --- a/src/analysis/processing/qgsalgorithmprojectpointcartesian.cpp +++ b/src/analysis/processing/qgsalgorithmprojectpointcartesian.cpp @@ -73,13 +73,13 @@ QgsProjectPointCartesianAlgorithm *QgsProjectPointCartesianAlgorithm::createInst void QgsProjectPointCartesianAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr bearing = std::make_unique( QStringLiteral( "BEARING" ), QObject::tr( "Bearing (degrees from North)" ), Qgis::ProcessingNumberParameterType::Double, 0, false ); + auto bearing = std::make_unique( QStringLiteral( "BEARING" ), QObject::tr( "Bearing (degrees from North)" ), Qgis::ProcessingNumberParameterType::Double, 0, false ); bearing->setIsDynamic( true ); bearing->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Bearing" ), QObject::tr( "Bearing (degrees from North)" ), QgsPropertyDefinition::Double ) ); bearing->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( bearing.release() ); - std::unique_ptr distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 1, QStringLiteral( "INPUT" ), false ); + auto distance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Distance" ), 1, QStringLiteral( "INPUT" ), false ); distance->setIsDynamic( true ); distance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Distance" ), QObject::tr( "Projection distance" ), QgsPropertyDefinition::Double ) ); distance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); @@ -122,7 +122,7 @@ QgsFeatureList QgsProjectPointCartesianAlgorithm::processFeature( const QgsFeatu if ( QgsWkbTypes::isMultiType( g.wkbType() ) ) { const QgsMultiPoint *mp = static_cast( g.constGet() ); - std::unique_ptr result = std::make_unique(); + auto result = std::make_unique(); result->reserve( mp->numGeometries() ); for ( int i = 0; i < mp->numGeometries(); ++i ) { diff --git a/src/analysis/processing/qgsalgorithmrandompointsextent.cpp b/src/analysis/processing/qgsalgorithmrandompointsextent.cpp index d6ea62de360d..733713c52470 100644 --- a/src/analysis/processing/qgsalgorithmrandompointsextent.cpp +++ b/src/analysis/processing/qgsalgorithmrandompointsextent.cpp @@ -56,7 +56,7 @@ void QgsRandomPointsExtentAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterDistance( QStringLiteral( "MIN_DISTANCE" ), QObject::tr( "Minimum distance between points" ), 0, QStringLiteral( "TARGET_CRS" ), true, 0 ) ); addParameter( new QgsProcessingParameterCrs( QStringLiteral( "TARGET_CRS" ), QObject::tr( "Target CRS" ), QStringLiteral( "ProjectCrs" ), false ) ); - std::unique_ptr maxAttempts_param = std::make_unique( QStringLiteral( "MAX_ATTEMPTS" ), QObject::tr( "Maximum number of search attempts given the minimum distance" ), Qgis::ProcessingNumberParameterType::Integer, 200, true, 1 ); + auto maxAttempts_param = std::make_unique( QStringLiteral( "MAX_ATTEMPTS" ), QObject::tr( "Maximum number of search attempts given the minimum distance" ), Qgis::ProcessingNumberParameterType::Integer, 200, true, 1 ); maxAttempts_param->setFlags( maxAttempts_param->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( maxAttempts_param.release() ); diff --git a/src/analysis/processing/qgsalgorithmrandompointsinpolygons.cpp b/src/analysis/processing/qgsalgorithmrandompointsinpolygons.cpp index 130fcd3c8edf..24da31a07e0d 100644 --- a/src/analysis/processing/qgsalgorithmrandompointsinpolygons.cpp +++ b/src/analysis/processing/qgsalgorithmrandompointsinpolygons.cpp @@ -51,34 +51,34 @@ QString QgsRandomPointsInPolygonsAlgorithm::groupId() const void QgsRandomPointsInPolygonsAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( INPUT, QObject::tr( "Input polygon layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); - std::unique_ptr numberPointsParam = std::make_unique( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1 ); + auto numberPointsParam = std::make_unique( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1 ); numberPointsParam->setIsDynamic( true ); numberPointsParam->setDynamicPropertyDefinition( QgsPropertyDefinition( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), QgsPropertyDefinition::IntegerPositive ) ); numberPointsParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( numberPointsParam.release() ); - std::unique_ptr minDistParam = std::make_unique( MIN_DISTANCE, QObject::tr( "Minimum distance between points" ), 0, INPUT, true, 0 ); + auto minDistParam = std::make_unique( MIN_DISTANCE, QObject::tr( "Minimum distance between points" ), 0, INPUT, true, 0 ); minDistParam->setIsDynamic( true ); minDistParam->setDynamicPropertyDefinition( QgsPropertyDefinition( MIN_DISTANCE, QObject::tr( "Minimum distance between points" ), QgsPropertyDefinition::DoublePositive ) ); minDistParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( minDistParam.release() ); - std::unique_ptr minDistGlobalParam = std::make_unique( MIN_DISTANCE_GLOBAL, QObject::tr( "Global minimum distance between points" ), 0, INPUT, true, 0 ); + auto minDistGlobalParam = std::make_unique( MIN_DISTANCE_GLOBAL, QObject::tr( "Global minimum distance between points" ), 0, INPUT, true, 0 ); minDistGlobalParam->setFlags( minDistGlobalParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( minDistGlobalParam.release() ); - std::unique_ptr maxAttemptsParam = std::make_unique( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of search attempts (for Min. dist. > 0)" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 1 ); + auto maxAttemptsParam = std::make_unique( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of search attempts (for Min. dist. > 0)" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 1 ); maxAttemptsParam->setFlags( maxAttemptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); maxAttemptsParam->setIsDynamic( true ); maxAttemptsParam->setDynamicPropertyDefinition( QgsPropertyDefinition( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of attempts per point (for Min. dist. > 0)" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); maxAttemptsParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( maxAttemptsParam.release() ); - std::unique_ptr randomSeedParam = std::make_unique( SEED, QObject::tr( "Random seed" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 1 ); + auto randomSeedParam = std::make_unique( SEED, QObject::tr( "Random seed" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 1 ); randomSeedParam->setFlags( randomSeedParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( randomSeedParam.release() ); - std::unique_ptr includePolygonAttrParam = std::make_unique( INCLUDE_POLYGON_ATTRIBUTES, QObject::tr( "Include polygon attributes" ), true ); + auto includePolygonAttrParam = std::make_unique( INCLUDE_POLYGON_ATTRIBUTES, QObject::tr( "Include polygon attributes" ), true ); includePolygonAttrParam->setFlags( includePolygonAttrParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( includePolygonAttrParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmrandompointsonlines.cpp b/src/analysis/processing/qgsalgorithmrandompointsonlines.cpp index fa7fdac9a525..475c3da536a6 100644 --- a/src/analysis/processing/qgsalgorithmrandompointsonlines.cpp +++ b/src/analysis/processing/qgsalgorithmrandompointsonlines.cpp @@ -51,34 +51,34 @@ QString QgsRandomPointsOnLinesAlgorithm::groupId() const void QgsRandomPointsOnLinesAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( INPUT, QObject::tr( "Input line layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorLine ) ) ); - std::unique_ptr numberPointsParam = std::make_unique( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1 ); + auto numberPointsParam = std::make_unique( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1 ); numberPointsParam->setIsDynamic( true ); numberPointsParam->setDynamicPropertyDefinition( QgsPropertyDefinition( POINTS_NUMBER, QObject::tr( "Number of points for each feature" ), QgsPropertyDefinition::IntegerPositive ) ); numberPointsParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( numberPointsParam.release() ); - std::unique_ptr minDistParam = std::make_unique( MIN_DISTANCE, QObject::tr( "Minimum distance between points" ), 0, INPUT, true, 0 ); + auto minDistParam = std::make_unique( MIN_DISTANCE, QObject::tr( "Minimum distance between points" ), 0, INPUT, true, 0 ); minDistParam->setIsDynamic( true ); minDistParam->setDynamicPropertyDefinition( QgsPropertyDefinition( MIN_DISTANCE, QObject::tr( "Minimum distance between points (per feature)" ), QgsPropertyDefinition::DoublePositive ) ); minDistParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( minDistParam.release() ); - std::unique_ptr minDistGlobalParam = std::make_unique( MIN_DISTANCE_GLOBAL, QObject::tr( "Global minimum distance between points" ), 0, INPUT, true, 0 ); + auto minDistGlobalParam = std::make_unique( MIN_DISTANCE_GLOBAL, QObject::tr( "Global minimum distance between points" ), 0, INPUT, true, 0 ); minDistGlobalParam->setFlags( minDistGlobalParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( minDistGlobalParam.release() ); - std::unique_ptr maxAttemptsParam = std::make_unique( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of search attempts (for Min. dist. > 0)" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 1 ); + auto maxAttemptsParam = std::make_unique( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of search attempts (for Min. dist. > 0)" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 1 ); maxAttemptsParam->setFlags( maxAttemptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); maxAttemptsParam->setIsDynamic( true ); maxAttemptsParam->setDynamicPropertyDefinition( QgsPropertyDefinition( MAX_TRIES_PER_POINT, QObject::tr( "Maximum number of search attempts (for Min. dist. > 0)" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); maxAttemptsParam->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( maxAttemptsParam.release() ); - std::unique_ptr randomSeedParam = std::make_unique( SEED, QObject::tr( "Random seed" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 1 ); + auto randomSeedParam = std::make_unique( SEED, QObject::tr( "Random seed" ), Qgis::ProcessingNumberParameterType::Integer, QVariant(), true, 1 ); randomSeedParam->setFlags( randomSeedParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( randomSeedParam.release() ); - std::unique_ptr includeLineAttrParam = std::make_unique( INCLUDE_LINE_ATTRIBUTES, QObject::tr( "Include line attributes" ), true ); + auto includeLineAttrParam = std::make_unique( INCLUDE_LINE_ATTRIBUTES, QObject::tr( "Include line attributes" ), true ); includeLineAttrParam->setFlags( includeLineAttrParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( includeLineAttrParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmrandomraster.cpp b/src/analysis/processing/qgsalgorithmrandomraster.cpp index a5b501e783ce..01769b54a0a2 100644 --- a/src/analysis/processing/qgsalgorithmrandomraster.cpp +++ b/src/analysis/processing/qgsalgorithmrandomraster.cpp @@ -45,7 +45,7 @@ void QgsRandomRasterAlgorithmBase::initAlgorithm( const QVariantMap & ) //add specific parameters addAlgorithmParams(); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -90,7 +90,7 @@ QVariantMap QgsRandomRasterAlgorithmBase::processAlgorithm( const QVariantMap &p //this prevents output cellsize being calculated too small const QgsRectangle rasterExtent = QgsRectangle( mExtent.xMinimum(), mExtent.yMaximum() - ( rows * mPixelSize ), mExtent.xMinimum() + ( cols * mPixelSize ), mExtent.yMaximum() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { @@ -260,11 +260,11 @@ void QgsRandomUniformRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr lowerBoundParameter = std::make_unique( QStringLiteral( "LOWER_BOUND" ), QStringLiteral( "Lower bound for random number range" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ); + auto lowerBoundParameter = std::make_unique( QStringLiteral( "LOWER_BOUND" ), QStringLiteral( "Lower bound for random number range" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ); lowerBoundParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( lowerBoundParameter.release() ); - std::unique_ptr upperBoundParameter = std::make_unique( QStringLiteral( "UPPER_BOUND" ), QStringLiteral( "Upper bound for random number range" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ); + auto upperBoundParameter = std::make_unique( QStringLiteral( "UPPER_BOUND" ), QStringLiteral( "Upper bound for random number range" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ); upperBoundParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( upperBoundParameter.release() ); } @@ -451,11 +451,11 @@ void QgsRandomBinomialRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr nParameter = std::make_unique( QStringLiteral( "N" ), QStringLiteral( "N" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 0 ); + auto nParameter = std::make_unique( QStringLiteral( "N" ), QStringLiteral( "N" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 0 ); nParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( nParameter.release() ); - std::unique_ptr probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0 ); + auto probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0 ); probabilityParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( probabilityParameter.release() ); } @@ -543,7 +543,7 @@ void QgsRandomExponentialRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr lambdaParameter = std::make_unique( QStringLiteral( "LAMBDA" ), QStringLiteral( "Lambda" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); + auto lambdaParameter = std::make_unique( QStringLiteral( "LAMBDA" ), QStringLiteral( "Lambda" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); lambdaParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( lambdaParameter.release() ); } @@ -622,11 +622,11 @@ void QgsRandomGammaRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr alphaParameter = std::make_unique( QStringLiteral( "ALPHA" ), QStringLiteral( "Alpha" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); + auto alphaParameter = std::make_unique( QStringLiteral( "ALPHA" ), QStringLiteral( "Alpha" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); alphaParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( alphaParameter.release() ); - std::unique_ptr betaParameter = std::make_unique( QStringLiteral( "BETA" ), QStringLiteral( "Beta" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); + auto betaParameter = std::make_unique( QStringLiteral( "BETA" ), QStringLiteral( "Beta" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0.000001 ); betaParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( betaParameter.release() ); } @@ -712,7 +712,7 @@ void QgsRandomGeometricRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0.00001 ); + auto probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0.00001 ); probabilityParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( probabilityParameter.release() ); } @@ -806,11 +806,11 @@ void QgsRandomNegativeBinomialRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr kParameter = std::make_unique( QStringLiteral( "K_PARAMETER" ), QStringLiteral( "Distribution parameter k" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 0.00001 ); + auto kParameter = std::make_unique( QStringLiteral( "K_PARAMETER" ), QStringLiteral( "Distribution parameter k" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 0.00001 ); kParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( kParameter.release() ); - std::unique_ptr probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0.00001 ); + auto probabilityParameter = std::make_unique( QStringLiteral( "PROBABILITY" ), QStringLiteral( "Probability" ), Qgis::ProcessingNumberParameterType::Double, 0.5, true, 0.00001 ); probabilityParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( probabilityParameter.release() ); } @@ -898,11 +898,11 @@ void QgsRandomNormalRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr meanParameter = std::make_unique( QStringLiteral( "MEAN" ), QStringLiteral( "Mean of normal distribution" ), Qgis::ProcessingNumberParameterType::Double, 0, true ); + auto meanParameter = std::make_unique( QStringLiteral( "MEAN" ), QStringLiteral( "Mean of normal distribution" ), Qgis::ProcessingNumberParameterType::Double, 0, true ); meanParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( meanParameter.release() ); - std::unique_ptr stdevParameter = std::make_unique( QStringLiteral( "STDDEV" ), QStringLiteral( "Standard deviation of normal distribution" ), Qgis::ProcessingNumberParameterType::Double, 1, true, 0 ); + auto stdevParameter = std::make_unique( QStringLiteral( "STDDEV" ), QStringLiteral( "Standard deviation of normal distribution" ), Qgis::ProcessingNumberParameterType::Double, 1, true, 0 ); stdevParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( stdevParameter.release() ); } @@ -987,7 +987,7 @@ void QgsRandomPoissonRasterAlgorithm::addAlgorithmParams() rasterTypeParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( rasterTypeParameter.release() ); - std::unique_ptr upperBoundParameter = std::make_unique( QStringLiteral( "MEAN" ), QStringLiteral( "Mean" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0 ); + auto upperBoundParameter = std::make_unique( QStringLiteral( "MEAN" ), QStringLiteral( "Mean" ), Qgis::ProcessingNumberParameterType::Double, 1.0, true, 0 ); upperBoundParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( upperBoundParameter.release() ); } diff --git a/src/analysis/processing/qgsalgorithmrastercalculator.cpp b/src/analysis/processing/qgsalgorithmrastercalculator.cpp index f51acd1501e3..f52bd796fbd4 100644 --- a/src/analysis/processing/qgsalgorithmrastercalculator.cpp +++ b/src/analysis/processing/qgsalgorithmrastercalculator.cpp @@ -65,13 +65,13 @@ void QgsRasterCalculatorAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "LAYERS" ), QObject::tr( "Input layers" ), Qgis::ProcessingSourceType::Raster ) ); addParameter( new QgsProcessingParameterExpression( QStringLiteral( "EXPRESSION" ), QObject::tr( "Expression" ), QVariant(), QStringLiteral( "LAYERS" ), false, Qgis::ExpressionType::RasterCalculator ) ); - std::unique_ptr extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Output extent" ), QVariant(), true ); + auto extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Output extent" ), QVariant(), true ); extentParam->setHelp( QObject::tr( "Extent of the output layer. If not specified, the extent will be the overall extent of all input layers" ) ); addParameter( extentParam.release() ); - std::unique_ptr cellSizeParam = std::make_unique( QStringLiteral( "CELL_SIZE" ), QObject::tr( "Output cell size (leave empty to set automatically)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0.0 ); + auto cellSizeParam = std::make_unique( QStringLiteral( "CELL_SIZE" ), QObject::tr( "Output cell size (leave empty to set automatically)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0.0 ); cellSizeParam->setHelp( QObject::tr( "Cell size of the output layer. If not specified, the smallest cell size from the input layers will be used" ) ); addParameter( cellSizeParam.release() ); - std::unique_ptr crsParam = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Output CRS" ), QVariant(), true ); + auto crsParam = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Output CRS" ), QVariant(), true ); crsParam->setHelp( QObject::tr( "CRS of the output layer. If not specified, the CRS of the first input layer will be used" ) ); addParameter( crsParam.release() ); addParameter( new QgsProcessingParameterRasterDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Calculated" ) ) ); diff --git a/src/analysis/processing/qgsalgorithmrasterdtmslopebasedfilter.cpp b/src/analysis/processing/qgsalgorithmrasterdtmslopebasedfilter.cpp index de979302fd53..1dc998736003 100644 --- a/src/analysis/processing/qgsalgorithmrasterdtmslopebasedfilter.cpp +++ b/src/analysis/processing/qgsalgorithmrasterdtmslopebasedfilter.cpp @@ -69,32 +69,32 @@ void QgsRasterDtmSlopeBasedFilterAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterBand( QStringLiteral( "BAND" ), QObject::tr( "Band number" ), 1, QStringLiteral( "INPUT" ) ) ); - std::unique_ptr radiusParam = std::make_unique( QStringLiteral( "RADIUS" ), QObject::tr( "Kernel radius (pixels)" ), Qgis::ProcessingNumberParameterType::Integer, 5, false, 1, 1000 ); + auto radiusParam = std::make_unique( QStringLiteral( "RADIUS" ), QObject::tr( "Kernel radius (pixels)" ), Qgis::ProcessingNumberParameterType::Integer, 5, false, 1, 1000 ); radiusParam->setHelp( QObject::tr( "The radius of the filter kernel (in pixels). Must be large enough to reach ground cells next to non-ground objects." ) ); addParameter( radiusParam.release() ); - std::unique_ptr terrainSlopeParam = std::make_unique( QStringLiteral( "TERRAIN_SLOPE" ), QObject::tr( "Terrain slope (%, pixel size/vertical units)" ), Qgis::ProcessingNumberParameterType::Double, 30, false, 0, 1000 ); + auto terrainSlopeParam = std::make_unique( QStringLiteral( "TERRAIN_SLOPE" ), QObject::tr( "Terrain slope (%, pixel size/vertical units)" ), Qgis::ProcessingNumberParameterType::Double, 30, false, 0, 1000 ); terrainSlopeParam->setHelp( QObject::tr( "The approximate terrain slope in %. The terrain slope must be adjusted to account for the ratio of height units vs raster pixel dimensions. Used to relax the filter criterium in steeper terrain." ) ); addParameter( terrainSlopeParam.release() ); - std::unique_ptr filterModificationParam = std::make_unique( QStringLiteral( "FILTER_MODIFICATION" ), QObject::tr( "Filter modification" ), QStringList { QObject::tr( "None" ), QObject::tr( "Relax filter" ), QObject::tr( "Amplify" ) }, false, 0 ); + auto filterModificationParam = std::make_unique( QStringLiteral( "FILTER_MODIFICATION" ), QObject::tr( "Filter modification" ), QStringList { QObject::tr( "None" ), QObject::tr( "Relax filter" ), QObject::tr( "Amplify" ) }, false, 0 ); filterModificationParam->setHelp( QObject::tr( "Choose whether to apply the filter kernel without modification or to use a confidence interval to relax or amplify the height criterium." ) ); addParameter( filterModificationParam.release() ); - std::unique_ptr stDevParam = std::make_unique( QStringLiteral( "STANDARD_DEVIATION" ), QObject::tr( "Standard deviation" ), Qgis::ProcessingNumberParameterType::Double, 0.1, false, 0, 1000 ); + auto stDevParam = std::make_unique( QStringLiteral( "STANDARD_DEVIATION" ), QObject::tr( "Standard deviation" ), Qgis::ProcessingNumberParameterType::Double, 0.1, false, 0, 1000 ); stDevParam->setHelp( QObject::tr( "The standard deviation used to calculate a 5% confidence interval applied to the height threshold." ) ); addParameter( stDevParam.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); - std::unique_ptr outputLayerGroundParam = std::make_unique( QStringLiteral( "OUTPUT_GROUND" ), QObject::tr( "Output layer (ground)" ), QVariant(), true, true ); + auto outputLayerGroundParam = std::make_unique( QStringLiteral( "OUTPUT_GROUND" ), QObject::tr( "Output layer (ground)" ), QVariant(), true, true ); outputLayerGroundParam->setHelp( QObject::tr( "The filtered DEM containing only cells classified as ground." ) ); addParameter( outputLayerGroundParam.release() ); - std::unique_ptr outputLayerNonGroundParam = std::make_unique( QStringLiteral( "OUTPUT_NONGROUND" ), QObject::tr( "Output layer (non-ground objects)" ), QVariant(), true, false ); + auto outputLayerNonGroundParam = std::make_unique( QStringLiteral( "OUTPUT_NONGROUND" ), QObject::tr( "Output layer (non-ground objects)" ), QVariant(), true, false ); outputLayerNonGroundParam->setHelp( QObject::tr( "The non-ground objects removed by the filter." ) ); addParameter( outputLayerNonGroundParam.release() ); } diff --git a/src/analysis/processing/qgsalgorithmrasterfrequencybycomparisonoperator.cpp b/src/analysis/processing/qgsalgorithmrasterfrequencybycomparisonoperator.cpp index 03b361917100..efe66d73fd40 100644 --- a/src/analysis/processing/qgsalgorithmrasterfrequencybycomparisonoperator.cpp +++ b/src/analysis/processing/qgsalgorithmrasterfrequencybycomparisonoperator.cpp @@ -43,11 +43,11 @@ void QgsRasterFrequencyByComparisonOperatorBase::initAlgorithm( const QVariantMa addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "INPUT_RASTERS" ), QObject::tr( "Input raster layers" ), Qgis::ProcessingSourceType::Raster ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "IGNORE_NODATA" ), QObject::tr( "Ignore NoData values" ), false ) ); - std::unique_ptr output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, true ); + auto output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, true ); output_nodata_parameter->setFlags( output_nodata_parameter->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( output_nodata_parameter.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -119,7 +119,7 @@ QVariantMap QgsRasterFrequencyByComparisonOperatorBase::processAlgorithm( const const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { @@ -169,7 +169,7 @@ QVariantMap QgsRasterFrequencyByComparisonOperatorBase::processAlgorithm( const } } - std::unique_ptr outputBlock = std::make_unique( Qgis::DataType::Int32, iterCols, iterRows ); + auto outputBlock = std::make_unique( Qgis::DataType::Int32, iterCols, iterRows ); feedback->setProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); for ( int row = 0; row < iterRows; row++ ) { diff --git a/src/analysis/processing/qgsalgorithmrasterlogicalop.cpp b/src/analysis/processing/qgsalgorithmrasterlogicalop.cpp index 982324e8a6c5..5cb1f848b98a 100644 --- a/src/analysis/processing/qgsalgorithmrasterlogicalop.cpp +++ b/src/analysis/processing/qgsalgorithmrasterlogicalop.cpp @@ -47,7 +47,7 @@ void QgsRasterBooleanLogicAlgorithmBase::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterRasterLayer( QStringLiteral( "REF_LAYER" ), QObject::tr( "Reference layer" ) ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "NODATA_AS_FALSE" ), QObject::tr( "Treat NoData values as false" ), false ) ); - std::unique_ptr noDataValueParam = std::make_unique( QStringLiteral( "NO_DATA" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999 ); + auto noDataValueParam = std::make_unique( QStringLiteral( "NO_DATA" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999 ); noDataValueParam->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( noDataValueParam.release() ); @@ -55,7 +55,7 @@ void QgsRasterBooleanLogicAlgorithmBase::initAlgorithm( const QVariantMap & ) typeChoice->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( typeChoice.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -125,7 +125,7 @@ QVariantMap QgsRasterBooleanLogicAlgorithmBase::processAlgorithm( const QVariant const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmrasterstackposition.cpp b/src/analysis/processing/qgsalgorithmrasterstackposition.cpp index 9739e43de1bf..7285a1cecd8c 100644 --- a/src/analysis/processing/qgsalgorithmrasterstackposition.cpp +++ b/src/analysis/processing/qgsalgorithmrasterstackposition.cpp @@ -44,11 +44,11 @@ void QgsRasterStackPositionAlgorithmBase::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "IGNORE_NODATA" ), QObject::tr( "Ignore NoData values" ), false ) ); - std::unique_ptr output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, true ); + auto output_nodata_parameter = std::make_unique( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999, true ); output_nodata_parameter->setFlags( output_nodata_parameter->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( output_nodata_parameter.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -115,7 +115,7 @@ QVariantMap QgsRasterStackPositionAlgorithmBase::processAlgorithm( const QVarian const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmrasterzonalstats.cpp b/src/analysis/processing/qgsalgorithmrasterzonalstats.cpp index 7652ab13827f..dd653cf8f7b1 100644 --- a/src/analysis/processing/qgsalgorithmrasterzonalstats.cpp +++ b/src/analysis/processing/qgsalgorithmrasterzonalstats.cpp @@ -55,7 +55,7 @@ void QgsRasterLayerZonalStatsAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterRasterLayer( QStringLiteral( "ZONES" ), QObject::tr( "Zones layer" ) ) ); addParameter( new QgsProcessingParameterBand( QStringLiteral( "ZONES_BAND" ), QObject::tr( "Zones band number" ), 1, QStringLiteral( "ZONES" ) ) ); - std::unique_ptr refParam = std::make_unique( QStringLiteral( "REF_LAYER" ), QObject::tr( "Reference layer" ), QStringList() << QObject::tr( "Input layer" ) << QObject::tr( "Zones layer" ), false, 0 ); + auto refParam = std::make_unique( QStringLiteral( "REF_LAYER" ), QObject::tr( "Reference layer" ), QStringList() << QObject::tr( "Input layer" ) << QObject::tr( "Zones layer" ), false, 0 ); refParam->setFlags( refParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( refParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmreclassifybylayer.cpp b/src/analysis/processing/qgsalgorithmreclassifybylayer.cpp index ecfa8f5b740b..b7377669beba 100644 --- a/src/analysis/processing/qgsalgorithmreclassifybylayer.cpp +++ b/src/analysis/processing/qgsalgorithmreclassifybylayer.cpp @@ -47,15 +47,15 @@ void QgsReclassifyAlgorithmBase::initAlgorithm( const QVariantMap & ) addAlgorithmParams(); - std::unique_ptr noDataValueParam = std::make_unique( QStringLiteral( "NO_DATA" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999 ); + auto noDataValueParam = std::make_unique( QStringLiteral( "NO_DATA" ), QObject::tr( "Output NoData value" ), Qgis::ProcessingNumberParameterType::Double, -9999 ); noDataValueParam->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( noDataValueParam.release() ); - std::unique_ptr boundsHandling = std::make_unique( QStringLiteral( "RANGE_BOUNDARIES" ), QObject::tr( "Range boundaries" ), QStringList() << QObject::tr( "min < value <= max" ) << QObject::tr( "min <= value < max" ) << QObject::tr( "min <= value <= max" ) << QObject::tr( "min < value < max" ), false, 0 ); + auto boundsHandling = std::make_unique( QStringLiteral( "RANGE_BOUNDARIES" ), QObject::tr( "Range boundaries" ), QStringList() << QObject::tr( "min < value <= max" ) << QObject::tr( "min <= value < max" ) << QObject::tr( "min <= value <= max" ) << QObject::tr( "min < value < max" ), false, 0 ); boundsHandling->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( boundsHandling.release() ); - std::unique_ptr missingValuesParam = std::make_unique( QStringLiteral( "NODATA_FOR_MISSING" ), QObject::tr( "Use NoData when no range matches value" ), false, false ); + auto missingValuesParam = std::make_unique( QStringLiteral( "NODATA_FOR_MISSING" ), QObject::tr( "Use NoData when no range matches value" ), false, false ); missingValuesParam->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( missingValuesParam.release() ); @@ -63,7 +63,7 @@ void QgsReclassifyAlgorithmBase::initAlgorithm( const QVariantMap & ) typeChoice->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( typeChoice.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -132,7 +132,7 @@ QVariantMap QgsReclassifyAlgorithmBase::processAlgorithm( const QVariantMap &par const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmrectanglesovalsdiamonds.cpp b/src/analysis/processing/qgsalgorithmrectanglesovalsdiamonds.cpp index 662c466ce39d..e3d98cd3c1c1 100644 --- a/src/analysis/processing/qgsalgorithmrectanglesovalsdiamonds.cpp +++ b/src/analysis/processing/qgsalgorithmrectanglesovalsdiamonds.cpp @@ -224,7 +224,7 @@ QgsFeatureList QgsRectanglesOvalsDiamondsAlgorithm::processFeature( const QgsFea } } - std::unique_ptr poly = std::make_unique(); + auto poly = std::make_unique(); poly->setExteriorRing( new QgsLineString( ringX, ringY ) ); if ( geometry.constGet()->is3D() ) diff --git a/src/analysis/processing/qgsalgorithmrefactorfields.cpp b/src/analysis/processing/qgsalgorithmrefactorfields.cpp index 7f3765b3e713..7df54190eb89 100644 --- a/src/analysis/processing/qgsalgorithmrefactorfields.cpp +++ b/src/analysis/processing/qgsalgorithmrefactorfields.cpp @@ -78,7 +78,7 @@ QgsRefactorFieldsAlgorithm *QgsRefactorFieldsAlgorithm::createInstance() const void QgsRefactorFieldsAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr param = std::make_unique( QStringLiteral( "FIELDS_MAPPING" ), QObject::tr( "Fields mapping" ), QStringLiteral( "INPUT" ) ); + auto param = std::make_unique( QStringLiteral( "FIELDS_MAPPING" ), QObject::tr( "Fields mapping" ), QStringLiteral( "INPUT" ) ); addParameter( param.release() ); } diff --git a/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp index c8655a1a0fa8..8bf8e7529430 100644 --- a/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp +++ b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp @@ -70,13 +70,13 @@ QgsAlgorithmRemoveDuplicateVertices *QgsAlgorithmRemoveDuplicateVertices::create void QgsAlgorithmRemoveDuplicateVertices::initParameters( const QVariantMap & ) { - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 0.000001, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 0.000001, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); tolerance->setIsDynamic( true ); tolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Tolerance" ), QObject::tr( "Tolerance distance" ), QgsPropertyDefinition::DoublePositive ) ); tolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( tolerance.release() ); - std::unique_ptr useZ = std::make_unique( QStringLiteral( "USE_Z_VALUE" ), QObject::tr( "Use Z Value" ), false ); + auto useZ = std::make_unique( QStringLiteral( "USE_Z_VALUE" ), QObject::tr( "Use Z Value" ), false ); useZ->setIsDynamic( true ); useZ->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "UseZ" ), QObject::tr( "Use Z Value" ), QgsPropertyDefinition::Boolean ) ); useZ->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmremoveholes.cpp b/src/analysis/processing/qgsalgorithmremoveholes.cpp index 97f64e0db5a9..1c83fab295b3 100644 --- a/src/analysis/processing/qgsalgorithmremoveholes.cpp +++ b/src/analysis/processing/qgsalgorithmremoveholes.cpp @@ -81,7 +81,7 @@ Qgis::ProcessingFeatureSourceFlags QgsRemoveHolesAlgorithm::sourceFlags() const void QgsRemoveHolesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr minArea = std::make_unique( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove holes with area less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); + auto minArea = std::make_unique( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove holes with area less than" ), 0.0, QStringLiteral( "INPUT" ), false, 0 ); minArea->setIsDynamic( true ); minArea->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MIN_AREA" ), QObject::tr( "Remove holes with area less than" ), QgsPropertyDefinition::DoublePositive ) ); minArea->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmrepairshapefile.cpp b/src/analysis/processing/qgsalgorithmrepairshapefile.cpp index 02aa1f1cd823..0cb0341ebd89 100644 --- a/src/analysis/processing/qgsalgorithmrepairshapefile.cpp +++ b/src/analysis/processing/qgsalgorithmrepairshapefile.cpp @@ -78,7 +78,7 @@ QVariantMap QgsRepairShapefileAlgorithm::processAlgorithm( const QVariantMap &pa CPLSetConfigOption( "SHAPE_RESTORE_SHX", "YES" ); - std::unique_ptr layer = std::make_unique( path ); + auto layer = std::make_unique( path ); if ( !layer->isValid() ) { CPLSetConfigOption( "SHAPE_RESTORE_SHX", nullptr ); diff --git a/src/analysis/processing/qgsalgorithmrescaleraster.cpp b/src/analysis/processing/qgsalgorithmrescaleraster.cpp index 0a762cb550ee..d56d60190ad4 100644 --- a/src/analysis/processing/qgsalgorithmrescaleraster.cpp +++ b/src/analysis/processing/qgsalgorithmrescaleraster.cpp @@ -70,7 +70,7 @@ void QgsRescaleRasterAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterNumber( QStringLiteral( "MAXIMUM" ), QObject::tr( "New maximum value" ), Qgis::ProcessingNumberParameterType::Double, 255 ) ); addParameter( new QgsProcessingParameterNumber( QStringLiteral( "NODATA" ), QObject::tr( "New NoData value" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true ) ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -135,7 +135,7 @@ QVariantMap QgsRescaleRasterAlgorithm::processAlgorithm( const QVariantMap ¶ const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral( "OUTPUT" ), context ); const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmrotate.cpp b/src/analysis/processing/qgsalgorithmrotate.cpp index 8f106dc2bcff..fb8fbd0e1946 100644 --- a/src/analysis/processing/qgsalgorithmrotate.cpp +++ b/src/analysis/processing/qgsalgorithmrotate.cpp @@ -63,13 +63,13 @@ QgsRotateFeaturesAlgorithm *QgsRotateFeaturesAlgorithm::createInstance() const void QgsRotateFeaturesAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr rotation = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Rotation (degrees clockwise)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto rotation = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Rotation (degrees clockwise)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); rotation->setIsDynamic( true ); rotation->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ANGLE" ), QObject::tr( "Rotation (degrees clockwise)" ), QgsPropertyDefinition::Rotation ) ); rotation->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( rotation.release() ); - std::unique_ptr anchor = std::make_unique( QStringLiteral( "ANCHOR" ), QObject::tr( "Rotation anchor point" ), QVariant(), true ); + auto anchor = std::make_unique( QStringLiteral( "ANCHOR" ), QObject::tr( "Rotation anchor point" ), QVariant(), true ); addParameter( anchor.release() ); } diff --git a/src/analysis/processing/qgsalgorithmroundrastervalues.cpp b/src/analysis/processing/qgsalgorithmroundrastervalues.cpp index 91e375f93550..76455d1616ba 100644 --- a/src/analysis/processing/qgsalgorithmroundrastervalues.cpp +++ b/src/analysis/processing/qgsalgorithmroundrastervalues.cpp @@ -54,7 +54,7 @@ void QgsRoundRasterValuesAlgorithm::initAlgorithm( const QVariantMap & ) std::unique_ptr baseParameter = std::make_unique( QStringLiteral( "BASE_N" ), QObject::tr( "Base n for rounding to multiples of n" ), Qgis::ProcessingNumberParameterType::Integer, 10, true, 1 ); baseParameter->setFlags( Qgis::ProcessingParameterFlag::Advanced ); addParameter( baseParameter.release() ); - std::unique_ptr createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); + auto createOptsParam = std::make_unique( QStringLiteral( "CREATE_OPTIONS" ), QObject::tr( "Creation options" ), QVariant(), false, true ); createOptsParam->setMetadata( QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "widget_type" ), QStringLiteral( "rasteroptions" ) } } ) } } ) ); createOptsParam->setFlags( createOptsParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( createOptsParam.release() ); @@ -133,7 +133,7 @@ QVariantMap QgsRoundRasterValuesAlgorithm::processAlgorithm( const QVariantMap & const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral( "OUTPUT" ), context ); const QFileInfo fi( outputFile ); const QString outputFormat = QgsRasterFileWriter::driverForExtension( fi.suffix() ); - std::unique_ptr writer = std::make_unique( outputFile ); + auto writer = std::make_unique( outputFile ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); if ( !createOptions.isEmpty() ) { diff --git a/src/analysis/processing/qgsalgorithmsavefeatures.cpp b/src/analysis/processing/qgsalgorithmsavefeatures.cpp index b11547e386b1..64c5a62bcdfb 100644 --- a/src/analysis/processing/qgsalgorithmsavefeatures.cpp +++ b/src/analysis/processing/qgsalgorithmsavefeatures.cpp @@ -64,7 +64,7 @@ void QgsSaveFeaturesAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Vector features" ), QList() << static_cast( Qgis::ProcessingSourceType::Vector ) ) ); addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Saved features" ), QgsVectorFileWriter::fileFilterString(), QVariant(), false ) ); - std::unique_ptr param = std::make_unique( QStringLiteral( "LAYER_NAME" ), QObject::tr( "Layer name" ), QVariant(), false, true ); + auto param = std::make_unique( QStringLiteral( "LAYER_NAME" ), QObject::tr( "Layer name" ), QVariant(), false, true ); param->setFlags( param->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( param.release() ); param = std::make_unique( QStringLiteral( "DATASOURCE_OPTIONS" ), QObject::tr( "GDAL dataset options (separate individual options with semicolons)" ), QVariant(), false, true ); @@ -74,7 +74,7 @@ void QgsSaveFeaturesAlgorithm::initAlgorithm( const QVariantMap & ) param->setFlags( param->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( param.release() ); - std::unique_ptr paramEnum = std::make_unique( QStringLiteral( "ACTION_ON_EXISTING_FILE" ), QObject::tr( "Action to take on pre-existing file" ), QStringList() << QObject::tr( "Create or overwrite file" ) << QObject::tr( "Create or overwrite layer" ) << QObject::tr( "Append features to existing layer, but do not create new fields" ) << QObject::tr( "Append features to existing layer, and create new fields if needed" ), false, 0 ); + auto paramEnum = std::make_unique( QStringLiteral( "ACTION_ON_EXISTING_FILE" ), QObject::tr( "Action to take on pre-existing file" ), QStringList() << QObject::tr( "Create or overwrite file" ) << QObject::tr( "Create or overwrite layer" ) << QObject::tr( "Append features to existing layer, but do not create new fields" ) << QObject::tr( "Append features to existing layer, and create new fields if needed" ), false, 0 ); paramEnum->setFlags( paramEnum->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( paramEnum.release() ); diff --git a/src/analysis/processing/qgsalgorithmsegmentize.cpp b/src/analysis/processing/qgsalgorithmsegmentize.cpp index 1d6c6d407233..e930b2e3bc93 100644 --- a/src/analysis/processing/qgsalgorithmsegmentize.cpp +++ b/src/analysis/processing/qgsalgorithmsegmentize.cpp @@ -69,7 +69,7 @@ QList QgsSegmentizeByMaximumDistanceAlgorithm::inputLayerTypes() const void QgsSegmentizeByMaximumDistanceAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum offset distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); + auto tolerance = std::make_unique( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum offset distance" ), 1.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); tolerance->setIsDynamic( true ); tolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DISTANCE" ), QObject::tr( "Maximum offset distance" ), QgsPropertyDefinition::DoublePositive ) ); tolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); @@ -159,7 +159,7 @@ QList QgsSegmentizeByMaximumAngleAlgorithm::inputLayerTypes() const void QgsSegmentizeByMaximumAngleAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle between vertices (degrees)" ), Qgis::ProcessingNumberParameterType::Double, 5.0, false, 0, 360.0 ); + auto tolerance = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle between vertices (degrees)" ), Qgis::ProcessingNumberParameterType::Double, 5.0, false, 0, 360.0 ); tolerance->setIsDynamic( true ); tolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ANGLE" ), QObject::tr( "Maximum angle between vertices (degrees)" ), QgsPropertyDefinition::DoublePositive ) ); tolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmserviceareafromlayer.cpp b/src/analysis/processing/qgsalgorithmserviceareafromlayer.cpp index 212820354f33..48a80b077761 100644 --- a/src/analysis/processing/qgsalgorithmserviceareafromlayer.cpp +++ b/src/analysis/processing/qgsalgorithmserviceareafromlayer.cpp @@ -56,13 +56,13 @@ void QgsServiceAreaFromLayerAlgorithm::initAlgorithm( const QVariantMap & ) addCommonParams(); addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "START_POINTS" ), QObject::tr( "Vector layer with start points" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPoint ) ) ); - std::unique_ptr travelCost = std::make_unique( QStringLiteral( "TRAVEL_COST" ), QObject::tr( "Travel cost (distance for 'Shortest', time for 'Fastest')" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); + auto travelCost = std::make_unique( QStringLiteral( "TRAVEL_COST" ), QObject::tr( "Travel cost (distance for 'Shortest', time for 'Fastest')" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); travelCost->setFlags( travelCost->flags() | Qgis::ProcessingParameterFlag::Hidden ); addParameter( travelCost.release() ); addParameter( new QgsProcessingParameterNumber( QStringLiteral( "TRAVEL_COST2" ), QObject::tr( "Travel cost (distance for 'Shortest', time for 'Fastest')" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0 ) ); - std::unique_ptr includeBounds = std::make_unique( QStringLiteral( "INCLUDE_BOUNDS" ), QObject::tr( "Include upper/lower bound points" ), false, true ); + auto includeBounds = std::make_unique( QStringLiteral( "INCLUDE_BOUNDS" ), QObject::tr( "Include upper/lower bound points" ), false, true ); includeBounds->setFlags( includeBounds->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( includeBounds.release() ); @@ -71,15 +71,15 @@ void QgsServiceAreaFromLayerAlgorithm::initAlgorithm( const QVariantMap & ) maxPointDistanceFromNetwork->setHelp( QObject::tr( "Specifies an optional limit on the distance from the points to the network layer. If a point is further from the network than this distance it will be treated as non-routable." ) ); addParameter( maxPointDistanceFromNetwork.release() ); - std::unique_ptr outputLines = std::make_unique( QStringLiteral( "OUTPUT_LINES" ), QObject::tr( "Service area (lines)" ), Qgis::ProcessingSourceType::VectorLine, QVariant(), true ); + auto outputLines = std::make_unique( QStringLiteral( "OUTPUT_LINES" ), QObject::tr( "Service area (lines)" ), Qgis::ProcessingSourceType::VectorLine, QVariant(), true ); outputLines->setCreateByDefault( true ); addParameter( outputLines.release() ); - std::unique_ptr outputPoints = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Service area (boundary nodes)" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto outputPoints = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Service area (boundary nodes)" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); outputPoints->setCreateByDefault( false ); addParameter( outputPoints.release() ); - std::unique_ptr outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); outputNonRoutable->setHelp( QObject::tr( "An optional output which will be used to store any input features which could not be routed (e.g. those which are too far from the network layer)." ) ); outputNonRoutable->setCreateByDefault( false ); addParameter( outputNonRoutable.release() ); diff --git a/src/analysis/processing/qgsalgorithmserviceareafrompoint.cpp b/src/analysis/processing/qgsalgorithmserviceareafrompoint.cpp index 3ae655a7b88e..2835709d858a 100644 --- a/src/analysis/processing/qgsalgorithmserviceareafrompoint.cpp +++ b/src/analysis/processing/qgsalgorithmserviceareafrompoint.cpp @@ -56,7 +56,7 @@ void QgsServiceAreaFromPointAlgorithm::initAlgorithm( const QVariantMap & ) addCommonParams(); addParameter( new QgsProcessingParameterPoint( QStringLiteral( "START_POINT" ), QObject::tr( "Start point" ) ) ); - std::unique_ptr travelCost = std::make_unique( QStringLiteral( "TRAVEL_COST" ), QObject::tr( "Travel cost (distance for 'Shortest', time for 'Fastest')" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); + auto travelCost = std::make_unique( QStringLiteral( "TRAVEL_COST" ), QObject::tr( "Travel cost (distance for 'Shortest', time for 'Fastest')" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); travelCost->setFlags( travelCost->flags() | Qgis::ProcessingParameterFlag::Hidden ); addParameter( travelCost.release() ); @@ -67,15 +67,15 @@ void QgsServiceAreaFromPointAlgorithm::initAlgorithm( const QVariantMap & ) maxPointDistanceFromNetwork->setHelp( QObject::tr( "Specifies an optional limit on the distance from the point to the network layer. If the point is further from the network than this distance an error will be raised." ) ); addParameter( maxPointDistanceFromNetwork.release() ); - std::unique_ptr includeBounds = std::make_unique( QStringLiteral( "INCLUDE_BOUNDS" ), QObject::tr( "Include upper/lower bound points" ), false, true ); + auto includeBounds = std::make_unique( QStringLiteral( "INCLUDE_BOUNDS" ), QObject::tr( "Include upper/lower bound points" ), false, true ); includeBounds->setFlags( includeBounds->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( includeBounds.release() ); - std::unique_ptr outputLines = std::make_unique( QStringLiteral( "OUTPUT_LINES" ), QObject::tr( "Service area (lines)" ), Qgis::ProcessingSourceType::VectorLine, QVariant(), true ); + auto outputLines = std::make_unique( QStringLiteral( "OUTPUT_LINES" ), QObject::tr( "Service area (lines)" ), Qgis::ProcessingSourceType::VectorLine, QVariant(), true ); outputLines->setCreateByDefault( true ); addParameter( outputLines.release() ); - std::unique_ptr outputPoints = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Service area (boundary nodes)" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto outputPoints = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Service area (boundary nodes)" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); outputPoints->setCreateByDefault( false ); addParameter( outputPoints.release() ); } diff --git a/src/analysis/processing/qgsalgorithmshortestpathlayertopoint.cpp b/src/analysis/processing/qgsalgorithmshortestpathlayertopoint.cpp index 41b661c321e2..068170543190 100644 --- a/src/analysis/processing/qgsalgorithmshortestpathlayertopoint.cpp +++ b/src/analysis/processing/qgsalgorithmshortestpathlayertopoint.cpp @@ -61,7 +61,7 @@ void QgsShortestPathLayerToPointAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Shortest path" ), Qgis::ProcessingSourceType::VectorLine ) ); - std::unique_ptr outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); outputNonRoutable->setHelp( QObject::tr( "An optional output which will be used to store any input features which could not be routed (e.g. those which are too far from the network layer)." ) ); outputNonRoutable->setCreateByDefault( false ); addParameter( outputNonRoutable.release() ); diff --git a/src/analysis/processing/qgsalgorithmshortestpathpointtolayer.cpp b/src/analysis/processing/qgsalgorithmshortestpathpointtolayer.cpp index c9b870d22db4..68c124979318 100644 --- a/src/analysis/processing/qgsalgorithmshortestpathpointtolayer.cpp +++ b/src/analysis/processing/qgsalgorithmshortestpathpointtolayer.cpp @@ -66,7 +66,7 @@ void QgsShortestPathPointToLayerAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Shortest path" ), Qgis::ProcessingSourceType::VectorLine ) ); - std::unique_ptr outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); + auto outputNonRoutable = std::make_unique( QStringLiteral( "OUTPUT_NON_ROUTABLE" ), QObject::tr( "Non-routable features" ), Qgis::ProcessingSourceType::VectorPoint, QVariant(), true ); outputNonRoutable->setHelp( QObject::tr( "An optional output which will be used to store any input features which could not be routed (e.g. those which are too far from the network layer)." ) ); outputNonRoutable->setCreateByDefault( false ); addParameter( outputNonRoutable.release() ); diff --git a/src/analysis/processing/qgsalgorithmsimplify.cpp b/src/analysis/processing/qgsalgorithmsimplify.cpp index 3c7cfdbc24b6..9ebe9c9b65df 100644 --- a/src/analysis/processing/qgsalgorithmsimplify.cpp +++ b/src/analysis/processing/qgsalgorithmsimplify.cpp @@ -82,7 +82,7 @@ void QgsSimplifyAlgorithm::initParameters( const QVariantMap & ) QObject::tr( "Simplification method" ), methods, false, 0 ) ); - std::unique_ptr tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 1.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); + auto tolerance = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 1.0, QStringLiteral( "INPUT" ), false, 0, 10000000.0 ); tolerance->setIsDynamic( true ); tolerance->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Tolerance" ), QObject::tr( "Tolerance distance" ), QgsPropertyDefinition::DoublePositive ) ); tolerance->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmsmooth.cpp b/src/analysis/processing/qgsalgorithmsmooth.cpp index 487c2a543a06..b589acd50966 100644 --- a/src/analysis/processing/qgsalgorithmsmooth.cpp +++ b/src/analysis/processing/qgsalgorithmsmooth.cpp @@ -79,19 +79,19 @@ QList QgsSmoothAlgorithm::inputLayerTypes() const void QgsSmoothAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr iterations = std::make_unique( QStringLiteral( "ITERATIONS" ), QObject::tr( "Iterations" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1, 10 ); + auto iterations = std::make_unique( QStringLiteral( "ITERATIONS" ), QObject::tr( "Iterations" ), Qgis::ProcessingNumberParameterType::Integer, 1, false, 1, 10 ); iterations->setIsDynamic( true ); iterations->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ITERATIONS" ), QObject::tr( "Iterations" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); iterations->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( iterations.release() ); - std::unique_ptr offset = std::make_unique( QStringLiteral( "OFFSET" ), QObject::tr( "Offset" ), Qgis::ProcessingNumberParameterType::Double, 0.25, false, 0.0, 0.5 ); + auto offset = std::make_unique( QStringLiteral( "OFFSET" ), QObject::tr( "Offset" ), Qgis::ProcessingNumberParameterType::Double, 0.25, false, 0.0, 0.5 ); offset->setIsDynamic( true ); offset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "OFFSET" ), QObject::tr( "Offset" ), QgsPropertyDefinition::Double0To1 ) ); offset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( offset.release() ); - std::unique_ptr maxAngle = std::make_unique( QStringLiteral( "MAX_ANGLE" ), QObject::tr( "Maximum node angle to smooth" ), Qgis::ProcessingNumberParameterType::Double, 180.0, false, 0.0, 180.0 ); + auto maxAngle = std::make_unique( QStringLiteral( "MAX_ANGLE" ), QObject::tr( "Maximum node angle to smooth" ), Qgis::ProcessingNumberParameterType::Double, 180.0, false, 0.0, 180.0 ); maxAngle->setIsDynamic( true ); maxAngle->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MAX_ANGLE" ), QObject::tr( "Maximum node angle to smooth" ), QgsPropertyDefinition::Rotation ) ); maxAngle->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmsnapgeometries.cpp b/src/analysis/processing/qgsalgorithmsnapgeometries.cpp index cb7f842cbbbc..5bc13626a5de 100644 --- a/src/analysis/processing/qgsalgorithmsnapgeometries.cpp +++ b/src/analysis/processing/qgsalgorithmsnapgeometries.cpp @@ -84,7 +84,7 @@ void QgsSnapGeometriesAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPoint ) << static_cast( Qgis::ProcessingSourceType::VectorLine ) << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "REFERENCE_LAYER" ), QObject::tr( "Reference layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorPoint ) << static_cast( Qgis::ProcessingSourceType::VectorLine ) << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); - std::unique_ptr tolParam = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 10.0, QStringLiteral( "INPUT" ), false, 0.00000001 ); + auto tolParam = std::make_unique( QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), 10.0, QStringLiteral( "INPUT" ), false, 0.00000001 ); tolParam->setMetadata( { QVariantMap( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "decimals" ), 8 } } ) } } ) } diff --git a/src/analysis/processing/qgsalgorithmsnaptogrid.cpp b/src/analysis/processing/qgsalgorithmsnaptogrid.cpp index c74514a42217..af009b42740d 100644 --- a/src/analysis/processing/qgsalgorithmsnaptogrid.cpp +++ b/src/analysis/processing/qgsalgorithmsnaptogrid.cpp @@ -67,25 +67,25 @@ QgsSnapToGridAlgorithm *QgsSnapToGridAlgorithm::createInstance() const void QgsSnapToGridAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr hSpacing = std::make_unique( QStringLiteral( "HSPACING" ), QObject::tr( "X Grid Spacing" ), 1, QStringLiteral( "INPUT" ), false, 0 ); + auto hSpacing = std::make_unique( QStringLiteral( "HSPACING" ), QObject::tr( "X Grid Spacing" ), 1, QStringLiteral( "INPUT" ), false, 0 ); hSpacing->setIsDynamic( true ); hSpacing->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "HSPACING" ), QObject::tr( "X Grid Spacing" ), QgsPropertyDefinition::DoublePositive ) ); hSpacing->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( hSpacing.release() ); - std::unique_ptr vSpacing = std::make_unique( QStringLiteral( "VSPACING" ), QObject::tr( "Y Grid Spacing" ), 1, QStringLiteral( "INPUT" ), false, 0 ); + auto vSpacing = std::make_unique( QStringLiteral( "VSPACING" ), QObject::tr( "Y Grid Spacing" ), 1, QStringLiteral( "INPUT" ), false, 0 ); vSpacing->setIsDynamic( true ); vSpacing->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "VSPACING" ), QObject::tr( "Y Grid Spacing" ), QgsPropertyDefinition::DoublePositive ) ); vSpacing->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( vSpacing.release() ); - std::unique_ptr zSpacing = std::make_unique( QStringLiteral( "ZSPACING" ), QObject::tr( "Z Grid Spacing" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0 ); + auto zSpacing = std::make_unique( QStringLiteral( "ZSPACING" ), QObject::tr( "Z Grid Spacing" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0 ); zSpacing->setIsDynamic( true ); zSpacing->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ZSPACING" ), QObject::tr( "Z Grid Spacing" ), QgsPropertyDefinition::DoublePositive ) ); zSpacing->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( zSpacing.release() ); - std::unique_ptr mSpacing = std::make_unique( QStringLiteral( "MSPACING" ), QObject::tr( "M Grid Spacing" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0 ); + auto mSpacing = std::make_unique( QStringLiteral( "MSPACING" ), QObject::tr( "M Grid Spacing" ), Qgis::ProcessingNumberParameterType::Double, 0, false, 0 ); mSpacing->setIsDynamic( true ); mSpacing->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MSPACING" ), QObject::tr( "M Grid Spacing" ), QgsPropertyDefinition::DoublePositive ) ); mSpacing->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmsplitlinesbylength.cpp b/src/analysis/processing/qgsalgorithmsplitlinesbylength.cpp index f38683af5edd..839e45f36b25 100644 --- a/src/analysis/processing/qgsalgorithmsplitlinesbylength.cpp +++ b/src/analysis/processing/qgsalgorithmsplitlinesbylength.cpp @@ -83,7 +83,7 @@ QgsSplitLinesByLengthAlgorithm *QgsSplitLinesByLengthAlgorithm::createInstance() void QgsSplitLinesByLengthAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr length = std::make_unique( QStringLiteral( "LENGTH" ), QObject::tr( "Maximum line length" ), 10, QStringLiteral( "INPUT" ), false, 0 ); + auto length = std::make_unique( QStringLiteral( "LENGTH" ), QObject::tr( "Maximum line length" ), 10, QStringLiteral( "INPUT" ), false, 0 ); length->setIsDynamic( true ); length->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "LENGTH" ), QObject::tr( "Maximum length" ), QgsPropertyDefinition::DoublePositive ) ); length->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp b/src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp index 2aed08418dd9..61050019b150 100644 --- a/src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp +++ b/src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp @@ -66,7 +66,7 @@ void QgsSplitVectorLayerAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::Vector ) ) ); addParameter( new QgsProcessingParameterField( QStringLiteral( "FIELD" ), QObject::tr( "Unique ID field" ), QVariant(), QStringLiteral( "INPUT" ) ) ); - std::unique_ptr prefixFieldParam = std::make_unique( QStringLiteral( "PREFIX_FIELD" ), QObject::tr( "Add field prefix to file names" ), true ); + auto prefixFieldParam = std::make_unique( QStringLiteral( "PREFIX_FIELD" ), QObject::tr( "Add field prefix to file names" ), true ); addParameter( prefixFieldParam.release() ); const QStringList options = QgsVectorFileWriter::supportedFormatExtensions(); diff --git a/src/analysis/processing/qgsalgorithmsubdivide.cpp b/src/analysis/processing/qgsalgorithmsubdivide.cpp index 93e0addb347a..b496b606ccdc 100644 --- a/src/analysis/processing/qgsalgorithmsubdivide.cpp +++ b/src/analysis/processing/qgsalgorithmsubdivide.cpp @@ -21,7 +21,7 @@ void QgsSubdivideAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr nodes = std::make_unique( QStringLiteral( "MAX_NODES" ), QObject::tr( "Maximum nodes in parts" ), Qgis::ProcessingNumberParameterType::Integer, 256, false, 8, 100000 ); + auto nodes = std::make_unique( QStringLiteral( "MAX_NODES" ), QObject::tr( "Maximum nodes in parts" ), Qgis::ProcessingNumberParameterType::Integer, 256, false, 8, 100000 ); nodes->setIsDynamic( true ); nodes->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "MAX_NODES" ), QObject::tr( "Maximum nodes in parts" ), QgsPropertyDefinition::Integer ) ); nodes->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp b/src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp index 8bc88f59fc27..138b9c749756 100644 --- a/src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp +++ b/src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp @@ -66,13 +66,13 @@ void QgsSymmetricalDifferenceAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ) ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Symmetrical difference" ) ) ); - std::unique_ptr gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); gridSize->setFlags( gridSize->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( gridSize.release() ); } diff --git a/src/analysis/processing/qgsalgorithmtaperedbuffer.cpp b/src/analysis/processing/qgsalgorithmtaperedbuffer.cpp index 772b29d24904..6173827d8c8b 100644 --- a/src/analysis/processing/qgsalgorithmtaperedbuffer.cpp +++ b/src/analysis/processing/qgsalgorithmtaperedbuffer.cpp @@ -97,19 +97,19 @@ QgsTaperedBufferAlgorithm *QgsTaperedBufferAlgorithm::createInstance() const void QgsTaperedBufferAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr startWidth = std::make_unique( QStringLiteral( "START_WIDTH" ), QObject::tr( "Start width" ), Qgis::ProcessingNumberParameterType::Double, 0.0, false, 0.0 ); + auto startWidth = std::make_unique( QStringLiteral( "START_WIDTH" ), QObject::tr( "Start width" ), Qgis::ProcessingNumberParameterType::Double, 0.0, false, 0.0 ); startWidth->setIsDynamic( true ); startWidth->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "START_WIDTH" ), QObject::tr( "Start width" ), QgsPropertyDefinition::DoublePositive ) ); startWidth->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( startWidth.release() ); - std::unique_ptr endWidth = std::make_unique( QStringLiteral( "END_WIDTH" ), QObject::tr( "End width" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0.0 ); + auto endWidth = std::make_unique( QStringLiteral( "END_WIDTH" ), QObject::tr( "End width" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0.0 ); endWidth->setIsDynamic( true ); endWidth->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "END_WIDTH" ), QObject::tr( "End width" ), QgsPropertyDefinition::DoublePositive ) ); endWidth->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( endWidth.release() ); - std::unique_ptr segments = std::make_unique( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), Qgis::ProcessingNumberParameterType::Integer, 16, false, 1 ); + auto segments = std::make_unique( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), Qgis::ProcessingNumberParameterType::Integer, 16, false, 1 ); segments->setIsDynamic( true ); segments->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); segments->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); @@ -213,7 +213,7 @@ QgsVariableWidthBufferByMAlgorithm *QgsVariableWidthBufferByMAlgorithm::createIn void QgsVariableWidthBufferByMAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr segments = std::make_unique( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), Qgis::ProcessingNumberParameterType::Integer, 16, false, 1 ); + auto segments = std::make_unique( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), Qgis::ProcessingNumberParameterType::Integer, 16, false, 1 ); segments->setIsDynamic( true ); segments->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "SEGMENTS" ), QObject::tr( "Segments" ), QgsPropertyDefinition::IntegerPositiveGreaterZero ) ); segments->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmtinmeshcreation.cpp b/src/analysis/processing/qgsalgorithmtinmeshcreation.cpp index d7397d5a0a04..5d3e10e6ea0c 100644 --- a/src/analysis/processing/qgsalgorithmtinmeshcreation.cpp +++ b/src/analysis/processing/qgsalgorithmtinmeshcreation.cpp @@ -199,7 +199,7 @@ QVariantMap QgsTinMeshCreationAlgorithm::processAlgorithm( const QVariantMap &pa void QgsTinMeshCreationAlgorithm::addZValueDataset( const QString &fileName, const QgsMesh &mesh, const QString &driver ) { - std::unique_ptr tempLayer = std::make_unique( fileName, "temp", "mdal" ); + auto tempLayer = std::make_unique( fileName, "temp", "mdal" ); QgsMeshZValueDatasetGroup *zValueDatasetGroup = new QgsMeshZValueDatasetGroup( QObject::tr( "Terrain Elevation" ), mesh ); tempLayer->addDatasets( zValueDatasetGroup ); const int datasetGroupIndex = tempLayer->datasetGroupCount() - 1; diff --git a/src/analysis/processing/qgsalgorithmtransect.cpp b/src/analysis/processing/qgsalgorithmtransect.cpp index c05eed279045..f89e27784efb 100644 --- a/src/analysis/processing/qgsalgorithmtransect.cpp +++ b/src/analysis/processing/qgsalgorithmtransect.cpp @@ -49,13 +49,13 @@ QString QgsTransectAlgorithm::groupId() const void QgsTransectAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorLine ) ) ); - std::unique_ptr length = std::make_unique( QStringLiteral( "LENGTH" ), QObject::tr( "Length of the transect" ), 5.0, QStringLiteral( "INPUT" ), false, 0 ); + auto length = std::make_unique( QStringLiteral( "LENGTH" ), QObject::tr( "Length of the transect" ), 5.0, QStringLiteral( "INPUT" ), false, 0 ); length->setIsDynamic( true ); length->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "LENGTH" ), QObject::tr( "Length of the transect" ), QgsPropertyDefinition::DoublePositive ) ); length->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( length.release() ); - std::unique_ptr angle = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Angle in degrees from the original line at the vertices" ), Qgis::ProcessingNumberParameterType::Double, 90.0, false, 0, 360 ); + auto angle = std::make_unique( QStringLiteral( "ANGLE" ), QObject::tr( "Angle in degrees from the original line at the vertices" ), Qgis::ProcessingNumberParameterType::Double, 90.0, false, 0, 360 ); angle->setIsDynamic( true ); angle->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "ANGLE" ), QObject::tr( "Angle in degrees" ), QgsPropertyDefinition::Double ) ); angle->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmtranslate.cpp b/src/analysis/processing/qgsalgorithmtranslate.cpp index 3d1967aa774e..6293aee35d73 100644 --- a/src/analysis/processing/qgsalgorithmtranslate.cpp +++ b/src/analysis/processing/qgsalgorithmtranslate.cpp @@ -64,25 +64,25 @@ QgsTranslateAlgorithm *QgsTranslateAlgorithm::createInstance() const void QgsTranslateAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Offset distance (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto xOffset = std::make_unique( QStringLiteral( "DELTA_X" ), QObject::tr( "Offset distance (x-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); xOffset->setIsDynamic( true ); xOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_X" ), QObject::tr( "Offset distance (x-axis)" ), QgsPropertyDefinition::Double ) ); xOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( xOffset.release() ); - std::unique_ptr yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Offset distance (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); + auto yOffset = std::make_unique( QStringLiteral( "DELTA_Y" ), QObject::tr( "Offset distance (y-axis)" ), 0.0, QStringLiteral( "INPUT" ) ); yOffset->setIsDynamic( true ); yOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Y" ), QObject::tr( "Offset distance (y-axis)" ), QgsPropertyDefinition::Double ) ); yOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( yOffset.release() ); - std::unique_ptr zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Offset distance (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto zOffset = std::make_unique( QStringLiteral( "DELTA_Z" ), QObject::tr( "Offset distance (z-axis)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); zOffset->setIsDynamic( true ); zOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_Z" ), QObject::tr( "Offset distance (z-axis)" ), QgsPropertyDefinition::Double ) ); zOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( zOffset.release() ); - std::unique_ptr mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Offset distance (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); + auto mOffset = std::make_unique( QStringLiteral( "DELTA_M" ), QObject::tr( "Offset distance (m values)" ), Qgis::ProcessingNumberParameterType::Double, 0.0 ); mOffset->setIsDynamic( true ); mOffset->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "DELTA_M" ), QObject::tr( "Offset distance (m values)" ), QgsPropertyDefinition::Double ) ); mOffset->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); diff --git a/src/analysis/processing/qgsalgorithmunion.cpp b/src/analysis/processing/qgsalgorithmunion.cpp index 28314303e175..e6967508b643 100644 --- a/src/analysis/processing/qgsalgorithmunion.cpp +++ b/src/analysis/processing/qgsalgorithmunion.cpp @@ -67,13 +67,13 @@ void QgsUnionAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) ); addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ), QList(), QVariant(), true ) ); - std::unique_ptr prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); + auto prefix = std::make_unique( QStringLiteral( "OVERLAY_FIELDS_PREFIX" ), QObject::tr( "Overlay fields prefix" ), QString(), false, true ); prefix->setFlags( prefix->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( prefix.release() ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Union" ) ) ); - std::unique_ptr gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); + auto gridSize = std::make_unique( QStringLiteral( "GRID_SIZE" ), QObject::tr( "Grid size" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0 ); gridSize->setFlags( gridSize->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( gridSize.release() ); } diff --git a/src/analysis/processing/qgsalgorithmuniquevalueindex.cpp b/src/analysis/processing/qgsalgorithmuniquevalueindex.cpp index fd3d340ab585..ab18a593f81b 100644 --- a/src/analysis/processing/qgsalgorithmuniquevalueindex.cpp +++ b/src/analysis/processing/qgsalgorithmuniquevalueindex.cpp @@ -50,11 +50,11 @@ void QgsAddUniqueValueIndexAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterField( QStringLiteral( "FIELD" ), QObject::tr( "Class field" ), QVariant(), QStringLiteral( "INPUT" ), Qgis::ProcessingFieldParameterDataType::Any ) ); addParameter( new QgsProcessingParameterString( QStringLiteral( "FIELD_NAME" ), QObject::tr( "Output field name" ), QStringLiteral( "NUM_FIELD" ) ) ); - std::unique_ptr classedOutput = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Layer with index field" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true ); + auto classedOutput = std::make_unique( QStringLiteral( "OUTPUT" ), QObject::tr( "Layer with index field" ), Qgis::ProcessingSourceType::VectorAnyGeometry, QVariant(), true ); classedOutput->setCreateByDefault( true ); addParameter( classedOutput.release() ); - std::unique_ptr summaryOutput = std::make_unique( QStringLiteral( "SUMMARY_OUTPUT" ), QObject::tr( "Class summary" ), Qgis::ProcessingSourceType::Vector, QVariant(), true ); + auto summaryOutput = std::make_unique( QStringLiteral( "SUMMARY_OUTPUT" ), QObject::tr( "Class summary" ), Qgis::ProcessingSourceType::Vector, QVariant(), true ); summaryOutput->setCreateByDefault( false ); addParameter( summaryOutput.release() ); } diff --git a/src/analysis/processing/qgsalgorithmvirtualrastercalculator.cpp b/src/analysis/processing/qgsalgorithmvirtualrastercalculator.cpp index 4492f1a020e5..829aea541dc2 100644 --- a/src/analysis/processing/qgsalgorithmvirtualrastercalculator.cpp +++ b/src/analysis/processing/qgsalgorithmvirtualrastercalculator.cpp @@ -64,13 +64,13 @@ void QgsVirtualRasterCalculatorAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterMultipleLayers( QStringLiteral( "LAYERS" ), QObject::tr( "Input layers" ), Qgis::ProcessingSourceType::Raster ) ); addParameter( new QgsProcessingParameterExpression( QStringLiteral( "EXPRESSION" ), QObject::tr( "Expression" ), QVariant(), QStringLiteral( "LAYERS" ), false, Qgis::ExpressionType::RasterCalculator ) ); - std::unique_ptr extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Output extent" ), QVariant(), true ); + auto extentParam = std::make_unique( QStringLiteral( "EXTENT" ), QObject::tr( "Output extent" ), QVariant(), true ); extentParam->setHelp( QObject::tr( "Extent of the output layer. If not specified, the extent will be the overall extent of all input layers" ) ); addParameter( extentParam.release() ); - std::unique_ptr cellSizeParam = std::make_unique( QStringLiteral( "CELL_SIZE" ), QObject::tr( "Output cell size (leave empty to set automatically)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0.0 ); + auto cellSizeParam = std::make_unique( QStringLiteral( "CELL_SIZE" ), QObject::tr( "Output cell size (leave empty to set automatically)" ), Qgis::ProcessingNumberParameterType::Double, QVariant(), true, 0.0 ); cellSizeParam->setHelp( QObject::tr( "Cell size of the output layer. If not specified, the smallest cell size from the input layers will be used" ) ); addParameter( cellSizeParam.release() ); - std::unique_ptr crsParam = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Output CRS" ), QVariant(), true ); + auto crsParam = std::make_unique( QStringLiteral( "CRS" ), QObject::tr( "Output CRS" ), QVariant(), true ); crsParam->setHelp( QObject::tr( "CRS of the output layer. If not specified, the CRS of the first input layer will be used" ) ); addParameter( crsParam.release() ); addParameter( new QgsProcessingParameterString( QStringLiteral( "LAYER_NAME" ), QObject::tr( "Output layer name" ), QVariant(), false, true ) ); diff --git a/src/analysis/processing/qgsalgorithmvoronoipolygons.cpp b/src/analysis/processing/qgsalgorithmvoronoipolygons.cpp index 2c4db392e3cf..3a946f833abe 100644 --- a/src/analysis/processing/qgsalgorithmvoronoipolygons.cpp +++ b/src/analysis/processing/qgsalgorithmvoronoipolygons.cpp @@ -204,7 +204,7 @@ QString QgsVoronoiPolygonsAlgorithm::voronoiWithoutAttributes( const QVariantMap if ( !sink ) throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) ); - std::unique_ptr points = std::make_unique(); + auto points = std::make_unique(); long long i = 0; const double step = mSource->featureCount() > 0 ? 50.0 / mSource->featureCount() : 1; diff --git a/src/analysis/processing/qgsalgorithmwedgebuffers.cpp b/src/analysis/processing/qgsalgorithmwedgebuffers.cpp index e487bb38bca9..2e0ce1624b82 100644 --- a/src/analysis/processing/qgsalgorithmwedgebuffers.cpp +++ b/src/analysis/processing/qgsalgorithmwedgebuffers.cpp @@ -92,25 +92,25 @@ QgsWedgeBuffersAlgorithm *QgsWedgeBuffersAlgorithm::createInstance() const void QgsWedgeBuffersAlgorithm::initParameters( const QVariantMap & ) { - std::unique_ptr azimuth = std::make_unique( QStringLiteral( "AZIMUTH" ), QObject::tr( "Azimuth (degrees from North)" ), Qgis::ProcessingNumberParameterType::Double, 0, false ); + auto azimuth = std::make_unique( QStringLiteral( "AZIMUTH" ), QObject::tr( "Azimuth (degrees from North)" ), Qgis::ProcessingNumberParameterType::Double, 0, false ); azimuth->setIsDynamic( true ); azimuth->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Azimuth" ), QObject::tr( "Azimuth (degrees from North)" ), QgsPropertyDefinition::Double ) ); azimuth->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( azimuth.release() ); - std::unique_ptr width = std::make_unique( QStringLiteral( "WIDTH" ), QObject::tr( "Wedge width (in degrees)" ), Qgis::ProcessingNumberParameterType::Double, 45, false, 0, 360.0 ); + auto width = std::make_unique( QStringLiteral( "WIDTH" ), QObject::tr( "Wedge width (in degrees)" ), Qgis::ProcessingNumberParameterType::Double, 45, false, 0, 360.0 ); width->setIsDynamic( true ); width->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Width" ), QObject::tr( "Wedge width (in degrees)" ), QgsPropertyDefinition::DoublePositive ) ); width->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( width.release() ); - std::unique_ptr outerRadius = std::make_unique( QStringLiteral( "OUTER_RADIUS" ), QObject::tr( "Outer radius" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0 ); + auto outerRadius = std::make_unique( QStringLiteral( "OUTER_RADIUS" ), QObject::tr( "Outer radius" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0 ); outerRadius->setIsDynamic( true ); outerRadius->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Outer radius" ), QObject::tr( "Outer radius" ), QgsPropertyDefinition::DoublePositive ) ); outerRadius->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); addParameter( outerRadius.release() ); - std::unique_ptr innerRadius = std::make_unique( QStringLiteral( "INNER_RADIUS" ), QObject::tr( "Inner radius" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); + auto innerRadius = std::make_unique( QStringLiteral( "INNER_RADIUS" ), QObject::tr( "Inner radius" ), Qgis::ProcessingNumberParameterType::Double, 0, true, 0 ); innerRadius->setIsDynamic( true ); innerRadius->setDynamicPropertyDefinition( QgsPropertyDefinition( QStringLiteral( "Inner radius" ), QObject::tr( "Inner radius" ), QgsPropertyDefinition::DoublePositive ) ); innerRadius->setDynamicLayerParameterName( QStringLiteral( "INPUT" ) ); @@ -172,7 +172,7 @@ QgsFeatureList QgsWedgeBuffersAlgorithm::processFeature( const QgsFeature &featu if ( QgsWkbTypes::isMultiType( g.wkbType() ) ) { const QgsMultiPoint *mp = static_cast( g.constGet() ); - std::unique_ptr result = std::make_unique(); + auto result = std::make_unique(); result->reserve( mp->numGeometries() ); for ( int i = 0; i < mp->numGeometries(); ++i ) { diff --git a/src/analysis/processing/qgsalgorithmwritevectortiles.cpp b/src/analysis/processing/qgsalgorithmwritevectortiles.cpp index 522f5a10f475..0491b622c63e 100644 --- a/src/analysis/processing/qgsalgorithmwritevectortiles.cpp +++ b/src/analysis/processing/qgsalgorithmwritevectortiles.cpp @@ -157,7 +157,7 @@ void QgsWriteVectorTilesMbtilesAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterString( QStringLiteral( "META_DESCRIPTION" ), QObject::tr( "Metadata: Description" ), QVariant(), false, true ) ); addParameter( new QgsProcessingParameterString( QStringLiteral( "META_ATTRIBUTION" ), QObject::tr( "Metadata: Attribution" ), QVariant(), false, true ) ); addParameter( new QgsProcessingParameterString( QStringLiteral( "META_VERSION" ), QObject::tr( "Metadata: Version" ), QVariant(), false, true ) ); - std::unique_ptr metaTypeParam = std::make_unique( QStringLiteral( "META_TYPE" ), QObject::tr( "Metadata: Type" ), QVariant(), false, true ); + auto metaTypeParam = std::make_unique( QStringLiteral( "META_TYPE" ), QObject::tr( "Metadata: Type" ), QVariant(), false, true ); metaTypeParam->setMetadata( { { QStringLiteral( "widget_wrapper" ), QVariantMap( { { QStringLiteral( "value_hints" ), QStringList() << QStringLiteral( "overlay" ) << QStringLiteral( "baselayer" ) } } ) } } ); addParameter( metaTypeParam.release() ); diff --git a/src/analysis/processing/qgsalgorithmxyztiles.cpp b/src/analysis/processing/qgsalgorithmxyztiles.cpp index ee215f57ed82..77dbb6370f53 100644 --- a/src/analysis/processing/qgsalgorithmxyztiles.cpp +++ b/src/analysis/processing/qgsalgorithmxyztiles.cpp @@ -297,13 +297,13 @@ void QgsXyzTilesDirectoryAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterNumber( QStringLiteral( "TILE_HEIGHT" ), QObject::tr( "Tile height" ), Qgis::ProcessingNumberParameterType::Integer, 256, false, 1, 4096 ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "TMS_CONVENTION" ), QObject::tr( "Use inverted tile Y axis (TMS convention)" ), false ) ); - std::unique_ptr titleParam = std::make_unique( QStringLiteral( "HTML_TITLE" ), QObject::tr( "Leaflet HTML output title" ), QVariant(), false, true ); + auto titleParam = std::make_unique( QStringLiteral( "HTML_TITLE" ), QObject::tr( "Leaflet HTML output title" ), QVariant(), false, true ); titleParam->setFlags( titleParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( titleParam.release() ); - std::unique_ptr attributionParam = std::make_unique( QStringLiteral( "HTML_ATTRIBUTION" ), QObject::tr( "Leaflet HTML output attribution" ), QVariant(), false, true ); + auto attributionParam = std::make_unique( QStringLiteral( "HTML_ATTRIBUTION" ), QObject::tr( "Leaflet HTML output attribution" ), QVariant(), false, true ); attributionParam->setFlags( attributionParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( attributionParam.release() ); - std::unique_ptr osmParam = std::make_unique( QStringLiteral( "HTML_OSM" ), QObject::tr( "Include OpenStreetMap basemap in Leaflet HTML output" ), false ); + auto osmParam = std::make_unique( QStringLiteral( "HTML_OSM" ), QObject::tr( "Include OpenStreetMap basemap in Leaflet HTML output" ), false ); osmParam->setFlags( osmParam->flags() | Qgis::ProcessingParameterFlag::Advanced ); addParameter( osmParam.release() ); diff --git a/src/analysis/processing/qgsbookmarkalgorithms.cpp b/src/analysis/processing/qgsbookmarkalgorithms.cpp index 8fd4330d6f5b..f2d8bbee74c2 100644 --- a/src/analysis/processing/qgsbookmarkalgorithms.cpp +++ b/src/analysis/processing/qgsbookmarkalgorithms.cpp @@ -26,7 +26,7 @@ void QgsBookmarksToLayerAlgorithm::initAlgorithm( const QVariantMap & ) { - std::unique_ptr sourceParam = std::make_unique( QStringLiteral( "SOURCE" ), QObject::tr( "Bookmark source" ), QStringList() << QObject::tr( "Project bookmarks" ) << QObject::tr( "User bookmarks" ), true, QVariantList() << 0 << 1 ); + auto sourceParam = std::make_unique( QStringLiteral( "SOURCE" ), QObject::tr( "Bookmark source" ), QStringList() << QObject::tr( "Project bookmarks" ) << QObject::tr( "User bookmarks" ), true, QVariantList() << 0 << 1 ); QVariantMap wrapperMetadata; wrapperMetadata.insert( QStringLiteral( "useCheckBoxes" ), true ); QVariantMap metadata; @@ -169,7 +169,7 @@ void QgsLayerToBookmarksAlgorithm::initAlgorithm( const QVariantMap & ) { addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ), QList() << static_cast( Qgis::ProcessingSourceType::VectorLine ) << static_cast( Qgis::ProcessingSourceType::VectorPolygon ) ) ); - std::unique_ptr sourceParam = std::make_unique( QStringLiteral( "DESTINATION" ), QObject::tr( "Bookmark destination" ), QStringList() << QObject::tr( "Project bookmarks" ) << QObject::tr( "User bookmarks" ), false, 0 ); + auto sourceParam = std::make_unique( QStringLiteral( "DESTINATION" ), QObject::tr( "Bookmark destination" ), QStringList() << QObject::tr( "Project bookmarks" ) << QObject::tr( "User bookmarks" ), false, 0 ); addParameter( sourceParam.release() ); addParameter( new QgsProcessingParameterExpression( QStringLiteral( "NAME_EXPRESSION" ), QObject::tr( "Name field" ), QVariant(), QStringLiteral( "INPUT" ) ) ); diff --git a/src/analysis/processing/qgsrasteranalysisutils.cpp b/src/analysis/processing/qgsrasteranalysisutils.cpp index 4ffbf69f9b3d..e9a8d47baa38 100644 --- a/src/analysis/processing/qgsrasteranalysisutils.cpp +++ b/src/analysis/processing/qgsrasteranalysisutils.cpp @@ -57,7 +57,7 @@ void QgsRasterAnalysisUtils::cellInfoForBBox( const QgsRectangle &rasterBBox, co void QgsRasterAnalysisUtils::statisticsFromMiddlePointTest( QgsRasterInterface *rasterInterface, int rasterBand, const QgsGeometry &poly, int nCellsX, int nCellsY, double cellSizeX, double cellSizeY, const QgsRectangle &rasterBBox, const std::function &addValue, bool skipNodata ) { - std::unique_ptr polyEngine = std::make_unique( poly.constGet() ); + auto polyEngine = std::make_unique( poly.constGet() ); if ( !polyEngine ) { return; diff --git a/src/analysis/processing/qgsreclassifyutils.cpp b/src/analysis/processing/qgsreclassifyutils.cpp index 39c5080a1072..dd38eacacad1 100644 --- a/src/analysis/processing/qgsreclassifyutils.cpp +++ b/src/analysis/processing/qgsreclassifyutils.cpp @@ -80,7 +80,7 @@ void QgsReclassifyUtils::reclassify( const QVectorsetProgress( 100 * ( ( iterTop / maxHeight * nbBlocksWidth ) + iterLeft / maxWidth ) / nbBlocks ); if ( feedback && feedback->isCanceled() ) break; - std::unique_ptr reclassifiedBlock = std::make_unique( destinationRaster->dataType( 1 ), iterCols, iterRows ); + auto reclassifiedBlock = std::make_unique( destinationRaster->dataType( 1 ), iterCols, iterRows ); for ( int row = 0; row < iterRows; row++ ) { diff --git a/src/analysis/raster/qgsrastercalcnode.cpp b/src/analysis/raster/qgsrastercalcnode.cpp index c976fa5ae06b..680f9d4150ab 100644 --- a/src/analysis/raster/qgsrastercalcnode.cpp +++ b/src/analysis/raster/qgsrastercalcnode.cpp @@ -224,7 +224,7 @@ bool QgsRasterCalcNode::calculate( QMap &rasterData, std::vector> matrixContainer; for ( int i = 0; i < mFunctionArgs.size(); ++i ) { - std::unique_ptr singleMatrix = std::make_unique( result.nColumns(), result.nRows(), nullptr, result.nodataValue() ); + auto singleMatrix = std::make_unique( result.nColumns(), result.nRows(), nullptr, result.nodataValue() ); if ( !mFunctionArgs.at( i ) || !mFunctionArgs.at( i )->calculate( rasterData, *singleMatrix, row ) ) { return false; @@ -472,7 +472,7 @@ QgsRasterMatrix QgsRasterCalcNode::evaluateFunction( const std::vectornColumns(); int nRows = matrixVector.at( 0 )->nRows(); int nEntries = nCols * nRows; - std::unique_ptr dataResult = std::make_unique( nEntries ); + auto dataResult = std::make_unique( nEntries ); double *dataResultRawPtr = dataResult.get(); double *condition = matrixVector.at( 0 )->data(); diff --git a/src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp index 06d78b9ad210..eab0c93572cd 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp @@ -398,7 +398,7 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( const QMap snappedErrGeom = std::make_unique(); + auto snappedErrGeom = std::make_unique(); snappedErrGeom->setExteriorRing( new QgsLineString( snappedRing ) ); // Merge geometries diff --git a/src/analysis/vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp index 8672d9021f9b..47e00606a868 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp @@ -129,7 +129,7 @@ QString QgsGeometryMissingVertexCheck::description() const void QgsGeometryMissingVertexCheck::processPolygon( const QgsCurvePolygon *polygon, QgsFeaturePool *featurePool, QList &errors, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, QgsFeedback *feedback ) const { const QgsFeature ¤tFeature = layerFeature.feature(); - std::unique_ptr boundaries = std::make_unique(); + auto boundaries = std::make_unique(); std::unique_ptr geomEngine( QgsGeometry::createGeometryEngine( polygon->exteriorRing()->clone(), mContext->tolerance ) ); boundaries->addGeometry( geomEngine->buffer( mContext->tolerance, 5 ) ); @@ -181,7 +181,7 @@ void QgsGeometryMissingVertexCheck::processPolygon( const QgsCurvePolygon *polyg } if ( !alreadyReported ) { - std::unique_ptr error = std::make_unique( this, layerFeature, QgsPointXY( pt ) ); + auto error = std::make_unique( this, layerFeature, QgsPointXY( pt ) ); error->setAffectedAreaBBox( contextBoundingBox( polygon, vertexId, pt ) ); QMap involvedFeatures; involvedFeatures[layerFeature.layerId()].insert( layerFeature.feature().id() ); diff --git a/src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp index f0663152e5ef..14fe7994cdbe 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp @@ -155,9 +155,9 @@ void QgsGeometrySelfIntersectionCheck::fixError( const QMapsetFixFailed( tr( "Resulting geometry is degenerate" ) ); return; } - std::unique_ptr ringGeom1 = std::make_unique(); + auto ringGeom1 = std::make_unique(); ringGeom1->setPoints( ring1 ); - std::unique_ptr ringGeom2 = std::make_unique(); + auto ringGeom2 = std::make_unique(); ringGeom2->setPoints( ring2 ); QgsAbstractGeometry *part = QgsGeometryCheckerUtils::getGeomPart( geom, vidx.part ); @@ -216,7 +216,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( const QMap multiPoly = std::make_unique(); + auto multiPoly = std::make_unique(); multiPoly->addGeometry( poly->clone() ); multiPoly->addGeometry( poly2.release() ); feature.setGeometry( QgsGeometry( std::move( multiPoly ) ) ); diff --git a/src/app/3d/qgs3danimationwidget.cpp b/src/app/3d/qgs3danimationwidget.cpp index 76fc396c5edf..2e1e531f1769 100644 --- a/src/app/3d/qgs3danimationwidget.cpp +++ b/src/app/3d/qgs3danimationwidget.cpp @@ -191,7 +191,7 @@ void Qgs3DAnimationWidget::onExportAnimation() if ( dialog.exec() == QDialog::Accepted ) { QgsFeedback progressFeedback; - std::unique_ptr progressTask = std::make_unique( tr( "Exporting animation" ) ); + auto progressTask = std::make_unique( tr( "Exporting animation" ) ); QProgressDialog progressDialog( tr( "Exporting frames..." ), tr( "Abort" ), 0, 100, this ); progressDialog.setWindowModality( Qt::WindowModal ); diff --git a/src/app/3d/qgs3dmapconfigwidget.cpp b/src/app/3d/qgs3dmapconfigwidget.cpp index fa63fb3a9e7b..00db7b052045 100644 --- a/src/app/3d/qgs3dmapconfigwidget.cpp +++ b/src/app/3d/qgs3dmapconfigwidget.cpp @@ -275,7 +275,7 @@ void Qgs3DMapConfigWidget::apply() case QgsTerrainGenerator::Dem: { - std::unique_ptr demTerrainSettings = std::make_unique(); + auto demTerrainSettings = std::make_unique(); demTerrainSettings->setLayer( qobject_cast( cboTerrainLayer->currentLayer() ) ); demTerrainSettings->setResolution( spinTerrainResolution->value() ); demTerrainSettings->setSkirtHeight( spinTerrainSkirtHeight->value() ); @@ -285,7 +285,7 @@ void Qgs3DMapConfigWidget::apply() case QgsTerrainGenerator::Online: { - std::unique_ptr onlineTerrainSettings = std::make_unique(); + auto onlineTerrainSettings = std::make_unique(); onlineTerrainSettings->setResolution( spinTerrainResolution->value() ); onlineTerrainSettings->setSkirtHeight( spinTerrainSkirtHeight->value() ); terrainSettings = std::move( onlineTerrainSettings ); @@ -294,7 +294,7 @@ void Qgs3DMapConfigWidget::apply() case QgsTerrainGenerator::Mesh: { - std::unique_ptr meshTerrainSettings = std::make_unique(); + auto meshTerrainSettings = std::make_unique(); meshTerrainSettings->setLayer( qobject_cast( cboTerrainLayer->currentLayer() ) ); std::unique_ptr symbol = mMeshSymbolWidget->symbol(); @@ -307,7 +307,7 @@ void Qgs3DMapConfigWidget::apply() case QgsTerrainGenerator::QuantizedMesh: { - std::unique_ptr meshTerrainSettings = std::make_unique(); + auto meshTerrainSettings = std::make_unique(); meshTerrainSettings->setLayer( qobject_cast( cboTerrainLayer->currentLayer() ) ); terrainSettings = std::move( meshTerrainSettings ); diff --git a/src/app/3d/qgsgoochmaterialwidget.cpp b/src/app/3d/qgsgoochmaterialwidget.cpp index 3e62f8b27778..49c947745ace 100644 --- a/src/app/3d/qgsgoochmaterialwidget.cpp +++ b/src/app/3d/qgsgoochmaterialwidget.cpp @@ -101,7 +101,7 @@ void QgsGoochMaterialWidget::setTechnique( QgsMaterialSettingsRenderingTechnique QgsAbstractMaterialSettings *QgsGoochMaterialWidget::settings() { - std::unique_ptr m = std::make_unique(); + auto m = std::make_unique(); m->setDiffuse( btnDiffuse->color() ); m->setWarm( btnWarm->color() ); m->setCool( btnCool->color() ); diff --git a/src/app/3d/qgsline3dsymbolwidget.cpp b/src/app/3d/qgsline3dsymbolwidget.cpp index 0accc707ac1c..38938c085c2d 100644 --- a/src/app/3d/qgsline3dsymbolwidget.cpp +++ b/src/app/3d/qgsline3dsymbolwidget.cpp @@ -73,7 +73,7 @@ void QgsLine3DSymbolWidget::setSymbol( const QgsAbstract3DSymbol *symbol, QgsVec QgsAbstract3DSymbol *QgsLine3DSymbolWidget::symbol() { - std::unique_ptr sym = std::make_unique(); + auto sym = std::make_unique(); sym->setWidth( spinWidth->value() ); sym->setOffset( static_cast( spinOffset->value() ) ); sym->setExtrusionHeight( spinExtrusion->value() ); diff --git a/src/app/3d/qgsmetalroughmaterialwidget.cpp b/src/app/3d/qgsmetalroughmaterialwidget.cpp index 2c3ffc08e20c..63c4be8ba889 100644 --- a/src/app/3d/qgsmetalroughmaterialwidget.cpp +++ b/src/app/3d/qgsmetalroughmaterialwidget.cpp @@ -65,7 +65,7 @@ void QgsMetalRoughMaterialWidget::setSettings( const QgsAbstractMaterialSettings QgsAbstractMaterialSettings *QgsMetalRoughMaterialWidget::settings() { - std::unique_ptr m = std::make_unique(); + auto m = std::make_unique(); m->setBaseColor( mButtonBaseColor->color() ); m->setMetalness( static_cast( mSpinMetalness->value() ) ); m->setRoughness( static_cast( mSpinRoughness->value() ) ); diff --git a/src/app/3d/qgsphongmaterialwidget.cpp b/src/app/3d/qgsphongmaterialwidget.cpp index 25522edd5156..e881bdd51f7a 100644 --- a/src/app/3d/qgsphongmaterialwidget.cpp +++ b/src/app/3d/qgsphongmaterialwidget.cpp @@ -135,7 +135,7 @@ void QgsPhongMaterialWidget::setSettings( const QgsAbstractMaterialSettings *set QgsAbstractMaterialSettings *QgsPhongMaterialWidget::settings() { - std::unique_ptr m = std::make_unique(); + auto m = std::make_unique(); m->setDiffuse( btnDiffuse->color() ); m->setAmbient( btnAmbient->color() ); m->setSpecular( btnSpecular->color() ); diff --git a/src/app/3d/qgsphongtexturedmaterialwidget.cpp b/src/app/3d/qgsphongtexturedmaterialwidget.cpp index a555210a7c2d..ca43260f9fab 100644 --- a/src/app/3d/qgsphongtexturedmaterialwidget.cpp +++ b/src/app/3d/qgsphongtexturedmaterialwidget.cpp @@ -68,7 +68,7 @@ void QgsPhongTexturedMaterialWidget::setSettings( const QgsAbstractMaterialSetti QgsAbstractMaterialSettings *QgsPhongTexturedMaterialWidget::settings() { - std::unique_ptr m = std::make_unique(); + auto m = std::make_unique(); m->setAmbient( btnAmbient->color() ); m->setSpecular( btnSpecular->color() ); m->setShininess( spinShininess->value() ); diff --git a/src/app/3d/qgspoint3dsymbolwidget.cpp b/src/app/3d/qgspoint3dsymbolwidget.cpp index d2616c68e3dd..4c6df6ea9345 100644 --- a/src/app/3d/qgspoint3dsymbolwidget.cpp +++ b/src/app/3d/qgspoint3dsymbolwidget.cpp @@ -171,7 +171,7 @@ void QgsPoint3DSymbolWidget::setSymbol( const QgsAbstract3DSymbol *symbol, QgsVe QgsAbstract3DSymbol *QgsPoint3DSymbolWidget::symbol() { QVariantMap vm; - std::unique_ptr sym = std::make_unique(); + auto sym = std::make_unique(); sym->setBillboardSymbol( static_cast( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ) ) ); switch ( cboShape->currentData().value() ) { diff --git a/src/app/3d/qgspolygon3dsymbolwidget.cpp b/src/app/3d/qgspolygon3dsymbolwidget.cpp index 95cff4f26081..be6c140d6805 100644 --- a/src/app/3d/qgspolygon3dsymbolwidget.cpp +++ b/src/app/3d/qgspolygon3dsymbolwidget.cpp @@ -91,7 +91,7 @@ void QgsPolygon3DSymbolWidget::setSymbol( const QgsAbstract3DSymbol *symbol, Qgs QgsAbstract3DSymbol *QgsPolygon3DSymbolWidget::symbol() { - std::unique_ptr sym = std::make_unique(); + auto sym = std::make_unique(); sym->setOffset( static_cast( spinOffset->value() ) ); sym->setExtrusionHeight( spinExtrusion->value() ); sym->setAltitudeClamping( static_cast( cboAltClamping->currentIndex() ) ); diff --git a/src/app/3d/qgssimplelinematerialwidget.cpp b/src/app/3d/qgssimplelinematerialwidget.cpp index 7ffefe85736c..4c44f7abfe63 100644 --- a/src/app/3d/qgssimplelinematerialwidget.cpp +++ b/src/app/3d/qgssimplelinematerialwidget.cpp @@ -50,7 +50,7 @@ void QgsSimpleLineMaterialWidget::setSettings( const QgsAbstractMaterialSettings QgsAbstractMaterialSettings *QgsSimpleLineMaterialWidget::settings() { - std::unique_ptr m = std::make_unique(); + auto m = std::make_unique(); m->setAmbient( btnAmbient->color() ); mPropertyCollection.setProperty( QgsAbstractMaterialSettings::Property::Ambient, mAmbientDataDefinedButton->toProperty() ); diff --git a/src/app/decorations/qgsdecorationscalebar.cpp b/src/app/decorations/qgsdecorationscalebar.cpp index e8a831b910bc..543e8a146f8b 100644 --- a/src/app/decorations/qgsdecorationscalebar.cpp +++ b/src/app/decorations/qgsdecorationscalebar.cpp @@ -151,11 +151,11 @@ void QgsDecorationScaleBar::setupScaleBar() case 0: case 1: { - std::unique_ptr tickStyle = std::make_unique(); + auto tickStyle = std::make_unique(); tickStyle->setTickPosition( mStyleIndex == 0 ? QgsTicksScaleBarRenderer::TicksDown : QgsTicksScaleBarRenderer::TicksUp ); mStyle = std::move( tickStyle ); - std::unique_ptr fillSymbol = std::make_unique(); + auto fillSymbol = std::make_unique(); fillSymbol->setColor( mColor ); // Compatibility with pre 3.2 configuration if ( QgsSimpleFillSymbolLayer *fill = dynamic_cast( fillSymbol->symbolLayer( 0 ) ) ) { @@ -163,7 +163,7 @@ void QgsDecorationScaleBar::setupScaleBar() } mSettings.setFillSymbol( fillSymbol.release() ); - std::unique_ptr lineSymbol = std::make_unique(); + auto lineSymbol = std::make_unique(); lineSymbol->setColor( mColor ); // Compatibility with pre 3.2 configuration lineSymbol->setWidth( 0.3 ); lineSymbol->setOutputUnit( Qgis::RenderUnit::Millimeters ); @@ -178,7 +178,7 @@ void QgsDecorationScaleBar::setupScaleBar() mStyle = std::make_unique(); - std::unique_ptr fillSymbol = std::make_unique(); + auto fillSymbol = std::make_unique(); fillSymbol->setColor( mColor ); if ( QgsSimpleFillSymbolLayer *fill = dynamic_cast( fillSymbol->symbolLayer( 0 ) ) ) { @@ -186,7 +186,7 @@ void QgsDecorationScaleBar::setupScaleBar() } mSettings.setFillSymbol( fillSymbol.release() ); - std::unique_ptr fillSymbol2 = std::make_unique(); + auto fillSymbol2 = std::make_unique(); fillSymbol2->setColor( QColor( 255, 255, 255, 0 ) ); if ( QgsSimpleFillSymbolLayer *fill = dynamic_cast( fillSymbol2->symbolLayer( 0 ) ) ) { @@ -195,7 +195,7 @@ void QgsDecorationScaleBar::setupScaleBar() mSettings.setAlternateFillSymbol( fillSymbol2.release() ); mSettings.setHeight( mStyleIndex == 2 ? 1 : 3 ); - std::unique_ptr lineSymbol = std::make_unique(); + auto lineSymbol = std::make_unique(); lineSymbol->setColor( mOutlineColor ); // Compatibility with pre 3.2 configuration lineSymbol->setWidth( mStyleIndex == 2 ? 0.2 : 0.3 ); lineSymbol->setOutputUnit( Qgis::RenderUnit::Millimeters ); diff --git a/src/app/devtools/networklogger/qgsnetworklogger.cpp b/src/app/devtools/networklogger/qgsnetworklogger.cpp index 4d7dc56b88b2..7d0775584dfe 100644 --- a/src/app/devtools/networklogger/qgsnetworklogger.cpp +++ b/src/app/devtools/networklogger/qgsnetworklogger.cpp @@ -79,7 +79,7 @@ void QgsNetworkLogger::requestAboutToBeCreated( QgsNetworkRequestParameters para beginInsertRows( QModelIndex(), childCount, childCount ); - std::unique_ptr group = std::make_unique( parameters ); + auto group = std::make_unique( parameters ); mRequestGroups.insert( parameters.requestId(), group.get() ); mRootNode->addChild( std::move( group ) ); endInsertRows(); diff --git a/src/app/devtools/networklogger/qgsnetworkloggernode.cpp b/src/app/devtools/networklogger/qgsnetworkloggernode.cpp index 317ff3534199..f0b6a45c9069 100644 --- a/src/app/devtools/networklogger/qgsnetworkloggernode.cpp +++ b/src/app/devtools/networklogger/qgsnetworkloggernode.cpp @@ -72,7 +72,7 @@ QgsNetworkLoggerRequestGroup::QgsNetworkLoggerRequestGroup( const QgsNetworkRequ mHeaders.append( qMakePair( QString( header ), QString( request.request().rawHeader( header ) ) ) ); } - std::unique_ptr detailsGroup = std::make_unique( request ); + auto detailsGroup = std::make_unique( request ); mDetailsGroup = static_cast( addChild( std::move( detailsGroup ) ) ); mTimer.start(); @@ -273,7 +273,7 @@ void QgsNetworkLoggerRequestGroup::setReply( const QgsNetworkReplyContent &reply mContentType = reply.rawHeader( "Content - Type" ); mReplyFromCache = reply.attribute( QNetworkRequest::SourceIsFromCacheAttribute ).toBool(); - std::unique_ptr replyGroup = std::make_unique( reply ); + auto replyGroup = std::make_unique( reply ); mReplyGroup = static_cast( addChild( std::move( replyGroup ) ) ); } @@ -294,7 +294,7 @@ void QgsNetworkLoggerRequestGroup::setSslErrors( const QList &errors mHasSslErrors = !errors.empty(); if ( mHasSslErrors ) { - std::unique_ptr errorGroup = std::make_unique( errors ); + auto errorGroup = std::make_unique( errors ); mSslErrorsGroup = static_cast( addChild( std::move( errorGroup ) ) ); } } @@ -373,11 +373,11 @@ QgsNetworkLoggerRequestDetailsGroup::QgsNetworkLoggerRequestDetailsGroup( const if ( !QUrlQuery( request.request().url() ).queryItems().isEmpty() ) { - std::unique_ptr queryGroup = std::make_unique( request.request().url() ); + auto queryGroup = std::make_unique( request.request().url() ); mQueryGroup = static_cast( addChild( std::move( queryGroup ) ) ); } - std::unique_ptr requestHeadersGroup = std::make_unique( request ); + auto requestHeadersGroup = std::make_unique( request ); mRequestHeaders = static_cast( addChild( std::move( requestHeadersGroup ) ) ); switch ( request.operation() ) @@ -389,7 +389,7 @@ QgsNetworkLoggerRequestDetailsGroup::QgsNetworkLoggerRequestDetailsGroup( const case QNetworkAccessManager::PostOperation: case QNetworkAccessManager::PutOperation: { - std::unique_ptr postContentGroup = std::make_unique( request ); + auto postContentGroup = std::make_unique( request ); mPostContent = static_cast( addChild( std::move( postContentGroup ) ) ); break; } @@ -400,7 +400,7 @@ QgsNetworkLoggerRequestDetailsGroup::QgsNetworkLoggerRequestDetailsGroup( const { if ( !request.content().isEmpty() ) { - std::unique_ptr postContentGroup = std::make_unique( request ); + auto postContentGroup = std::make_unique( request ); mPostContent = static_cast( addChild( std::move( postContentGroup ) ) ); } break; @@ -477,7 +477,7 @@ QgsNetworkLoggerReplyGroup::QgsNetworkLoggerReplyGroup( const QgsNetworkReplyCon } addKeyValueNode( QObject::tr( "Cache (result)" ), reply.attribute( QNetworkRequest::SourceIsFromCacheAttribute ).toBool() ? QObject::tr( "Used entry from cache" ) : QObject::tr( "Read from network" ) ); - std::unique_ptr headersGroup = std::make_unique( reply ); + auto headersGroup = std::make_unique( reply ); mReplyHeaders = static_cast( addChild( std::move( headersGroup ) ) ); } diff --git a/src/app/devtools/querylogger/qgsappquerylogger.cpp b/src/app/devtools/querylogger/qgsappquerylogger.cpp index a112ab640f47..a8dad382b013 100644 --- a/src/app/devtools/querylogger/qgsappquerylogger.cpp +++ b/src/app/devtools/querylogger/qgsappquerylogger.cpp @@ -53,7 +53,7 @@ void QgsAppQueryLogger::queryLogged( const QgsDatabaseQueryLogEntry &query ) beginInsertRows( QModelIndex(), childCount, childCount ); - std::unique_ptr group = std::make_unique( query ); + auto group = std::make_unique( query ); mQueryGroups.insert( query.queryId, group.get() ); mRootNode->addChild( std::move( group ) ); endInsertRows(); diff --git a/src/app/devtools/querylogger/qgsdatabasequeryloggernode.cpp b/src/app/devtools/querylogger/qgsdatabasequeryloggernode.cpp index 15eb4eb76bca..2dc20c1c38d9 100644 --- a/src/app/devtools/querylogger/qgsdatabasequeryloggernode.cpp +++ b/src/app/devtools/querylogger/qgsdatabasequeryloggernode.cpp @@ -65,7 +65,7 @@ QgsDatabaseQueryLoggerQueryGroup::QgsDatabaseQueryLoggerQueryGroup( const QgsDat , mQueryId( query.queryId ) { #if 0 - std::unique_ptr< QgsNetworkLoggerRequestDetailsGroup > detailsGroup = std::make_unique< QgsNetworkLoggerRequestDetailsGroup >( request ); + auto detailsGroup = std::make_unique< QgsNetworkLoggerRequestDetailsGroup >( request ); mDetailsGroup = detailsGroup.get(); addChild( std::move( detailsGroup ) ); #endif diff --git a/src/app/elevation/qgselevationprofilewidget.cpp b/src/app/elevation/qgselevationprofilewidget.cpp index d30c409046b7..5975a409c527 100644 --- a/src/app/elevation/qgselevationprofilewidget.cpp +++ b/src/app/elevation/qgselevationprofilewidget.cpp @@ -971,18 +971,18 @@ void QgsElevationProfileWidget::createOrUpdateRubberBands() QgsSymbolLayerList layers; - std::unique_ptr bottomLayer = std::make_unique(); + auto bottomLayer = std::make_unique(); bottomLayer->setWidth( 0.8 ); bottomLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); bottomLayer->setColor( QColor( 40, 40, 40, 100 ) ); bottomLayer->setPenCapStyle( Qt::PenCapStyle::FlatCap ); layers.append( bottomLayer.release() ); - std::unique_ptr arrowLayer = std::make_unique(); + auto arrowLayer = std::make_unique(); arrowLayer->setPlacements( Qgis::MarkerLinePlacement::CentralPoint ); QgsSymbolLayerList markerLayers; - std::unique_ptr arrowSymbolLayer = std::make_unique( Qgis::MarkerShape::EquilateralTriangle ); + auto arrowSymbolLayer = std::make_unique( Qgis::MarkerShape::EquilateralTriangle ); arrowSymbolLayer->setSize( 4 ); arrowSymbolLayer->setAngle( 90 ); arrowSymbolLayer->setSizeUnit( Qgis::RenderUnit::Millimeters ); @@ -991,12 +991,12 @@ void QgsElevationProfileWidget::createOrUpdateRubberBands() arrowSymbolLayer->setStrokeWidth( 0.2 ); markerLayers.append( arrowSymbolLayer.release() ); - std::unique_ptr markerSymbol = std::make_unique( markerLayers ); + auto markerSymbol = std::make_unique( markerLayers ); arrowLayer->setSubSymbol( markerSymbol.release() ); layers.append( arrowLayer.release() ); - std::unique_ptr topLayer = std::make_unique(); + auto topLayer = std::make_unique(); topLayer->setWidth( 0.4 ); topLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); topLayer->setColor( QColor( 255, 255, 255, 255 ) ); @@ -1004,7 +1004,7 @@ void QgsElevationProfileWidget::createOrUpdateRubberBands() topLayer->setPenCapStyle( Qt::PenCapStyle::FlatCap ); layers.append( topLayer.release() ); - std::unique_ptr symbol = std::make_unique( layers ); + auto symbol = std::make_unique( layers ); mRubberBand->setSymbol( symbol.release() ); mRubberBand->updatePosition(); @@ -1023,12 +1023,12 @@ void QgsElevationProfileWidget::createOrUpdateRubberBands() QgsSymbolLayerList layers; - std::unique_ptr bottomLayer = std::make_unique(); + auto bottomLayer = std::make_unique(); bottomLayer->setColor( QColor( 40, 40, 40, 50 ) ); bottomLayer->setStrokeColor( QColor( 255, 255, 255, 150 ) ); layers.append( bottomLayer.release() ); - std::unique_ptr symbol = std::make_unique( layers ); + auto symbol = std::make_unique( layers ); mToleranceRubberBand->setSymbol( symbol.release() ); } diff --git a/src/app/georeferencer/qgsgeorefmainwindow.cpp b/src/app/georeferencer/qgsgeorefmainwindow.cpp index a9fb53cc7874..8f1ac05f0fee 100644 --- a/src/app/georeferencer/qgsgeorefmainwindow.cpp +++ b/src/app/georeferencer/qgsgeorefmainwindow.cpp @@ -1616,7 +1616,7 @@ bool QgsGeoreferencerMainWindow::georeferenceRaster() mUserResY ); - std::unique_ptr progressDialog = std::make_unique( tr( "Georeferencing layer…" ), tr( "Abort" ), 0, 100, this ); + auto progressDialog = std::make_unique( tr( "Georeferencing layer…" ), tr( "Abort" ), 0, 100, this ); progressDialog->setWindowTitle( tr( "Georeferencer" ) ); connect( task, &QgsTask::progressChanged, progressDialog.get(), [&]( double progress ) { progressDialog->setValue( static_cast( progress ) ); @@ -1676,7 +1676,7 @@ bool QgsGeoreferencerMainWindow::georeferenceVector() { QgsVectorWarperTask *task = new QgsVectorWarperTask( mTransformMethod, mPoints.asPoints(), mTargetCrs, qobject_cast( mLayer.get() ), mModifiedFileName ); - std::unique_ptr progressDialog = std::make_unique( tr( "Georeferencing layer…" ), tr( "Abort" ), 0, 100, this ); + auto progressDialog = std::make_unique( tr( "Georeferencing layer…" ), tr( "Abort" ), 0, 100, this ); progressDialog->setWindowTitle( tr( "Georeferencer" ) ); connect( task, &QgsTask::progressChanged, progressDialog.get(), [&]( double progress ) { progressDialog->setValue( static_cast( progress ) ); @@ -1852,7 +1852,7 @@ bool QgsGeoreferencerMainWindow::writePDFMapFile( const QString &fileName, const //create layout QgsLayout layout( QgsProject::instance() ); - std::unique_ptr page = std::make_unique( &layout ); + auto page = std::make_unique( &layout ); double leftMargin = 8; double topMargin = 8; @@ -1919,10 +1919,10 @@ bool QgsGeoreferencerMainWindow::writePDFReportFile( const QString &fileName, co //create layout A4 with 300 dpi QgsLayout layout( QgsProject::instance() ); - std::unique_ptr page = std::make_unique( &layout ); + auto page = std::make_unique( &layout ); page->setPageSize( QgsLayoutSize( 210, 297 ) ); //A4 layout.pageCollection()->addPage( page.release() ); - std::unique_ptr page2 = std::make_unique( &layout ); + auto page2 = std::make_unique( &layout ); page2->setPageSize( QgsLayoutSize( 210, 297 ) ); //A4 layout.pageCollection()->addPage( page2.release() ); diff --git a/src/app/gps/qgsappgpslogging.cpp b/src/app/gps/qgsappgpslogging.cpp index e969a3f31f09..4116477cf0a1 100644 --- a/src/app/gps/qgsappgpslogging.cpp +++ b/src/app/gps/qgsappgpslogging.cpp @@ -312,7 +312,7 @@ bool QgsAppGpsLogging::createOrUpdateLogDatabase() bool createPointLayer = true; if ( !newFile ) { - std::unique_ptr testLayer = std::make_unique( ogrMetadata->encodeUri( { { QStringLiteral( "path" ), mGpkgLogFile }, { QStringLiteral( "layerName" ), QStringLiteral( "gps_points" ) } } ), QString(), QStringLiteral( "ogr" ) ); + auto testLayer = std::make_unique( ogrMetadata->encodeUri( { { QStringLiteral( "path" ), mGpkgLogFile }, { QStringLiteral( "layerName" ), QStringLiteral( "gps_points" ) } } ), QString(), QStringLiteral( "ogr" ) ); if ( testLayer->isValid() ) { createPointLayer = false; @@ -353,7 +353,7 @@ bool QgsAppGpsLogging::createOrUpdateLogDatabase() bool createTracksLayer = true; if ( !newFile ) { - std::unique_ptr testLayer = std::make_unique( ogrMetadata->encodeUri( { { QStringLiteral( "path" ), mGpkgLogFile }, { QStringLiteral( "layerName" ), QStringLiteral( "gps_tracks" ) } } ), QString(), QStringLiteral( "ogr" ) ); + auto testLayer = std::make_unique( ogrMetadata->encodeUri( { { QStringLiteral( "path" ), mGpkgLogFile }, { QStringLiteral( "layerName" ), QStringLiteral( "gps_tracks" ) } } ), QString(), QStringLiteral( "ogr" ) ); if ( testLayer->isValid() ) { createTracksLayer = false; diff --git a/src/app/layers/qgsapplayerhandling.cpp b/src/app/layers/qgsapplayerhandling.cpp index adbda9249223..72aff1afa31f 100644 --- a/src/app/layers/qgsapplayerhandling.cpp +++ b/src/app/layers/qgsapplayerhandling.cpp @@ -95,7 +95,7 @@ void QgsAppLayerHandling::postProcessAddedLayer( QgsMapLayer *layer ) { if ( rasterLayer->elevationProperties()->hasElevation() ) { - std::unique_ptr terrain = std::make_unique(); + auto terrain = std::make_unique(); terrain->setLayer( rasterLayer ); QgsProject::instance()->elevationProperties()->setTerrainProvider( terrain.release() @@ -170,7 +170,7 @@ void QgsAppLayerHandling::postProcessAddedLayer( QgsMapLayer *layer ) #ifdef HAVE_3D if ( !layer->renderer3D() ) { - std::unique_ptr renderer3D = std::make_unique(); + auto renderer3D = std::make_unique(); layer->setRenderer3D( renderer3D.release() ); } #endif @@ -195,7 +195,7 @@ void QgsAppLayerHandling::postProcessAddedLayer( QgsMapLayer *layer ) // If the layer has no 3D renderer and syncing 3D to 2D renderer is enabled, we create a renderer and set it up with the 2D renderer if ( pcLayer->sync3DRendererTo2DRenderer() ) { - std::unique_ptr renderer3D = std::make_unique(); + auto renderer3D = std::make_unique(); renderer3D->convertFrom2DRenderer( pcLayer->renderer() ); // if overview of the virtual point cloud exists set the zoom out behavior to show it if ( const QgsVirtualPointCloudProvider *vpcProvider = dynamic_cast( pcLayer->dataProvider() ) ) @@ -1652,7 +1652,7 @@ void QgsAppLayerHandling::resolveVectorLayerDependencies( QgsVectorLayer *vl, Qg } } // Load it! - std::unique_ptr newVl = std::make_unique( layerUri, !dependency.name.isEmpty() ? dependency.name : tableName, providerName ); + auto newVl = std::make_unique( layerUri, !dependency.name.isEmpty() ? dependency.name : tableName, providerName ); if ( newVl->isValid() ) { return qobject_cast( QgsProject::instance()->addMapLayer( newVl.release() ) ); diff --git a/src/app/layout/qgslayoutdesignerdialog.cpp b/src/app/layout/qgslayoutdesignerdialog.cpp index efbd8675dcac..3596563a9f13 100644 --- a/src/app/layout/qgslayoutdesignerdialog.cpp +++ b/src/app/layout/qgslayoutdesignerdialog.cpp @@ -2720,8 +2720,8 @@ void QgsLayoutDesignerDialog::printAtlas() printSettings.predefinedMapScales = QgsLayoutUtils::predefinedScales( mLayout ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Printing maps…" ), tr( "Abort" ), 0, 100, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Printing maps…" ), tr( "Abort" ), 0, 100, this ); progressDialog->setWindowTitle( tr( "Printing Atlas" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Printing “%1”" ).arg( mMasterLayout->name() ) ); @@ -2910,8 +2910,8 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster() QgsAtlasExportGuard exportingAtlas( this ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); progressDialog->setWindowTitle( tr( "Exporting Atlas" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3056,8 +3056,8 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg() QgsAtlasExportGuard exportingAtlas( this ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); progressDialog->setWindowTitle( tr( "Exporting Atlas" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3262,8 +3262,8 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf() pdfSettings.rasterizeWholeImage = mLayout->customProperty( QStringLiteral( "rasterize" ), false ).toBool(); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 100, this ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3383,8 +3383,8 @@ void QgsLayoutDesignerDialog::exportReportToRaster() QgsAtlasExportGuard exportingAtlas( this ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering report…" ), tr( "Abort" ), 0, 0, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering report…" ), tr( "Abort" ), 0, 0, this ); progressDialog->setWindowTitle( tr( "Exporting Report" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3492,8 +3492,8 @@ void QgsLayoutDesignerDialog::exportReportToSvg() QgsAtlasExportGuard exportingAtlas( this ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 0, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 0, this ); progressDialog->setWindowTitle( tr( "Exporting Report" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3613,8 +3613,8 @@ void QgsLayoutDesignerDialog::exportReportToPdf() pdfSettings.rasterizeWholeImage = rasterize; QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 0, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Rendering maps…" ), tr( "Abort" ), 0, 0, this ); progressDialog->setWindowTitle( tr( "Exporting Report" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) ); @@ -3706,8 +3706,8 @@ void QgsLayoutDesignerDialog::printReport() printSettings.predefinedMapScales = QgsLayoutUtils::predefinedScales( mLayout ); QString error; - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Printing maps…" ), tr( "Abort" ), 0, 0, this ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Printing maps…" ), tr( "Abort" ), 0, 0, this ); progressDialog->setWindowTitle( tr( "Printing Report" ) ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Printing “%1”" ).arg( mMasterLayout->name() ) ); @@ -3998,7 +3998,7 @@ void QgsLayoutDesignerDialog::initializeRegistry() { sInitializedRegistry = true; auto createPageWidget = ( []( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { - std::unique_ptr newWidget = std::make_unique( nullptr, item ); + auto newWidget = std::make_unique( nullptr, item ); return newWidget.release(); } ); diff --git a/src/app/layout/qgslayoutimagedrophandler.cpp b/src/app/layout/qgslayoutimagedrophandler.cpp index 070982919dd9..5d41f1c2b193 100644 --- a/src/app/layout/qgslayoutimagedrophandler.cpp +++ b/src/app/layout/qgslayoutimagedrophandler.cpp @@ -58,7 +58,7 @@ bool QgsLayoutImageDropHandler::handleFileDrop( QgsLayoutDesignerInterface *ifac if ( !iface->layout() ) return false; - std::unique_ptr item = std::make_unique( iface->layout() ); + auto item = std::make_unique( iface->layout() ); const QgsLayoutPoint layoutPoint = iface->layout()->convertFromLayoutUnits( point, iface->layout()->units() ); @@ -92,7 +92,7 @@ bool QgsLayoutImageDropHandler::handlePaste( QgsLayoutDesignerInterface *iface, return false; const QgsLayoutPoint layoutPoint = iface->layout()->convertFromLayoutUnits( pastePoint, iface->layout()->units() ); - std::unique_ptr item = std::make_unique( iface->layout() ); + auto item = std::make_unique( iface->layout() ); const QByteArray imageData = data->data( QStringLiteral( "application/x-qt-image" ) ); if ( imageData.isEmpty() ) diff --git a/src/app/layout/qgslayoutmanagerdialog.cpp b/src/app/layout/qgslayoutmanagerdialog.cpp index b2213ebee391..40b237eed363 100644 --- a/src/app/layout/qgslayoutmanagerdialog.cpp +++ b/src/app/layout/qgslayoutmanagerdialog.cpp @@ -258,7 +258,7 @@ void QgsLayoutManagerDialog::mAddButton_clicked() title = QgsProject::instance()->layoutManager()->generateUniqueTitle( QgsMasterLayoutInterface::PrintLayout ); } - std::unique_ptr layout = std::make_unique( QgsProject::instance() ); + auto layout = std::make_unique( QgsProject::instance() ); if ( loadingTemplate ) { bool loadedOK = false; @@ -319,10 +319,10 @@ void QgsLayoutManagerDialog::createReport() title = QgsProject::instance()->layoutManager()->generateUniqueTitle( QgsMasterLayoutInterface::Report ); } - std::unique_ptr report = std::make_unique( QgsProject::instance() ); + auto report = std::make_unique( QgsProject::instance() ); report->setName( title ); - std::unique_ptr header = std::make_unique( QgsProject::instance() ); + auto header = std::make_unique( QgsProject::instance() ); header->initializeDefaults(); report->setHeader( header.release() ); report->setHeaderEnabled( true ); diff --git a/src/app/layout/qgsreportfieldgroupsectionwidget.cpp b/src/app/layout/qgsreportfieldgroupsectionwidget.cpp index 4b36886f867a..2438c341607b 100644 --- a/src/app/layout/qgsreportfieldgroupsectionwidget.cpp +++ b/src/app/layout/qgsreportfieldgroupsectionwidget.cpp @@ -91,7 +91,7 @@ void QgsReportSectionFieldGroupWidget::editHeader() { if ( !mSection->header() ) { - std::unique_ptr header = std::make_unique( mSection->project() ); + auto header = std::make_unique( mSection->project() ); header->initializeDefaults(); mSection->setHeader( header.release() ); } @@ -109,7 +109,7 @@ void QgsReportSectionFieldGroupWidget::editFooter() { if ( !mSection->footer() ) { - std::unique_ptr footer = std::make_unique( mSection->project() ); + auto footer = std::make_unique( mSection->project() ); footer->initializeDefaults(); mSection->setFooter( footer.release() ); } @@ -132,7 +132,7 @@ void QgsReportSectionFieldGroupWidget::editBody() { if ( !mSection->body() ) { - std::unique_ptr body = std::make_unique( mSection->project() ); + auto body = std::make_unique( mSection->project() ); body->initializeDefaults(); mSection->setBody( body.release() ); } diff --git a/src/app/layout/qgsreportlayoutsectionwidget.cpp b/src/app/layout/qgsreportlayoutsectionwidget.cpp index 08dbaa92fc61..36aebb555e08 100644 --- a/src/app/layout/qgsreportlayoutsectionwidget.cpp +++ b/src/app/layout/qgsreportlayoutsectionwidget.cpp @@ -48,7 +48,7 @@ void QgsReportLayoutSectionWidget::editBody() { if ( !mSection->body() ) { - std::unique_ptr body = std::make_unique( mSection->project() ); + auto body = std::make_unique( mSection->project() ); body->initializeDefaults(); mSection->setBody( body.release() ); } diff --git a/src/app/layout/qgsreportorganizerwidget.cpp b/src/app/layout/qgsreportorganizerwidget.cpp index a6c4af624620..e6f94c166e93 100644 --- a/src/app/layout/qgsreportorganizerwidget.cpp +++ b/src/app/layout/qgsreportorganizerwidget.cpp @@ -89,7 +89,7 @@ void QgsReportOrganizerWidget::setEditedSection( QgsAbstractReportSection *secti void QgsReportOrganizerWidget::addLayoutSection() { - std::unique_ptr section = std::make_unique(); + auto section = std::make_unique(); QgsAbstractReportSection *newSection = section.get(); mSectionModel->addSection( mViewSections->currentIndex(), std::move( section ) ); const QModelIndex newIndex = mSectionModel->indexForSection( newSection ); @@ -98,7 +98,7 @@ void QgsReportOrganizerWidget::addLayoutSection() void QgsReportOrganizerWidget::addFieldGroupSection() { - std::unique_ptr section = std::make_unique(); + auto section = std::make_unique(); QgsAbstractReportSection *newSection = section.get(); mSectionModel->addSection( mViewSections->currentIndex(), std::move( section ) ); const QModelIndex newIndex = mSectionModel->indexForSection( newSection ); diff --git a/src/app/layout/qgsreportsectionwidget.cpp b/src/app/layout/qgsreportsectionwidget.cpp index fd91cea652e4..81c4e7df44f0 100644 --- a/src/app/layout/qgsreportsectionwidget.cpp +++ b/src/app/layout/qgsreportsectionwidget.cpp @@ -58,7 +58,7 @@ void QgsReportSectionWidget::editHeader() { if ( !mSection->header() ) { - std::unique_ptr header = std::make_unique( mSection->project() ); + auto header = std::make_unique( mSection->project() ); header->initializeDefaults(); mSection->setHeader( header.release() ); } @@ -75,7 +75,7 @@ void QgsReportSectionWidget::editFooter() { if ( !mSection->footer() ) { - std::unique_ptr footer = std::make_unique( mSection->project() ); + auto footer = std::make_unique( mSection->project() ); footer->initializeDefaults(); mSection->setFooter( footer.release() ); } diff --git a/src/app/mesh/qgsmaptooleditmeshframe.cpp b/src/app/mesh/qgsmaptooleditmeshframe.cpp index b17180c90a3a..e761b82ba38e 100644 --- a/src/app/mesh/qgsmaptooleditmeshframe.cpp +++ b/src/app/mesh/qgsmaptooleditmeshframe.cpp @@ -2429,7 +2429,7 @@ void QgsMapToolEditMeshFrame::forceByLineReleaseEvent( QgsMapMouseEvent *e ) { points.append( QgsPoint( rubbergandLines.at( i ).x(), rubbergandLines.at( i ).y(), mForcingLineZValue.isEmpty() ? defaultValue : mForcingLineZValue.at( i ) ) ); } - std::unique_ptr forcingLine = std::make_unique( points ); + auto forcingLine = std::make_unique( points ); forceByLine( QgsGeometry( forcingLine.release() ) ); mForceByLineRubberBand->reset( Qgis::GeometryType::Line ); mForcingLineZValue.clear(); diff --git a/src/app/mesh/qgsnewmeshlayerdialog.cpp b/src/app/mesh/qgsnewmeshlayerdialog.cpp index 5a4c9c4f48d8..942ea8560838 100644 --- a/src/app/mesh/qgsnewmeshlayerdialog.cpp +++ b/src/app/mesh/qgsnewmeshlayerdialog.cpp @@ -255,7 +255,7 @@ bool QgsNewMeshLayerDialog::apply() QFileInfo fileInfo( fileName ); layerName = fileInfo.completeBaseName(); } - std::unique_ptr newMeshLayer = std::make_unique( fileName, layerName, QStringLiteral( "mdal" ) ); + auto newMeshLayer = std::make_unique( fileName, layerName, QStringLiteral( "mdal" ) ); if ( newMeshLayer->crs() != crs ) newMeshLayer->setCrs( crs ); diff --git a/src/app/pluginmanager/qgspluginmanager.cpp b/src/app/pluginmanager/qgspluginmanager.cpp index 5c4807c4c895..88d0fe8ba178 100644 --- a/src/app/pluginmanager/qgspluginmanager.cpp +++ b/src/app/pluginmanager/qgspluginmanager.cpp @@ -405,7 +405,7 @@ void QgsPluginManager::getCppPluginsMetadata() QgsDebugMsgLevel( "Examining: " + lib, 2 ); try { - std::unique_ptr myLib = std::make_unique( lib ); + auto myLib = std::make_unique( lib ); const bool loaded = myLib->load(); if ( !loaded ) { diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 07454a89009c..03cb1fe9107d 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -6341,7 +6341,7 @@ bool QgisApp::addProject( const QString &projectFile ) QWidgetUpdateBlocker layerTreeViewUpdateBlocker( mLayerTreeView ); bool returnCode = false; - std::unique_ptr dirtyBlocker = std::make_unique( QgsProject::instance() ); + auto dirtyBlocker = std::make_unique( QgsProject::instance() ); QObject connectionScope; // manually control scope of layersChanged lambda connection - we need the connection automatically destroyed when this function finishes bool badLayersHandled = false; @@ -6807,7 +6807,7 @@ void QgisApp::openTemplate( const QString &fileName ) } //create new layout object - std::unique_ptr layout = std::make_unique( QgsProject::instance() ); + auto layout = std::make_unique( QgsProject::instance() ); bool loadedOk = false; layout->loadFromTemplate( templateDoc, QgsReadWriteContext(), true, &loadedOk ); if ( loadedOk ) @@ -8885,7 +8885,7 @@ QgsLayoutDesignerDialog *QgisApp::createNewReport( QString title ) title = QgsProject::instance()->layoutManager()->generateUniqueTitle( QgsMasterLayoutInterface::Report ); } //create new report - std::unique_ptr report = std::make_unique( QgsProject::instance() ); + auto report = std::make_unique( QgsProject::instance() ); report->setName( title ); QgsMasterLayoutInterface *layout = report.get(); QgsProject::instance()->layoutManager()->addLayout( report.release() ); @@ -13159,7 +13159,7 @@ void QgisApp::initLayouts() auto createRubberBand = ( []( QgsLayoutView *view ) -> QgsLayoutViewRubberBand * { return new QgsLayoutViewRectangularRubberBand( view ); } ); - std::unique_ptr map3dMetadata = std::make_unique( + auto map3dMetadata = std::make_unique( QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayout3DMapWidget( qobject_cast( item ) ); diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp index 789f3ef83ba0..baf6312395fb 100644 --- a/src/app/qgsattributetabledialog.cpp +++ b/src/app/qgsattributetabledialog.cpp @@ -561,7 +561,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer *layer, const //go through all the features and change the new attributes QgsFeatureIterator fit = layer->getFeatures( request ); - std::unique_ptr task = std::make_unique( tr( "Calculating field" ) ); + auto task = std::make_unique( tr( "Calculating field" ) ); long long count = !filteredIds.isEmpty() ? filteredIds.size() : layer->featureCount(); long long i = 0; diff --git a/src/app/qgslayertreeviewembeddedindicator.cpp b/src/app/qgslayertreeviewembeddedindicator.cpp index 359d977d6ea5..06ab2cdcf4c7 100644 --- a/src/app/qgslayertreeviewembeddedindicator.cpp +++ b/src/app/qgslayertreeviewembeddedindicator.cpp @@ -57,7 +57,7 @@ void QgsLayerTreeViewEmbeddedIndicatorProvider::onAddedChildren( QgsLayerTreeNod std::unique_ptr QgsLayerTreeViewEmbeddedIndicatorProvider::newIndicator( const QString &project ) { - std::unique_ptr indicator = std::make_unique( this ); + auto indicator = std::make_unique( this ); indicator->setIcon( mIcon ); indicator->setToolTip( tr( "Embedded from %1" ).arg( project ) ); mIndicators.insert( indicator.get() ); diff --git a/src/app/qgslayertreeviewindicatorprovider.cpp b/src/app/qgslayertreeviewindicatorprovider.cpp index b65a744228ef..f21e7401e451 100644 --- a/src/app/qgslayertreeviewindicatorprovider.cpp +++ b/src/app/qgslayertreeviewindicatorprovider.cpp @@ -161,7 +161,7 @@ void QgsLayerTreeViewIndicatorProvider::updateLayerIndicator( QgsMapLayer *layer std::unique_ptr QgsLayerTreeViewIndicatorProvider::newIndicator( QgsMapLayer *layer ) { - std::unique_ptr indicator = std::make_unique( this ); + auto indicator = std::make_unique( this ); indicator->setIcon( QgsApplication::getThemeIcon( iconName( layer ) ) ); indicator->setToolTip( tooltipText( layer ) ); connect( indicator.get(), &QgsLayerTreeViewIndicator::clicked, this, &QgsLayerTreeViewIndicatorProvider::onIndicatorClicked ); diff --git a/src/app/qgsmaptooladdfeature.cpp b/src/app/qgsmaptooladdfeature.cpp index d8350afec3ad..7abf35769208 100644 --- a/src/app/qgsmaptooladdfeature.cpp +++ b/src/app/qgsmaptooladdfeature.cpp @@ -49,7 +49,7 @@ QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas *canvas, CaptureMode mo std::unique_ptr QgsMapToolAddFeature::createHighlight( QgsVectorLayer *layer, const QgsFeature &f ) { - std::unique_ptr highlight = std::make_unique( mCanvas, f.geometry(), layer ); + auto highlight = std::make_unique( mCanvas, f.geometry(), layer ); highlight->applyDefaultStyle(); switch ( f.geometry().type() ) diff --git a/src/app/qgsstatisticalsummarydockwidget.cpp b/src/app/qgsstatisticalsummarydockwidget.cpp index f7a20dbc1657..784695316baf 100644 --- a/src/app/qgsstatisticalsummarydockwidget.cpp +++ b/src/app/qgsstatisticalsummarydockwidget.cpp @@ -263,7 +263,7 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics() } const long featureCount = selectedOnly ? mLayer->selectedFeatureCount() : mLayer->featureCount(); - std::unique_ptr gatherer = std::make_unique( mLayer, fit, featureCount, sourceFieldExp, mFieldType, statsToCalc, stringStatsToCalc, dateTimeStatsToCalc ); + auto gatherer = std::make_unique( mLayer, fit, featureCount, sourceFieldExp, mFieldType, statsToCalc, stringStatsToCalc, dateTimeStatsToCalc ); switch ( mFieldType ) { case DataType::Numeric: diff --git a/src/app/qgstemplateprojectsmodel.cpp b/src/app/qgstemplateprojectsmodel.cpp index 4e8f5ae48ad7..698c553183e1 100644 --- a/src/app/qgstemplateprojectsmodel.cpp +++ b/src/app/qgstemplateprojectsmodel.cpp @@ -102,7 +102,7 @@ void QgsTemplateProjectsModel::scanDirectory( const QString &path ) // Refill with templates from this directory for ( const QFileInfo &file : files ) { - std::unique_ptr item = std::make_unique( file.fileName() ); + auto item = std::make_unique( file.fileName() ); const QString fileId = QCryptographicHash::hash( file.filePath().toUtf8(), QCryptographicHash::Sha224 ).toHex(); diff --git a/src/core/annotations/qgsannotationlayer.cpp b/src/core/annotations/qgsannotationlayer.cpp index 863f21b32e70..4066a0d4b9c4 100644 --- a/src/core/annotations/qgsannotationlayer.cpp +++ b/src/core/annotations/qgsannotationlayer.cpp @@ -320,7 +320,7 @@ QgsAnnotationLayer *QgsAnnotationLayer::clone() const QGIS_PROTECT_QOBJECT_THREAD_ACCESS const QgsAnnotationLayer::LayerOptions options( mTransformContext ); - std::unique_ptr< QgsAnnotationLayer > layer = std::make_unique< QgsAnnotationLayer >( name(), options ); + auto layer = std::make_unique< QgsAnnotationLayer >( name(), options ); QgsMapLayer::clone( layer.get() ); for ( auto it = mItems.constBegin(); it != mItems.constEnd(); ++it ) diff --git a/src/core/annotations/qgsannotationlayerrenderer.cpp b/src/core/annotations/qgsannotationlayerrenderer.cpp index 52052c4e0b1e..4797854cdb74 100644 --- a/src/core/annotations/qgsannotationlayerrenderer.cpp +++ b/src/core/annotations/qgsannotationlayerrenderer.cpp @@ -108,7 +108,7 @@ bool QgsAnnotationLayerRenderer::render() if ( bounds.intersects( context.extent() ) ) { item.second->render( context, mFeedback.get() ); - std::unique_ptr< QgsRenderedAnnotationItemDetails > details = std::make_unique< QgsRenderedAnnotationItemDetails >( mLayerID, item.first ); + auto details = std::make_unique< QgsRenderedAnnotationItemDetails >( mLayerID, item.first ); details->setBoundingBox( bounds ); appendRenderedItemDetails( details.release() ); } diff --git a/src/core/annotations/qgsannotationlineitem.cpp b/src/core/annotations/qgsannotationlineitem.cpp index c0bf248217c8..9d8e37e8a1b0 100644 --- a/src/core/annotations/qgsannotationlineitem.cpp +++ b/src/core/annotations/qgsannotationlineitem.cpp @@ -202,7 +202,7 @@ QgsRectangle QgsAnnotationLineItem::boundingBox() const QgsAnnotationLineItem *QgsAnnotationLineItem::clone() const { - std::unique_ptr< QgsAnnotationLineItem > item = std::make_unique< QgsAnnotationLineItem >( mCurve->clone() ); + auto item = std::make_unique< QgsAnnotationLineItem >( mCurve->clone() ); item->setSymbol( mSymbol->clone() ); item->copyCommonProperties( this ); return item.release(); diff --git a/src/core/annotations/qgsannotationlinetextitem.cpp b/src/core/annotations/qgsannotationlinetextitem.cpp index 7e19981aa795..68ec16801ff5 100644 --- a/src/core/annotations/qgsannotationlinetextitem.cpp +++ b/src/core/annotations/qgsannotationlinetextitem.cpp @@ -249,7 +249,7 @@ QgsRectangle QgsAnnotationLineTextItem::boundingBox( QgsRenderContext &context ) QgsAnnotationLineTextItem *QgsAnnotationLineTextItem::clone() const { - std::unique_ptr< QgsAnnotationLineTextItem > item = std::make_unique< QgsAnnotationLineTextItem >( mText, mCurve->clone() ); + auto item = std::make_unique< QgsAnnotationLineTextItem >( mText, mCurve->clone() ); item->setFormat( mTextFormat ); item->setOffsetFromLine( mOffsetFromLineDistance ); item->setOffsetFromLineUnit( mOffsetFromLineUnit ); diff --git a/src/core/annotations/qgsannotationmanager.cpp b/src/core/annotations/qgsannotationmanager.cpp index 68ce5196c163..fbd73f266d8b 100644 --- a/src/core/annotations/qgsannotationmanager.cpp +++ b/src/core/annotations/qgsannotationmanager.cpp @@ -192,7 +192,7 @@ std::unique_ptr QgsAnnotationManager::convertToAnnotationItem destination->setCalloutAnchor( QgsGeometry::fromPointXY( mapPosition ) ); - std::unique_ptr< QgsBalloonCallout > callout = std::make_unique< QgsBalloonCallout >(); + auto callout = std::make_unique< QgsBalloonCallout >(); if ( QgsFillSymbol *fill = source->fillSymbol() ) callout->setFillSymbol( fill->clone() ); @@ -222,8 +222,8 @@ std::unique_ptr QgsAnnotationManager::convertToAnnotationItem QgsDebugError( QStringLiteral( "Error transforming annotation position" ) ); } - std::unique_ptr< QgsAnnotationPictureItem > item = std::make_unique< QgsAnnotationPictureItem >( Qgis::PictureFormat::SVG, - svg->filePath(), QgsRectangle::fromCenterAndSize( mapPosition, 1, 1 ) ); + auto item = std::make_unique< QgsAnnotationPictureItem >( Qgis::PictureFormat::SVG, + svg->filePath(), QgsRectangle::fromCenterAndSize( mapPosition, 1, 1 ) ); if ( !setCommonProperties( annotation, item.get() ) ) return nullptr; @@ -267,7 +267,7 @@ std::unique_ptr QgsAnnotationManager::convertToAnnotationItem QgsDebugError( QStringLiteral( "Error transforming annotation position" ) ); } - std::unique_ptr< QgsAnnotationRectangleTextItem > item = std::make_unique< QgsAnnotationRectangleTextItem >( text->document()->toHtml(), QgsRectangle::fromCenterAndSize( mapPosition, 1, 1 ) ); + auto item = std::make_unique< QgsAnnotationRectangleTextItem >( text->document()->toHtml(), QgsRectangle::fromCenterAndSize( mapPosition, 1, 1 ) ); if ( !setCommonProperties( annotation, item.get() ) ) return nullptr; diff --git a/src/core/annotations/qgsannotationmarkeritem.cpp b/src/core/annotations/qgsannotationmarkeritem.cpp index e39ff003ac9a..36cab2ca81a9 100644 --- a/src/core/annotations/qgsannotationmarkeritem.cpp +++ b/src/core/annotations/qgsannotationmarkeritem.cpp @@ -156,7 +156,7 @@ bool QgsAnnotationMarkerItem::readXml( const QDomElement &element, const QgsRead QgsAnnotationMarkerItem *QgsAnnotationMarkerItem::clone() const { - std::unique_ptr< QgsAnnotationMarkerItem > item = std::make_unique< QgsAnnotationMarkerItem >( mPoint ); + auto item = std::make_unique< QgsAnnotationMarkerItem >( mPoint ); item->setSymbol( mSymbol->clone() ); item->copyCommonProperties( this ); return item.release(); diff --git a/src/core/annotations/qgsannotationpictureitem.cpp b/src/core/annotations/qgsannotationpictureitem.cpp index 71c0450c9e54..e1761501253e 100644 --- a/src/core/annotations/qgsannotationpictureitem.cpp +++ b/src/core/annotations/qgsannotationpictureitem.cpp @@ -132,7 +132,7 @@ bool QgsAnnotationPictureItem::readXml( const QDomElement &element, const QgsRea QgsAnnotationPictureItem *QgsAnnotationPictureItem::clone() const { - std::unique_ptr< QgsAnnotationPictureItem > item = std::make_unique< QgsAnnotationPictureItem >( mFormat, mPath, bounds() ); + auto item = std::make_unique< QgsAnnotationPictureItem >( mFormat, mPath, bounds() ); item->setLockAspectRatio( mLockAspectRatio ); item->copyCommonProperties( this ); diff --git a/src/core/annotations/qgsannotationpointtextitem.cpp b/src/core/annotations/qgsannotationpointtextitem.cpp index 5311d840edc5..c5a135c41058 100644 --- a/src/core/annotations/qgsannotationpointtextitem.cpp +++ b/src/core/annotations/qgsannotationpointtextitem.cpp @@ -136,7 +136,7 @@ bool QgsAnnotationPointTextItem::readXml( const QDomElement &element, const QgsR QgsAnnotationPointTextItem *QgsAnnotationPointTextItem::clone() const { - std::unique_ptr< QgsAnnotationPointTextItem > item = std::make_unique< QgsAnnotationPointTextItem >( mText, mPoint ); + auto item = std::make_unique< QgsAnnotationPointTextItem >( mText, mPoint ); item->setFormat( mTextFormat ); item->setAngle( mAngle ); item->setAlignment( mAlignment ); diff --git a/src/core/annotations/qgsannotationpolygonitem.cpp b/src/core/annotations/qgsannotationpolygonitem.cpp index b401dbb5c286..061a56e77760 100644 --- a/src/core/annotations/qgsannotationpolygonitem.cpp +++ b/src/core/annotations/qgsannotationpolygonitem.cpp @@ -226,7 +226,7 @@ bool QgsAnnotationPolygonItem::readXml( const QDomElement &element, const QgsRea QgsAnnotationPolygonItem *QgsAnnotationPolygonItem::clone() const { - std::unique_ptr< QgsAnnotationPolygonItem > item = std::make_unique< QgsAnnotationPolygonItem >( mPolygon->clone() ); + auto item = std::make_unique< QgsAnnotationPolygonItem >( mPolygon->clone() ); item->setSymbol( mSymbol->clone() ); item->copyCommonProperties( this );; return item.release(); diff --git a/src/core/annotations/qgsannotationrectangletextitem.cpp b/src/core/annotations/qgsannotationrectangletextitem.cpp index c4faed5ca7c7..85aaedb4138d 100644 --- a/src/core/annotations/qgsannotationrectangletextitem.cpp +++ b/src/core/annotations/qgsannotationrectangletextitem.cpp @@ -108,7 +108,7 @@ bool QgsAnnotationRectangleTextItem::readXml( const QDomElement &element, const QgsAnnotationRectangleTextItem *QgsAnnotationRectangleTextItem::clone() const { - std::unique_ptr< QgsAnnotationRectangleTextItem > item = std::make_unique< QgsAnnotationRectangleTextItem >( mText, bounds() ); + auto item = std::make_unique< QgsAnnotationRectangleTextItem >( mText, bounds() ); item->setFormat( mTextFormat ); item->setAlignment( mAlignment ); diff --git a/src/core/browser/qgsfilebaseddataitemprovider.cpp b/src/core/browser/qgsfilebaseddataitemprovider.cpp index 844ac78e1d8a..57fdfaa054cc 100644 --- a/src/core/browser/qgsfilebaseddataitemprovider.cpp +++ b/src/core/browser/qgsfilebaseddataitemprovider.cpp @@ -85,7 +85,7 @@ QVector QgsProviderSublayerItem::createChildren() if ( !relations.empty() || !relationError.isEmpty() ) { - std::unique_ptr< QgsRelationshipsItem > relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ), QString(), mDetails.name() ); + auto relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ), QString(), mDetails.name() ); // force this item to appear last by setting a maximum string value for the sort key relationsItem->setSortKey( QString( QChar( 0x11FFFF ) ) ); children.append( relationsItem.release() ); @@ -346,7 +346,7 @@ QVector QgsFileDataCollectionItem::createChildren() if ( !fieldDomains.empty() || !domainError.isEmpty() ) { - std::unique_ptr< QgsFieldDomainsItem > domainsItem = std::make_unique< QgsFieldDomainsItem >( this, mPath + "/domains", conn->uri(), QStringLiteral( "ogr" ) ); + auto domainsItem = std::make_unique< QgsFieldDomainsItem >( this, mPath + "/domains", conn->uri(), QStringLiteral( "ogr" ) ); // force this item to appear last by setting a maximum string value for the sort key domainsItem->setSortKey( QString( QChar( 0x10FFFF ) ) ); children.append( domainsItem.release() ); @@ -367,7 +367,7 @@ QVector QgsFileDataCollectionItem::createChildren() if ( !relations.empty() || !relationError.isEmpty() ) { - std::unique_ptr< QgsRelationshipsItem > relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ) ); + auto relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ) ); // force this item to appear last by setting a maximum string value for the sort key relationsItem->setSortKey( QString( QChar( 0x11FFFF ) ) ); children.append( relationsItem.release() ); diff --git a/src/core/browser/qgszipitem.cpp b/src/core/browser/qgszipitem.cpp index 1d77dbc2d814..f3d75e0eca59 100644 --- a/src/core/browser/qgszipitem.cpp +++ b/src/core/browser/qgszipitem.cpp @@ -179,7 +179,7 @@ QgsDataItem *QgsZipItem::itemFromPath( QgsDataItem *parent, const QString &fileP if ( !QgsGdalUtils::isVsiArchivePrefix( vsiPrefix ) ) return nullptr; - std::unique_ptr< QgsZipItem > zipItem = std::make_unique< QgsZipItem >( parent, name, filePath, path ); + auto zipItem = std::make_unique< QgsZipItem >( parent, name, filePath, path ); // force populate zipItem if it has less than 10 items and is not a .tgz or .tar.gz file (slow loading) // for other items populating will be delayed until item is opened // this might be polluting the tree with empty items but is necessary for performance reasons diff --git a/src/core/callouts/qgscallout.cpp b/src/core/callouts/qgscallout.cpp index d77536145d50..7e674cfbdfd5 100644 --- a/src/core/callouts/qgscallout.cpp +++ b/src/core/callouts/qgscallout.cpp @@ -555,7 +555,7 @@ QgsSimpleLineCallout::QgsSimpleLineCallout( const QgsSimpleLineCallout &other ) QgsCallout *QgsSimpleLineCallout::create( const QVariantMap &properties, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsSimpleLineCallout > callout = std::make_unique< QgsSimpleLineCallout >(); + auto callout = std::make_unique< QgsSimpleLineCallout >(); callout->readProperties( properties, context ); return callout.release(); } @@ -764,7 +764,7 @@ QgsManhattanLineCallout::QgsManhattanLineCallout( const QgsManhattanLineCallout QgsCallout *QgsManhattanLineCallout::create( const QVariantMap &properties, const QgsReadWriteContext &context ) // cppcheck-suppress duplInheritedMember { - std::unique_ptr< QgsManhattanLineCallout > callout = std::make_unique< QgsManhattanLineCallout >(); + auto callout = std::make_unique< QgsManhattanLineCallout >(); callout->readProperties( properties, context ); return callout.release(); } @@ -804,7 +804,7 @@ QgsCurvedLineCallout::QgsCurvedLineCallout( const QgsCurvedLineCallout &other ) QgsCallout *QgsCurvedLineCallout::create( const QVariantMap &properties, const QgsReadWriteContext &context ) // cppcheck-suppress duplInheritedMember { - std::unique_ptr< QgsCurvedLineCallout > callout = std::make_unique< QgsCurvedLineCallout >(); + auto callout = std::make_unique< QgsCurvedLineCallout >(); callout->readProperties( properties, context ); callout->setCurvature( properties.value( QStringLiteral( "curvature" ), 0.1 ).toDouble() ); @@ -1061,7 +1061,7 @@ QgsBalloonCallout::QgsBalloonCallout( const QgsBalloonCallout &other ) QgsCallout *QgsBalloonCallout::create( const QVariantMap &properties, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsBalloonCallout > callout = std::make_unique< QgsBalloonCallout >(); + auto callout = std::make_unique< QgsBalloonCallout >(); callout->readProperties( properties, context ); return callout.release(); } diff --git a/src/core/classification/qgsclassificationcustom.cpp b/src/core/classification/qgsclassificationcustom.cpp index b28a8fdc4468..a5c79b7b1145 100644 --- a/src/core/classification/qgsclassificationcustom.cpp +++ b/src/core/classification/qgsclassificationcustom.cpp @@ -27,7 +27,7 @@ QgsClassificationCustom::QgsClassificationCustom() std::unique_ptr QgsClassificationCustom::clone() const { - std::unique_ptr< QgsClassificationCustom > c = std::make_unique< QgsClassificationCustom >(); + auto c = std::make_unique< QgsClassificationCustom >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationequalinterval.cpp b/src/core/classification/qgsclassificationequalinterval.cpp index a452fea5e24e..d33263d8c5ed 100644 --- a/src/core/classification/qgsclassificationequalinterval.cpp +++ b/src/core/classification/qgsclassificationequalinterval.cpp @@ -93,7 +93,7 @@ QList QgsClassificationEqualInterval::calculateBreaks( double &minimum, std::unique_ptr< QgsClassificationMethod > QgsClassificationEqualInterval::clone() const { - std::unique_ptr< QgsClassificationEqualInterval > c = std::make_unique< QgsClassificationEqualInterval >(); + auto c = std::make_unique< QgsClassificationEqualInterval >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationfixedinterval.cpp b/src/core/classification/qgsclassificationfixedinterval.cpp index c71fe5f9fcd4..f036e1f75451 100644 --- a/src/core/classification/qgsclassificationfixedinterval.cpp +++ b/src/core/classification/qgsclassificationfixedinterval.cpp @@ -23,13 +23,13 @@ QgsClassificationFixedInterval::QgsClassificationFixedInterval() : QgsClassificationMethod( IgnoresClassCount, 0 ) { - std::unique_ptr< QgsProcessingParameterNumber > param = std::make_unique< QgsProcessingParameterNumber >( QStringLiteral( "INTERVAL" ), QObject::tr( "Interval size" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0.000000000001 ); + auto param = std::make_unique< QgsProcessingParameterNumber >( QStringLiteral( "INTERVAL" ), QObject::tr( "Interval size" ), Qgis::ProcessingNumberParameterType::Double, 1, false, 0.000000000001 ); addParameter( param.release() ); } std::unique_ptr QgsClassificationFixedInterval::clone() const { - std::unique_ptr c = std::make_unique< QgsClassificationFixedInterval >(); + auto c = std::make_unique< QgsClassificationFixedInterval >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationjenks.cpp b/src/core/classification/qgsclassificationjenks.cpp index 53a7816d66a7..3f199fe69981 100644 --- a/src/core/classification/qgsclassificationjenks.cpp +++ b/src/core/classification/qgsclassificationjenks.cpp @@ -37,7 +37,7 @@ QString QgsClassificationJenks::id() const std::unique_ptr QgsClassificationJenks::clone() const { - std::unique_ptr< QgsClassificationJenks > c = std::make_unique< QgsClassificationJenks >(); + auto c = std::make_unique< QgsClassificationJenks >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationlogarithmic.cpp b/src/core/classification/qgsclassificationlogarithmic.cpp index 11efce98a214..70ae72d3cf9f 100644 --- a/src/core/classification/qgsclassificationlogarithmic.cpp +++ b/src/core/classification/qgsclassificationlogarithmic.cpp @@ -31,7 +31,7 @@ QgsClassificationLogarithmic::QgsClassificationLogarithmic() std::unique_ptr QgsClassificationLogarithmic::clone() const { - std::unique_ptr c = std::make_unique< QgsClassificationLogarithmic >(); + auto c = std::make_unique< QgsClassificationLogarithmic >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationprettybreaks.cpp b/src/core/classification/qgsclassificationprettybreaks.cpp index 4a3657a898fe..7eda81f1a66c 100644 --- a/src/core/classification/qgsclassificationprettybreaks.cpp +++ b/src/core/classification/qgsclassificationprettybreaks.cpp @@ -50,7 +50,7 @@ QList QgsClassificationPrettyBreaks::calculateBreaks( double &minimum, d std::unique_ptr QgsClassificationPrettyBreaks::clone() const { - std::unique_ptr< QgsClassificationPrettyBreaks > c = std::make_unique< QgsClassificationPrettyBreaks >(); + auto c = std::make_unique< QgsClassificationPrettyBreaks >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationquantile.cpp b/src/core/classification/qgsclassificationquantile.cpp index 73a2d014d646..867213636392 100644 --- a/src/core/classification/qgsclassificationquantile.cpp +++ b/src/core/classification/qgsclassificationquantile.cpp @@ -34,7 +34,7 @@ QString QgsClassificationQuantile::id() const std::unique_ptr QgsClassificationQuantile::clone() const { - std::unique_ptr c = std::make_unique< QgsClassificationQuantile >(); + auto c = std::make_unique< QgsClassificationQuantile >(); copyBase( c.get() ); return c; } diff --git a/src/core/classification/qgsclassificationstandarddeviation.cpp b/src/core/classification/qgsclassificationstandarddeviation.cpp index 42db4eed3cd4..d4d85903db7f 100644 --- a/src/core/classification/qgsclassificationstandarddeviation.cpp +++ b/src/core/classification/qgsclassificationstandarddeviation.cpp @@ -40,7 +40,7 @@ QString QgsClassificationStandardDeviation::id() const std::unique_ptr< QgsClassificationMethod > QgsClassificationStandardDeviation::clone() const { - std::unique_ptr c = std::make_unique< QgsClassificationStandardDeviation >(); + auto c = std::make_unique< QgsClassificationStandardDeviation >(); copyBase( c.get() ); c->mStdDev = mStdDev; return c; diff --git a/src/core/effects/qgsimageoperation.cpp b/src/core/effects/qgsimageoperation.cpp index fae3537331b8..5b3d515e2eab 100644 --- a/src/core/effects/qgsimageoperation.cpp +++ b/src/core/effects/qgsimageoperation.cpp @@ -693,7 +693,7 @@ QImage *QgsImageOperation::gaussianBlur( QImage &image, const int radius, QgsFee return new QImage(); //blur along columns - std::unique_ptr< QImage > yBlurImage = std::make_unique< QImage >( width, height, QImage::Format_ARGB32_Premultiplied ); + auto yBlurImage = std::make_unique< QImage >( width, height, QImage::Format_ARGB32_Premultiplied ); GaussianBlurOperation colBlur( radius, QgsImageOperation::ByColumn, yBlurImage.get(), kernel.get(), feedback ); runRectOperation( xBlurImage, colBlur ); diff --git a/src/core/elevation/qgsprofilerenderer.cpp b/src/core/elevation/qgsprofilerenderer.cpp index 540999f47c27..241c63f4c01a 100644 --- a/src/core/elevation/qgsprofilerenderer.cpp +++ b/src/core/elevation/qgsprofilerenderer.cpp @@ -75,7 +75,7 @@ void QgsProfilePlotRenderer::startGeneration() mJobs.reserve( mGenerators.size() ); for ( const auto &it : mGenerators ) { - std::unique_ptr< ProfileJob > job = std::make_unique< ProfileJob >(); + auto job = std::make_unique< ProfileJob >(); job->generator = it.get(); job->context = mContext; mJobs.emplace_back( std::move( job ) ); @@ -99,7 +99,7 @@ void QgsProfilePlotRenderer::generateSynchronously() for ( const auto &it : mGenerators ) { - std::unique_ptr< ProfileJob > job = std::make_unique< ProfileJob >(); + auto job = std::make_unique< ProfileJob >(); job->generator = it.get(); job->context = mContext; it.get()->generateProfile( job->context ); diff --git a/src/core/expression/qgsexpressioncontextutils.cpp b/src/core/expression/qgsexpressioncontextutils.cpp index a8c162cd7365..abb4a375306a 100644 --- a/src/core/expression/qgsexpressioncontextutils.cpp +++ b/src/core/expression/qgsexpressioncontextutils.cpp @@ -1293,7 +1293,7 @@ class CurrentFaceIndexExpressionFunction: public QgsScopedExpressionFunction QgsExpressionContextScope *QgsExpressionContextUtils::meshExpressionScope( QgsMesh::ElementType elementType ) { - std::unique_ptr scope = std::make_unique(); + auto scope = std::make_unique(); switch ( elementType ) { diff --git a/src/core/expression/qgsexpressionfunction.cpp b/src/core/expression/qgsexpressionfunction.cpp index 9f276181e49c..de23f7abd7c2 100644 --- a/src/core/expression/qgsexpressionfunction.cpp +++ b/src/core/expression/qgsexpressionfunction.cpp @@ -3819,7 +3819,7 @@ static QVariant fcnMakePolygon( const QVariantList &values, const QgsExpressionC if ( outerRing.type() != Qgis::GeometryType::Line || outerRing.isNull() ) return QVariant(); - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); const QgsCurve *exteriorRing = qgsgeometry_cast< QgsCurve * >( outerRing.constGet() ); if ( !exteriorRing && outerRing.isMultipart() ) diff --git a/src/core/expression/qgsexpressionnodeimpl.cpp b/src/core/expression/qgsexpressionnodeimpl.cpp index 44428a39464e..ef2e8b8e3824 100644 --- a/src/core/expression/qgsexpressionnodeimpl.cpp +++ b/src/core/expression/qgsexpressionnodeimpl.cpp @@ -795,7 +795,7 @@ bool QgsExpressionNodeBinaryOperator::prepareNode( QgsExpression *parent, const auto orValuesIt = orValuesMap.find( fieldName ); if ( orValuesIt.value().count() == 1 ) { - std::unique_ptr eqNode = std::make_unique( boEQ, new QgsExpressionNodeColumnRef( fieldName ), orValuesIt.value().at( 0 )->clone() ); + auto eqNode = std::make_unique( boEQ, new QgsExpressionNodeColumnRef( fieldName ), orValuesIt.value().at( 0 )->clone() ); if ( currentNode ) { currentNode = std::make_unique( boOr, currentNode.release(), eqNode.release() ); @@ -807,7 +807,7 @@ bool QgsExpressionNodeBinaryOperator::prepareNode( QgsExpression *parent, const } else { - std::unique_ptr inNode = std::make_unique( new QgsExpressionNodeColumnRef( fieldName ), orValuesIt.value().clone() ); + auto inNode = std::make_unique( new QgsExpressionNodeColumnRef( fieldName ), orValuesIt.value().clone() ); if ( currentNode ) { currentNode = std::make_unique( boOr, currentNode.release(), inNode.release() ); diff --git a/src/core/externalstorage/qgshttpexternalstorage.cpp b/src/core/externalstorage/qgshttpexternalstorage.cpp index b13dfe4610da..f714f1332ec2 100644 --- a/src/core/externalstorage/qgshttpexternalstorage.cpp +++ b/src/core/externalstorage/qgshttpexternalstorage.cpp @@ -235,7 +235,7 @@ QString QgsAwsS3ExternalStorage::displayName() const QgsExternalStorageStoredContent *QgsAwsS3ExternalStorage::doStore( const QString &filePath, const QString &url, const QString &authcfg ) const { - std::unique_ptr storedContent = std::make_unique( filePath, url, authcfg ); + auto storedContent = std::make_unique( filePath, url, authcfg ); storedContent->setPrepareRequestHandler( []( QNetworkRequest & request, QFile * f ) { QCryptographicHash payloadCrypto( QCryptographicHash::Sha256 ); diff --git a/src/core/geometry/qgscircularstring.cpp b/src/core/geometry/qgscircularstring.cpp index 9027c0e9ac43..cf5bc8d1c16f 100644 --- a/src/core/geometry/qgscircularstring.cpp +++ b/src/core/geometry/qgscircularstring.cpp @@ -1804,7 +1804,7 @@ QgsCircularString *QgsCircularString::curveSubstring( double startDistance, doub << QgsPoint( pointType, prevX, prevY, prevZ, prevM ); } - std::unique_ptr< QgsCircularString > result = std::make_unique< QgsCircularString >(); + auto result = std::make_unique< QgsCircularString >(); result->setPoints( substringPoints ); return result.release(); } diff --git a/src/core/geometry/qgscompoundcurve.cpp b/src/core/geometry/qgscompoundcurve.cpp index 217e77c4be10..0d081179f567 100644 --- a/src/core/geometry/qgscompoundcurve.cpp +++ b/src/core/geometry/qgscompoundcurve.cpp @@ -802,20 +802,20 @@ bool QgsCompoundCurve::deleteVertex( QgsVertexId position ) if ( subVertexId.vertex < points.length() - 2 ) { - std::unique_ptr curveC = std::make_unique(); + auto curveC = std::make_unique(); curveC->setPoints( points.mid( subVertexId.vertex + 1 ) ); mCurves.insert( curveId, curveC.release() ); } const QgsPointSequence partB = QgsPointSequence() << points[subVertexId.vertex - 1] << points[subVertexId.vertex + 1]; - std::unique_ptr curveB = std::make_unique(); + auto curveB = std::make_unique(); curveB->setPoints( partB ); mCurves.insert( curveId, curveB.release() ); curve = mCurves.at( curveId ); if ( subVertexId.vertex > 1 ) { - std::unique_ptr curveA = std::make_unique(); + auto curveA = std::make_unique(); curveA->setPoints( points.mid( 0, subVertexId.vertex ) ); mCurves.insert( curveId, curveA.release() ); } @@ -1004,11 +1004,11 @@ bool QgsCompoundCurve::toggleCircularAtVertex( QgsVertexId position ) const QgsPointSequence partB = QgsPointSequence() << points[subVertexId.vertex - 1] << points[subVertexId.vertex] << points[subVertexId.vertex + 1]; const QgsPointSequence partC = points.mid( subVertexId.vertex + 1 ); - std::unique_ptr curveA = std::make_unique(); + auto curveA = std::make_unique(); curveA->setPoints( partA ); - std::unique_ptr curveB = std::make_unique(); + auto curveB = std::make_unique(); curveB->setPoints( partB ); - std::unique_ptr curveC = std::make_unique(); + auto curveC = std::make_unique(); curveC->setPoints( partC ); removeCurve( curveId ); @@ -1029,11 +1029,11 @@ bool QgsCompoundCurve::toggleCircularAtVertex( QgsVertexId position ) const QgsPointSequence partB = QgsPointSequence() << points[subVertexId.vertex - 1] << points[subVertexId.vertex] << points[subVertexId.vertex + 1]; const QgsPointSequence partC = points.mid( subVertexId.vertex + 1 ); - std::unique_ptr curveA = std::make_unique(); + auto curveA = std::make_unique(); curveA->setPoints( partA ); - std::unique_ptr curveB = std::make_unique(); + auto curveB = std::make_unique(); curveB->setPoints( partB ); - std::unique_ptr curveC = std::make_unique(); + auto curveC = std::make_unique(); curveC->setPoints( partC ); removeCurve( curveId ); @@ -1178,7 +1178,7 @@ std::tuple, std::unique_ptr > QgsCompoundCur int curveStart = 0; - std::unique_ptr< QgsCompoundCurve > curve1 = std::make_unique< QgsCompoundCurve >(); + auto curve1 = std::make_unique< QgsCompoundCurve >(); std::unique_ptr< QgsCompoundCurve > curve2; for ( const QgsCurve *curve : mCurves ) @@ -1323,7 +1323,7 @@ QgsCompoundCurve *QgsCompoundCurve::curveSubstring( double startDistance, double return createEmptyWithSameType(); endDistance = std::max( startDistance, endDistance ); - std::unique_ptr< QgsCompoundCurve > substring = std::make_unique< QgsCompoundCurve >(); + auto substring = std::make_unique< QgsCompoundCurve >(); double distanceTraversed = 0; for ( const QgsCurve *curve : mCurves ) diff --git a/src/core/geometry/qgscurvepolygon.cpp b/src/core/geometry/qgscurvepolygon.cpp index 9ddc13df46be..24e035cc503a 100644 --- a/src/core/geometry/qgscurvepolygon.cpp +++ b/src/core/geometry/qgscurvepolygon.cpp @@ -598,7 +598,7 @@ QgsCurvePolygon *QgsCurvePolygon::simplifyByDistance( double tolerance ) const if ( !qgsgeometry_cast< QgsLineString * >( exterior.get() ) ) return nullptr; - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >( qgis::down_cast< QgsLineString * >( exterior.release() ) ); + auto polygon = std::make_unique< QgsPolygon >( qgis::down_cast< QgsLineString * >( exterior.release() ) ); //interior rings for ( const QgsCurve *interior : mInteriorRings ) diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index c4ad60b38ea1..0486eae29d76 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -240,18 +240,18 @@ QgsGeometry QgsGeometry::fromRect( const QgsRectangle &rect ) if ( rect.isNull() ) return QgsGeometry(); - std::unique_ptr< QgsLineString > ext = std::make_unique< QgsLineString >( - QVector< double >() << rect.xMinimum() - << rect.xMaximum() - << rect.xMaximum() - << rect.xMinimum() - << rect.xMinimum(), - QVector< double >() << rect.yMinimum() - << rect.yMinimum() - << rect.yMaximum() - << rect.yMaximum() - << rect.yMinimum() ); - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto ext = std::make_unique< QgsLineString >( + QVector< double >() << rect.xMinimum() + << rect.xMaximum() + << rect.xMaximum() + << rect.xMinimum() + << rect.xMinimum(), + QVector< double >() << rect.yMinimum() + << rect.yMinimum() + << rect.yMaximum() + << rect.yMaximum() + << rect.yMinimum() ); + auto polygon = std::make_unique< QgsPolygon >(); polygon->setExteriorRing( ext.release() ); return QgsGeometry( std::move( polygon ) ); } @@ -263,120 +263,120 @@ QgsGeometry QgsGeometry::fromBox3D( const QgsBox3D &box ) return fromRect( box.toRectangle() ); } - std::unique_ptr< QgsPolyhedralSurface > polyhedralSurface = std::make_unique< QgsPolyhedralSurface >(); - - std::unique_ptr< QgsLineString > ext1 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMinimum() - << box.xMinimum() - << box.xMaximum() - << box.xMaximum() - << box.xMinimum(), - QVector< double >() << box.yMinimum() - << box.yMaximum() - << box.yMaximum() - << box.yMinimum() - << box.yMinimum(), - QVector< double >() << box.zMinimum() - << box.zMinimum() - << box.zMinimum() - << box.zMinimum() - << box.zMinimum() ); - std::unique_ptr< QgsPolygon > polygon1 = std::make_unique< QgsPolygon >( ext1.release() ); + auto polyhedralSurface = std::make_unique< QgsPolyhedralSurface >(); + + auto ext1 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMinimum() + << box.xMinimum() + << box.xMaximum() + << box.xMaximum() + << box.xMinimum(), + QVector< double >() << box.yMinimum() + << box.yMaximum() + << box.yMaximum() + << box.yMinimum() + << box.yMinimum(), + QVector< double >() << box.zMinimum() + << box.zMinimum() + << box.zMinimum() + << box.zMinimum() + << box.zMinimum() ); + auto polygon1 = std::make_unique< QgsPolygon >( ext1.release() ); polyhedralSurface->addPatch( polygon1.release() ); - std::unique_ptr< QgsLineString > ext2 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMinimum() - << box.xMinimum() - << box.xMinimum() - << box.xMinimum() - << box.xMinimum(), - QVector< double >() << box.yMinimum() - << box.yMaximum() - << box.yMaximum() - << box.yMinimum() - << box.yMinimum(), - QVector< double >() << box.zMinimum() - << box.zMinimum() - << box.zMaximum() - << box.zMaximum() - << box.zMinimum() ); - std::unique_ptr< QgsPolygon > polygon2 = std::make_unique< QgsPolygon >( ext2.release() ); + auto ext2 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMinimum() + << box.xMinimum() + << box.xMinimum() + << box.xMinimum() + << box.xMinimum(), + QVector< double >() << box.yMinimum() + << box.yMaximum() + << box.yMaximum() + << box.yMinimum() + << box.yMinimum(), + QVector< double >() << box.zMinimum() + << box.zMinimum() + << box.zMaximum() + << box.zMaximum() + << box.zMinimum() ); + auto polygon2 = std::make_unique< QgsPolygon >( ext2.release() ); polyhedralSurface->addPatch( polygon2.release() ); - std::unique_ptr< QgsLineString > ext3 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMinimum() - << box.xMaximum() - << box.xMaximum() - << box.xMinimum() - << box.xMinimum(), - QVector< double >() << box.yMinimum() - << box.yMinimum() - << box.yMinimum() - << box.yMinimum() - << box.yMinimum(), - QVector< double >() << box.zMinimum() - << box.zMinimum() - << box.zMaximum() - << box.zMaximum() - << box.zMinimum() ); - std::unique_ptr< QgsPolygon > polygon3 = std::make_unique< QgsPolygon >( ext3.release() ); + auto ext3 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMinimum() + << box.xMaximum() + << box.xMaximum() + << box.xMinimum() + << box.xMinimum(), + QVector< double >() << box.yMinimum() + << box.yMinimum() + << box.yMinimum() + << box.yMinimum() + << box.yMinimum(), + QVector< double >() << box.zMinimum() + << box.zMinimum() + << box.zMaximum() + << box.zMaximum() + << box.zMinimum() ); + auto polygon3 = std::make_unique< QgsPolygon >( ext3.release() ); polyhedralSurface->addPatch( polygon3.release() ); - std::unique_ptr< QgsLineString > ext4 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMaximum() - << box.xMaximum() - << box.xMinimum() - << box.xMinimum() - << box.xMaximum(), - QVector< double >() << box.yMaximum() - << box.yMinimum() - << box.yMinimum() - << box.yMaximum() - << box.yMaximum(), - QVector< double >() << box.zMaximum() - << box.zMaximum() - << box.zMaximum() - << box.zMaximum() - << box.zMaximum() ); - std::unique_ptr< QgsPolygon > polygon4 = std::make_unique< QgsPolygon >( ext4.release() ); + auto ext4 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMaximum() + << box.xMaximum() + << box.xMinimum() + << box.xMinimum() + << box.xMaximum(), + QVector< double >() << box.yMaximum() + << box.yMinimum() + << box.yMinimum() + << box.yMaximum() + << box.yMaximum(), + QVector< double >() << box.zMaximum() + << box.zMaximum() + << box.zMaximum() + << box.zMaximum() + << box.zMaximum() ); + auto polygon4 = std::make_unique< QgsPolygon >( ext4.release() ); polyhedralSurface->addPatch( polygon4.release() ); - std::unique_ptr< QgsLineString > ext5 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMaximum() - << box.xMaximum() - << box.xMaximum() - << box.xMaximum() - << box.xMaximum(), - QVector< double >() << box.yMaximum() - << box.yMinimum() - << box.yMinimum() - << box.yMaximum() - << box.yMaximum(), - QVector< double >() << box.zMaximum() - << box.zMaximum() - << box.zMinimum() - << box.zMinimum() - << box.zMaximum() ); - std::unique_ptr< QgsPolygon > polygon5 = std::make_unique< QgsPolygon >( ext5.release() ); + auto ext5 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMaximum() + << box.xMaximum() + << box.xMaximum() + << box.xMaximum() + << box.xMaximum(), + QVector< double >() << box.yMaximum() + << box.yMinimum() + << box.yMinimum() + << box.yMaximum() + << box.yMaximum(), + QVector< double >() << box.zMaximum() + << box.zMaximum() + << box.zMinimum() + << box.zMinimum() + << box.zMaximum() ); + auto polygon5 = std::make_unique< QgsPolygon >( ext5.release() ); polyhedralSurface->addPatch( polygon5.release() ); - std::unique_ptr< QgsLineString > ext6 = std::make_unique< QgsLineString >( - QVector< double >() << box.xMaximum() - << box.xMaximum() - << box.xMinimum() - << box.xMinimum() - << box.xMaximum(), - QVector< double >() << box.yMaximum() - << box.yMaximum() - << box.yMaximum() - << box.yMaximum() - << box.yMaximum(), - QVector< double >() << box.zMaximum() - << box.zMinimum() - << box.zMinimum() - << box.zMaximum() - << box.zMaximum() ); - std::unique_ptr< QgsPolygon > polygon6 = std::make_unique< QgsPolygon >( ext6.release() ); + auto ext6 = std::make_unique< QgsLineString >( + QVector< double >() << box.xMaximum() + << box.xMaximum() + << box.xMinimum() + << box.xMinimum() + << box.xMaximum(), + QVector< double >() << box.yMaximum() + << box.yMaximum() + << box.yMaximum() + << box.yMaximum() + << box.yMaximum(), + QVector< double >() << box.zMaximum() + << box.zMinimum() + << box.zMinimum() + << box.zMaximum() + << box.zMaximum() ); + auto polygon6 = std::make_unique< QgsPolygon >( ext6.release() ); polyhedralSurface->addPatch( polygon6.release() ); return QgsGeometry( std::move( polyhedralSurface ) ); @@ -421,7 +421,7 @@ QgsGeometry QgsGeometry::createWedgeBuffer( const QgsPoint ¢er, const double QgsGeometry QgsGeometry::createWedgeBufferFromAngles( const QgsPoint ¢er, double startAngle, double endAngle, double outerRadius, double innerRadius ) { - std::unique_ptr< QgsCompoundCurve > wedge = std::make_unique< QgsCompoundCurve >(); + auto wedge = std::make_unique< QgsCompoundCurve >(); const double DEG_TO_RAD = M_PI / 180.0; const double RAD_TO_DEG = 180.0 / M_PI; @@ -431,17 +431,17 @@ QgsGeometry QgsGeometry::createWedgeBufferFromAngles( const QgsPoint ¢er, do if ( std::abs( angularWidth ) >= 360.0 ) { - std::unique_ptr< QgsCompoundCurve > outerCc = std::make_unique< QgsCompoundCurve >(); + auto outerCc = std::make_unique< QgsCompoundCurve >(); QgsCircle outerCircle = QgsCircle( center, outerRadius ); outerCc->addCurve( outerCircle.toCircularString() ); - std::unique_ptr< QgsCurvePolygon > cp = std::make_unique< QgsCurvePolygon >(); + auto cp = std::make_unique< QgsCurvePolygon >(); cp->setExteriorRing( outerCc.release() ); if ( !qgsDoubleNear( innerRadius, 0.0 ) && innerRadius > 0 ) { - std::unique_ptr< QgsCompoundCurve > innerCc = std::make_unique< QgsCompoundCurve >(); + auto innerCc = std::make_unique< QgsCompoundCurve >(); QgsCircle innerCircle = QgsCircle( center, innerRadius ); innerCc->addCurve( innerCircle.toCircularString() ); @@ -471,7 +471,7 @@ QgsGeometry QgsGeometry::createWedgeBufferFromAngles( const QgsPoint ¢er, do wedge->addCurve( new QgsLineString( center, outerP1 ) ); } - std::unique_ptr< QgsCurvePolygon > cp = std::make_unique< QgsCurvePolygon >(); + auto cp = std::make_unique< QgsCurvePolygon >(); cp->setExteriorRing( wedge.release() ); return QgsGeometry( std::move( cp ) ); } @@ -724,7 +724,7 @@ bool QgsGeometry::toggleCircularAtVertex( int atVertex ) { // TODO : move this block before the above, so we call toggleCircularAtVertex only in one place // If the geom is a linestring or cirularstring, we create a compound curve - std::unique_ptr cpdCurve = std::make_unique(); + auto cpdCurve = std::make_unique(); cpdCurve->addCurve( curve->clone() ); success = cpdCurve->toggleCircularAtVertex( QgsVertexId( -1, -1, id.vertex ) ); @@ -938,7 +938,7 @@ double QgsGeometry::closestSegmentWithContext( const QgsPointXY &point, Qgis::GeometryOperationResult QgsGeometry::addRing( const QVector &ring ) { - std::unique_ptr< QgsLineString > ringLine = std::make_unique< QgsLineString >( ring ); + auto ringLine = std::make_unique< QgsLineString >( ring ); return addRing( ringLine.release() ); } @@ -980,7 +980,7 @@ Qgis::GeometryOperationResult QgsGeometry::addPart( const QgsPointSequence &poin } else if ( points.size() > 1 ) { - std::unique_ptr< QgsLineString > ringLine = std::make_unique< QgsLineString >(); + auto ringLine = std::make_unique< QgsLineString >(); ringLine->setPoints( points ); partGeom = std::move( ringLine ); } @@ -998,7 +998,7 @@ Qgis::GeometryOperationResult QgsGeometry::addPartV2( const QgsPointSequence &po } else if ( points.size() > 1 ) { - std::unique_ptr< QgsLineString > ringLine = std::make_unique< QgsLineString >(); + auto ringLine = std::make_unique< QgsLineString >(); ringLine->setPoints( points ); partGeom = std::move( ringLine ); } @@ -1740,14 +1740,14 @@ QVector QgsGeometry::coerceToType( const Qgis::WkbType type, double { if ( QgsWkbTypes::isCurvedType( type ) ) { - std::unique_ptr< QgsCurvePolygon > cp = std::make_unique< QgsCurvePolygon >(); + auto cp = std::make_unique< QgsCurvePolygon >(); cp->setExteriorRing( curve ); ( void )exterior.release(); gc->addGeometry( cp.release() ); } else { - std::unique_ptr< QgsPolygon > p = std::make_unique< QgsPolygon >(); + auto p = std::make_unique< QgsPolygon >(); p->setExteriorRing( qgsgeometry_cast< QgsLineString * >( curve ) ); ( void )exterior.release(); gc->addGeometry( p.release() ); @@ -1763,7 +1763,7 @@ QVector QgsGeometry::coerceToType( const Qgis::WkbType type, double newGeom.type() == Qgis::GeometryType::Polygon ) ) { // lines/polygons to a point layer, extract all vertices - std::unique_ptr< QgsMultiPoint > mp = std::make_unique< QgsMultiPoint >(); + auto mp = std::make_unique< QgsMultiPoint >(); const QgsGeometry source = newGeom; QSet< QgsPoint > added; for ( auto vertex = source.vertices_begin(); vertex != source.vertices_end(); ++vertex ) @@ -1780,7 +1780,7 @@ QVector QgsGeometry::coerceToType( const Qgis::WkbType type, double if ( QgsWkbTypes::flatType( type ) == Qgis::WkbType::PolyhedralSurface && QgsWkbTypes::flatType( QgsWkbTypes::singleType( newGeom.wkbType() ) ) == Qgis::WkbType::Polygon ) { - std::unique_ptr< QgsPolyhedralSurface > polySurface = std::make_unique< QgsPolyhedralSurface >(); + auto polySurface = std::make_unique< QgsPolyhedralSurface >(); const QgsGeometry source = newGeom; for ( auto part = source.const_parts_begin(); part != source.const_parts_end(); ++part ) { @@ -1796,7 +1796,7 @@ QVector QgsGeometry::coerceToType( const Qgis::WkbType type, double if ( QgsWkbTypes::flatType( type ) == Qgis::WkbType::Triangle && QgsWkbTypes::flatType( newGeom.wkbType() ) == Qgis::WkbType::Polygon ) { - std::unique_ptr< QgsTriangle > triangle = std::make_unique< QgsTriangle >(); + auto triangle = std::make_unique< QgsTriangle >(); const QgsGeometry source = newGeom; if ( QgsPolygon *polygon = qgsgeometry_cast< QgsPolygon * >( newGeom.constGet() ) ) { @@ -3910,7 +3910,7 @@ QgsGeometry QgsGeometry::fromQPolygonF( const QPolygonF &polygon ) if ( polygon.isClosed() ) { - std::unique_ptr< QgsPolygon > poly = std::make_unique< QgsPolygon >(); + auto poly = std::make_unique< QgsPolygon >(); poly->setExteriorRing( ring.release() ); return QgsGeometry( std::move( poly ) ); } @@ -4006,7 +4006,7 @@ QgsGeometry QgsGeometry::smooth( const unsigned int iterations, const double off { const QgsMultiLineString *multiLine = qgsgeometry_cast< const QgsMultiLineString * >( geom.constGet() ); - std::unique_ptr< QgsMultiLineString > resultMultiline = std::make_unique< QgsMultiLineString> (); + auto resultMultiline = std::make_unique< QgsMultiLineString> (); resultMultiline->reserve( multiLine->numGeometries() ); for ( int i = 0; i < multiLine->numGeometries(); ++i ) { @@ -4025,7 +4025,7 @@ QgsGeometry QgsGeometry::smooth( const unsigned int iterations, const double off { const QgsMultiPolygon *multiPoly = qgsgeometry_cast< const QgsMultiPolygon * >( geom.constGet() ); - std::unique_ptr< QgsMultiPolygon > resultMultiPoly = std::make_unique< QgsMultiPolygon >(); + auto resultMultiPoly = std::make_unique< QgsMultiPolygon >(); resultMultiPoly->reserve( multiPoly->numGeometries() ); for ( int i = 0; i < multiPoly->numGeometries(); ++i ) { @@ -4044,7 +4044,7 @@ std::unique_ptr< QgsLineString > smoothCurve( const QgsLineString &line, const u const double offset, double squareDistThreshold, double maxAngleRads, bool isRing ) { - std::unique_ptr< QgsLineString > result = std::make_unique< QgsLineString >( line ); + auto result = std::make_unique< QgsLineString >( line ); QgsPointSequence outputLine; for ( unsigned int iteration = 0; iteration < iterations; ++iteration ) { @@ -4137,7 +4137,7 @@ std::unique_ptr QgsGeometry::smoothPolygon( const QgsPolygon &polygo { double maxAngleRads = maxAngle * M_PI / 180.0; double squareDistThreshold = minimumDistance > 0 ? minimumDistance * minimumDistance : -1; - std::unique_ptr< QgsPolygon > resultPoly = std::make_unique< QgsPolygon >(); + auto resultPoly = std::make_unique< QgsPolygon >(); resultPoly->setExteriorRing( smoothCurve( *( static_cast< const QgsLineString *>( polygon.exteriorRing() ) ), iterations, offset, squareDistThreshold, maxAngleRads, true ).release() ); diff --git a/src/core/geometry/qgsgeometrycollection.cpp b/src/core/geometry/qgsgeometrycollection.cpp index 40ab10de3c39..a0728c6da8db 100644 --- a/src/core/geometry/qgsgeometrycollection.cpp +++ b/src/core/geometry/qgsgeometrycollection.cpp @@ -1076,7 +1076,7 @@ const QgsAbstractGeometry *QgsGeometryCollection::simplifiedTypeRef() const QgsGeometryCollection *QgsGeometryCollection::simplifyByDistance( double tolerance ) const { - std::unique_ptr< QgsGeometryCollection > res = std::make_unique< QgsGeometryCollection >(); + auto res = std::make_unique< QgsGeometryCollection >(); res->reserve( mGeometries.size() ); for ( int i = 0; i < mGeometries.size(); ++i ) { diff --git a/src/core/geometry/qgsgeometryfactory.cpp b/src/core/geometry/qgsgeometryfactory.cpp index 27d362656351..f730239e3772 100644 --- a/src/core/geometry/qgsgeometryfactory.cpp +++ b/src/core/geometry/qgsgeometryfactory.cpp @@ -153,7 +153,7 @@ std::unique_ptr< QgsAbstractGeometry > QgsGeometryFactory::fromPointXY( const Qg std::unique_ptr QgsGeometryFactory::fromMultiPointXY( const QgsMultiPointXY &multipoint ) { - std::unique_ptr< QgsMultiPoint > mp = std::make_unique< QgsMultiPoint >(); + auto mp = std::make_unique< QgsMultiPoint >(); QgsMultiPointXY::const_iterator ptIt = multipoint.constBegin(); mp->reserve( multipoint.size() ); for ( ; ptIt != multipoint.constEnd(); ++ptIt ) @@ -171,7 +171,7 @@ std::unique_ptr QgsGeometryFactory::fromPolylineXY( const Q std::unique_ptr QgsGeometryFactory::fromMultiPolylineXY( const QgsMultiPolylineXY &multiline ) { - std::unique_ptr< QgsMultiLineString > mLine = std::make_unique< QgsMultiLineString >(); + auto mLine = std::make_unique< QgsMultiLineString >(); mLine->reserve( multiline.size() ); for ( int i = 0; i < multiline.size(); ++i ) { @@ -182,7 +182,7 @@ std::unique_ptr QgsGeometryFactory::fromMultiPolylineXY( con std::unique_ptr QgsGeometryFactory::fromPolygonXY( const QgsPolygonXY &polygon ) { - std::unique_ptr< QgsPolygon > poly = std::make_unique< QgsPolygon >(); + auto poly = std::make_unique< QgsPolygon >(); QVector holes; holes.reserve( polygon.size() ); @@ -206,7 +206,7 @@ std::unique_ptr QgsGeometryFactory::fromPolygonXY( const QgsPolygonX std::unique_ptr< QgsMultiPolygon > QgsGeometryFactory::fromMultiPolygonXY( const QgsMultiPolygonXY &multipoly ) { - std::unique_ptr< QgsMultiPolygon > mp = std::make_unique< QgsMultiPolygon >(); + auto mp = std::make_unique< QgsMultiPolygon >(); mp->reserve( multipoly.size() ); for ( int i = 0; i < multipoly.size(); ++i ) { @@ -231,7 +231,7 @@ std::unique_ptr QgsGeometryFactory::linestringFromPolyline( const *destY++ = src->y(); src++; } - std::unique_ptr< QgsLineString > line = std::make_unique< QgsLineString >( x, y ); + auto line = std::make_unique< QgsLineString >( x, y ); return line; } diff --git a/src/core/geometry/qgsgeos.cpp b/src/core/geometry/qgsgeos.cpp index 7bd2edcda5d3..214c5c6734d5 100644 --- a/src/core/geometry/qgsgeos.cpp +++ b/src/core/geometry/qgsgeos.cpp @@ -3144,7 +3144,7 @@ std::unique_ptr< QgsAbstractGeometry > QgsGeos::shortestLine( const QgsAbstractG return nullptr; } - std::unique_ptr< QgsLineString > line = std::make_unique< QgsLineString >(); + auto line = std::make_unique< QgsLineString >(); line->addVertex( QgsPoint( nx1, ny1 ) ); line->addVertex( QgsPoint( nx2, ny2 ) ); return line; diff --git a/src/core/geometry/qgsinternalgeometryengine.cpp b/src/core/geometry/qgsinternalgeometryengine.cpp index 23a1724718e1..599554decd22 100644 --- a/src/core/geometry/qgsinternalgeometryengine.cpp +++ b/src/core/geometry/qgsinternalgeometryengine.cpp @@ -1154,7 +1154,7 @@ QgsGeometry QgsInternalGeometryEngine::variableWidthBuffer( int segments, const // close ring points.append( points.at( 0 ) ); - std::unique_ptr< QgsPolygon > poly = std::make_unique< QgsPolygon >(); + auto poly = std::make_unique< QgsPolygon >(); poly->setExteriorRing( new QgsLineString( points ) ); if ( poly->area() > 0 ) parts << QgsGeometry( std::move( poly ) ); @@ -1518,7 +1518,7 @@ std::unique_ptr< QgsCurve > lineToCurve( const QgsCurve *curve, double distanceT } else if ( flatType == Qgis::WkbType::CompoundCurve ) { - std::unique_ptr< QgsCompoundCurve > out = std::make_unique< QgsCompoundCurve >(); + auto out = std::make_unique< QgsCompoundCurve >(); const QgsCompoundCurve *in = qgsgeometry_cast< const QgsCompoundCurve * >( curve ); for ( int i = 0; i < in->nCurves(); i ++ ) { @@ -1544,7 +1544,7 @@ std::unique_ptr< QgsCurve > lineToCurve( const QgsCurve *curve, double distanceT { const QgsLineString *lineString = qgsgeometry_cast< QgsLineString * >( curve ); - std::unique_ptr< QgsCompoundCurve > out = std::make_unique< QgsCompoundCurve >(); + auto out = std::make_unique< QgsCompoundCurve >(); /* Minimum number of edges, per quadrant, required to define an arc */ const unsigned int minQuadEdges = 2; @@ -1702,7 +1702,7 @@ std::unique_ptr< QgsCurve > lineToCurve( const QgsCurve *curve, double distanceT points.append( lineString->pointN( start ) ); points.append( lineString->pointN( ( start + end + 1 ) / 2 ) ); points.append( lineString->pointN( end + 1 ) ); - std::unique_ptr< QgsCircularString > curvedSegment = std::make_unique< QgsCircularString >(); + auto curvedSegment = std::make_unique< QgsCircularString >(); curvedSegment->setPoints( points ); out->addCurve( curvedSegment.release() ); } @@ -1747,7 +1747,7 @@ std::unique_ptr< QgsAbstractGeometry > convertGeometryToCurves( const QgsAbstrac { // polygon const QgsCurvePolygon *polygon = qgsgeometry_cast< const QgsCurvePolygon * >( geom ); - std::unique_ptr< QgsCurvePolygon > result = std::make_unique< QgsCurvePolygon>(); + auto result = std::make_unique< QgsCurvePolygon>(); result->setExteriorRing( lineToCurve( polygon->exteriorRing(), distanceTolerance, angleTolerance ).release() ); @@ -2017,7 +2017,7 @@ std::unique_ptr< QgsAbstractGeometry > triangularWavesPrivate( const QgsAbstract { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( triangularWavesAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), wavelength, amplitude, strictWavelength ).release() ); @@ -2048,7 +2048,7 @@ std::unique_ptr< QgsAbstractGeometry > triangularWavesRandomizedPrivate( const Q { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( triangularWavesRandomizedAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), minimumWavelength, maximumWavelength, minimumAmplitude, maximumAmplitude, uniformDist, mt ).release() ); @@ -2313,7 +2313,7 @@ std::unique_ptr< QgsAbstractGeometry > squareWavesPrivate( const QgsAbstractGeom { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( squareWavesAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), wavelength, amplitude, strictWavelength ).release() ); @@ -2344,7 +2344,7 @@ std::unique_ptr< QgsAbstractGeometry > squareWavesRandomizedPrivate( const QgsAb { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( squareWavesRandomizedAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), minimumWavelength, maximumWavelength, minimumAmplitude, maximumAmplitude, uniformDist, mt ).release() ); @@ -2468,7 +2468,7 @@ std::unique_ptr< QgsLineString > roundWavesAlongLine( const QgsLineString *line, double distanceToNextPointFromStartOfSegment = wavelength / 8; int bufferIndex = 1; - std::unique_ptr< QgsLineString > out = std::make_unique< QgsLineString >(); + auto out = std::make_unique< QgsLineString >(); double segmentAngleRadians = 0; double remainingDistance = totalLength; @@ -2596,7 +2596,7 @@ std::unique_ptr< QgsLineString > roundWavesRandomizedAlongLine( const QgsLineStr double distanceToNextPointFromStartOfSegment = wavelength / 8; int bufferIndex = 1; - std::unique_ptr< QgsLineString > out = std::make_unique< QgsLineString >(); + auto out = std::make_unique< QgsLineString >(); double segmentAngleRadians = 0; @@ -2729,7 +2729,7 @@ std::unique_ptr< QgsAbstractGeometry > roundWavesPrivate( const QgsAbstractGeome { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( roundWavesAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), wavelength, amplitude, strictWavelength ).release() ); @@ -2760,7 +2760,7 @@ std::unique_ptr< QgsAbstractGeometry > roundWavesRandomizedPrivate( const QgsAbs { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsPolygon > result = std::make_unique< QgsPolygon >(); + auto result = std::make_unique< QgsPolygon >(); result->setExteriorRing( roundWavesRandomizedAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), minimumWavelength, maximumWavelength, minimumAmplitude, maximumAmplitude, uniformDist, mt ).release() ); @@ -2875,7 +2875,7 @@ std::unique_ptr< QgsMultiLineString > dashPatternAlongLine( const QgsLineString double prevX = *x++; double prevY = *y++; - std::unique_ptr< QgsMultiLineString > result = std::make_unique< QgsMultiLineString >(); + auto result = std::make_unique< QgsMultiLineString >(); QVector< double > outX; QVector< double > outY; @@ -3112,7 +3112,7 @@ std::unique_ptr< QgsAbstractGeometry > applyDashPatternPrivate( const QgsAbstrac { // polygon const QgsPolygon *polygon = static_cast< const QgsPolygon * >( geom ); - std::unique_ptr< QgsMultiLineString > result = std::make_unique< QgsMultiLineString >(); + auto result = std::make_unique< QgsMultiLineString >(); std::unique_ptr< QgsMultiLineString > exteriorParts = dashPatternAlongLine( static_cast< const QgsLineString * >( polygon->exteriorRing() ), pattern, startRule, endRule, adjustment, patternOffset ); for ( int i = 0; i < exteriorParts->numGeometries(); ++i ) diff --git a/src/core/geometry/qgsmulticurve.cpp b/src/core/geometry/qgsmulticurve.cpp index e69886fdb7f9..8bc46eeca262 100644 --- a/src/core/geometry/qgsmulticurve.cpp +++ b/src/core/geometry/qgsmulticurve.cpp @@ -211,7 +211,7 @@ bool QgsMultiCurve::insertGeometry( QgsAbstractGeometry *g, int index ) QgsMultiCurve *QgsMultiCurve::simplifyByDistance( double tolerance ) const { - std::unique_ptr< QgsMultiCurve > res = std::make_unique< QgsMultiCurve >(); + auto res = std::make_unique< QgsMultiCurve >(); res->reserve( mGeometries.size() ); for ( int i = 0; i < mGeometries.size(); ++i ) { diff --git a/src/core/geometry/qgsmultilinestring.cpp b/src/core/geometry/qgsmultilinestring.cpp index 847476922fa1..4cad6ef7adc6 100644 --- a/src/core/geometry/qgsmultilinestring.cpp +++ b/src/core/geometry/qgsmultilinestring.cpp @@ -226,7 +226,7 @@ bool QgsMultiLineString::insertGeometry( QgsAbstractGeometry *g, int index ) QgsMultiLineString *QgsMultiLineString::simplifyByDistance( double tolerance ) const { - std::unique_ptr< QgsMultiLineString > result = std::make_unique< QgsMultiLineString >(); + auto result = std::make_unique< QgsMultiLineString >(); result->reserve( mGeometries.size() ); for ( int i = 0; i < mGeometries.size(); ++i ) { @@ -253,7 +253,7 @@ bool QgsMultiLineString::wktOmitChildType() const QgsMultiLineString *QgsMultiLineString::measuredLine( double start, double end ) const { - std::unique_ptr< QgsMultiLineString > result = std::make_unique< QgsMultiLineString >(); + auto result = std::make_unique< QgsMultiLineString >(); if ( isEmpty() ) { result->convertTo( QgsWkbTypes::addM( mWkbType ) ); diff --git a/src/core/geometry/qgsmultipoint.h b/src/core/geometry/qgsmultipoint.h index c3c7461e27ae..39e6da4610f1 100644 --- a/src/core/geometry/qgsmultipoint.h +++ b/src/core/geometry/qgsmultipoint.h @@ -160,7 +160,7 @@ class CORE_EXPORT QgsMultiPoint: public QgsGeometryCollection break; } - std::unique_ptr< QgsPoint > point = std::make_unique< QgsPoint >( x, y ); + auto point = std::make_unique< QgsPoint >( x, y ); if ( elementSize > 2 ) { element = PySequence_GetItem( value, 2 ); diff --git a/src/core/geometry/qgsmultipolygon.cpp b/src/core/geometry/qgsmultipolygon.cpp index bfe1138fec9c..70fe2fea0a54 100644 --- a/src/core/geometry/qgsmultipolygon.cpp +++ b/src/core/geometry/qgsmultipolygon.cpp @@ -238,7 +238,7 @@ bool QgsMultiPolygon::insertGeometry( QgsAbstractGeometry *g, int index ) QgsMultiPolygon *QgsMultiPolygon::simplifyByDistance( double tolerance ) const { - std::unique_ptr< QgsMultiPolygon > res = std::make_unique< QgsMultiPolygon >(); + auto res = std::make_unique< QgsMultiPolygon >(); res->reserve( mGeometries.size() ); for ( int i = 0; i < mGeometries.size(); ++i ) { diff --git a/src/core/geometry/qgsmultisurface.cpp b/src/core/geometry/qgsmultisurface.cpp index 2a20b6424dbf..31b0be2ddf8e 100644 --- a/src/core/geometry/qgsmultisurface.cpp +++ b/src/core/geometry/qgsmultisurface.cpp @@ -239,7 +239,7 @@ QgsAbstractGeometry *QgsMultiSurface::boundary() const QgsMultiSurface *QgsMultiSurface::simplifyByDistance( double tolerance ) const { - std::unique_ptr< QgsMultiSurface > res = std::make_unique< QgsMultiSurface >(); + auto res = std::make_unique< QgsMultiSurface >(); res->reserve( mGeometries.size() ); for ( int i = 0; i < mGeometries.size(); ++i ) { diff --git a/src/core/geometry/qgspolyhedralsurface.cpp b/src/core/geometry/qgspolyhedralsurface.cpp index ce418562e4a0..005c78dec5c3 100644 --- a/src/core/geometry/qgspolyhedralsurface.cpp +++ b/src/core/geometry/qgspolyhedralsurface.cpp @@ -413,7 +413,7 @@ QgsPolyhedralSurface *QgsPolyhedralSurface::snappedToGrid( double hSpacing, doub return nullptr; } - std::unique_ptr gridifiedPatch = std::make_unique(); + auto gridifiedPatch = std::make_unique(); gridifiedPatch->setExteriorRing( exteriorRing.release() ); //interior rings @@ -439,7 +439,7 @@ QgsPolyhedralSurface *QgsPolyhedralSurface::simplifyByDistance( double tolerance if ( isEmpty() ) return nullptr; - std::unique_ptr< QgsPolyhedralSurface > simplifiedGeom = std::make_unique< QgsPolyhedralSurface >(); + auto simplifiedGeom = std::make_unique< QgsPolyhedralSurface >(); for ( QgsPolygon *polygon : mPatches ) { std::unique_ptr polygonSimplified( polygon->simplifyByDistance( tolerance ) ); @@ -896,7 +896,7 @@ void QgsPolyhedralSurface::swapXy() QgsMultiSurface *QgsPolyhedralSurface::toCurveType() const { - std::unique_ptr multiSurface = std::make_unique< QgsMultiSurface >(); + auto multiSurface = std::make_unique< QgsMultiSurface >(); multiSurface->reserve( mPatches.size() ); for ( const QgsPolygon *polygon : std::as_const( mPatches ) ) { @@ -928,7 +928,7 @@ bool QgsPolyhedralSurface::transform( QgsAbstractGeometryTransformer *transforme QgsMultiPolygon *QgsPolyhedralSurface::toMultiPolygon() const { - std::unique_ptr multiPolygon = std::make_unique< QgsMultiPolygon >(); + auto multiPolygon = std::make_unique< QgsMultiPolygon >(); multiPolygon->reserve( mPatches.size() ); for ( const QgsPolygon *polygon : std::as_const( mPatches ) ) { diff --git a/src/core/geometry/qgsquadrilateral.cpp b/src/core/geometry/qgsquadrilateral.cpp index b00440ccd31a..47f3810ee312 100644 --- a/src/core/geometry/qgsquadrilateral.cpp +++ b/src/core/geometry/qgsquadrilateral.cpp @@ -385,7 +385,7 @@ QgsPointSequence QgsQuadrilateral::points() const QgsPolygon *QgsQuadrilateral::toPolygon( bool force2D ) const { - std::unique_ptr polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); if ( !isValid() ) { return polygon.release(); @@ -398,7 +398,7 @@ QgsPolygon *QgsQuadrilateral::toPolygon( bool force2D ) const QgsLineString *QgsQuadrilateral::toLineString( bool force2D ) const { - std::unique_ptr ext = std::make_unique< QgsLineString>(); + auto ext = std::make_unique< QgsLineString>(); if ( !isValid() ) { return ext.release(); diff --git a/src/core/geometry/qgstriangulatedsurface.cpp b/src/core/geometry/qgstriangulatedsurface.cpp index 38f2a8a8e024..3eb7b1871df4 100644 --- a/src/core/geometry/qgstriangulatedsurface.cpp +++ b/src/core/geometry/qgstriangulatedsurface.cpp @@ -227,7 +227,7 @@ QgsTriangulatedSurface *QgsTriangulatedSurface::snappedToGrid( double hSpacing, return nullptr; } - std::unique_ptr gridifiedTriangle = std::make_unique(); + auto gridifiedTriangle = std::make_unique(); gridifiedTriangle->setExteriorRing( exteriorRing.release() ); surface->addPatch( gridifiedTriangle.release() ); } diff --git a/src/core/gps/qgsgpsdetector.cpp b/src/core/gps/qgsgpsdetector.cpp index 829ca3ed9221..561b1f7304c7 100644 --- a/src/core/gps/qgsgpsdetector.cpp +++ b/src/core/gps/qgsgpsdetector.cpp @@ -175,7 +175,7 @@ void QgsGpsDetector::advance() else { #if defined( HAVE_QTSERIALPORT ) - std::unique_ptr< QSerialPort > serial = std::make_unique< QSerialPort >( mPortList.at( mPortIndex ).first ); + auto serial = std::make_unique< QSerialPort >( mPortList.at( mPortIndex ).first ); serial->setBaudRate( mBaudList[ mBaudIndex ] ); diff --git a/src/core/labeling/qgslabelingengine.cpp b/src/core/labeling/qgslabelingengine.cpp index 714462d56198..c4dd1c6d348c 100644 --- a/src/core/labeling/qgslabelingengine.cpp +++ b/src/core/labeling/qgslabelingengine.cpp @@ -488,7 +488,7 @@ void QgsLabelingEngine::drawLabels( QgsRenderContext &context, const QString &la } QgsExpressionContextScope *symbolScope = new QgsExpressionContextScope(); - std::unique_ptr< QgsExpressionContextScopePopper > symbolScopePopper = std::make_unique< QgsExpressionContextScopePopper >( context.expressionContext(), symbolScope ); + auto symbolScopePopper = std::make_unique< QgsExpressionContextScopePopper >( context.expressionContext(), symbolScope ); // draw label backgrounds for ( pal::LabelPosition *label : std::as_const( mLabels ) ) diff --git a/src/core/labeling/qgslabelsearchtree.cpp b/src/core/labeling/qgslabelsearchtree.cpp index 10015c0635ff..530f56fdafb4 100644 --- a/src/core/labeling/qgslabelsearchtree.cpp +++ b/src/core/labeling/qgslabelsearchtree.cpp @@ -106,8 +106,8 @@ bool QgsLabelSearchTree::insertLabel( pal::LabelPosition *labelPos, QgsFeatureId const QgsRectangle bounds( xMin, yMin, xMax, yMax ); const QgsGeometry labelGeometry( QgsGeometry::fromPolygonXY( QVector() << cornerPoints ) ); - std::unique_ptr< QgsLabelPosition > newEntry = std::make_unique< QgsLabelPosition >( featureId, -labelPos->getAlpha() * 180 / M_PI + mMapSettings.rotation(), cornerPoints, bounds, - labelPos->getWidth(), labelPos->getHeight(), layerName, labeltext, labelfont, labelPos->getUpsideDown(), diagram, pinned, providerId, labelGeometry, isUnplaced ); + auto newEntry = std::make_unique< QgsLabelPosition >( featureId, -labelPos->getAlpha() * 180 / M_PI + mMapSettings.rotation(), cornerPoints, bounds, + labelPos->getWidth(), labelPos->getHeight(), layerName, labeltext, labelfont, labelPos->getUpsideDown(), diagram, pinned, providerId, labelGeometry, isUnplaced ); newEntry->groupedLabelId = uniqueLinkedId; mSpatialIndex.insert( newEntry.get(), bounds ); @@ -130,7 +130,7 @@ bool QgsLabelSearchTree::insertCallout( const QgsCalloutPosition &position ) const QPointF origin = position.origin(); const QPointF destination = position.destination(); - std::unique_ptr< QgsCalloutPosition > newEntry = std::make_unique< QgsCalloutPosition >( position ); + auto newEntry = std::make_unique< QgsCalloutPosition >( position ); mCalloutIndex.insert( newEntry.get(), QgsRectangle( origin.x(), origin.y(), origin.x(), origin.y() ) ); mCalloutIndex.insert( newEntry.get(), QgsRectangle( destination.x(), destination.y(), destination.x(), destination.y() ) ); diff --git a/src/core/labeling/qgspallabeling.cpp b/src/core/labeling/qgspallabeling.cpp index 59f48927bfbf..6487d0236293 100644 --- a/src/core/labeling/qgspallabeling.cpp +++ b/src/core/labeling/qgspallabeling.cpp @@ -2926,7 +2926,7 @@ std::unique_ptr QgsPalLayerSettings::registerFeatureWithDetails } // feature to the layer - std::unique_ptr< QgsTextLabelFeature > labelFeature = std::make_unique< QgsTextLabelFeature>( feature.id(), std::move( geos_geom_clone ), labelSize ); + auto labelFeature = std::make_unique< QgsTextLabelFeature>( feature.id(), std::move( geos_geom_clone ), labelSize ); labelFeature->setAnchorPosition( anchorPosition ); labelFeature->setFeature( feature ); labelFeature->setSymbol( symbol ); @@ -3211,7 +3211,7 @@ std::unique_ptr QgsPalLayerSettings::registerObstacleFeature( c return nullptr; // invalid geometry // feature to the layer - std::unique_ptr< QgsLabelFeature > obstacleFeature = std::make_unique< QgsLabelFeature >( f.id(), std::move( geos_geom_clone ), QSizeF( 0, 0 ) ); + auto obstacleFeature = std::make_unique< QgsLabelFeature >( f.id(), std::move( geos_geom_clone ), QSizeF( 0, 0 ) ); obstacleFeature->setFeature( f ); QgsLabelObstacleSettings os = mObstacleSettings; diff --git a/src/core/labeling/qgsvectorlayerlabelprovider.cpp b/src/core/labeling/qgsvectorlayerlabelprovider.cpp index 393b7a7b0603..01b291737d33 100644 --- a/src/core/labeling/qgsvectorlayerlabelprovider.cpp +++ b/src/core/labeling/qgsvectorlayerlabelprovider.cpp @@ -257,7 +257,7 @@ QgsGeometry QgsVectorLayerLabelProvider::getPointObstacleGeometry( QgsFeature &f bX << bounds.left() << bounds.right() << bounds.right() << bounds.left(); QVector< double > bY; bY << bounds.top() << bounds.top() << bounds.bottom() << bounds.bottom(); - std::unique_ptr< QgsLineString > boundLineString = std::make_unique< QgsLineString >( bX, bY ); + auto boundLineString = std::make_unique< QgsLineString >( bX, bY ); //then transform back to map units //TODO - remove when labeling is refactored to use screen units @@ -292,7 +292,7 @@ QgsGeometry QgsVectorLayerLabelProvider::getPointObstacleGeometry( QgsFeature &f return QgsGeometry(); } - std::unique_ptr< QgsPolygon > obstaclePolygon = std::make_unique< QgsPolygon >(); + auto obstaclePolygon = std::make_unique< QgsPolygon >(); obstaclePolygon->setExteriorRing( boundLineString.release() ); if ( isMultiPoint ) diff --git a/src/core/labeling/rules/qgslabelingenginerule_impl.cpp b/src/core/labeling/rules/qgslabelingenginerule_impl.cpp index f2c9193c3973..cf97f92679a4 100644 --- a/src/core/labeling/rules/qgslabelingenginerule_impl.cpp +++ b/src/core/labeling/rules/qgslabelingenginerule_impl.cpp @@ -244,7 +244,7 @@ QgsLabelingEngineRuleMinimumDistanceLabelToFeature::~QgsLabelingEngineRuleMinimu QgsLabelingEngineRuleMinimumDistanceLabelToFeature *QgsLabelingEngineRuleMinimumDistanceLabelToFeature::clone() const { - std::unique_ptr< QgsLabelingEngineRuleMinimumDistanceLabelToFeature> res = std::make_unique< QgsLabelingEngineRuleMinimumDistanceLabelToFeature >(); + auto res = std::make_unique< QgsLabelingEngineRuleMinimumDistanceLabelToFeature >(); copyCommonProperties( res.get() ); return res.release(); } @@ -288,7 +288,7 @@ QgsLabelingEngineRuleMaximumDistanceLabelToFeature::~QgsLabelingEngineRuleMaximu QgsLabelingEngineRuleMaximumDistanceLabelToFeature *QgsLabelingEngineRuleMaximumDistanceLabelToFeature::clone() const { - std::unique_ptr< QgsLabelingEngineRuleMaximumDistanceLabelToFeature > res = std::make_unique< QgsLabelingEngineRuleMaximumDistanceLabelToFeature >(); + auto res = std::make_unique< QgsLabelingEngineRuleMaximumDistanceLabelToFeature >(); copyCommonProperties( res.get() ); return res.release(); } @@ -328,7 +328,7 @@ QgsLabelingEngineRuleMinimumDistanceLabelToLabel::~QgsLabelingEngineRuleMinimumD QgsLabelingEngineRuleMinimumDistanceLabelToLabel *QgsLabelingEngineRuleMinimumDistanceLabelToLabel::clone() const { - std::unique_ptr< QgsLabelingEngineRuleMinimumDistanceLabelToLabel> res = std::make_unique< QgsLabelingEngineRuleMinimumDistanceLabelToLabel >(); + auto res = std::make_unique< QgsLabelingEngineRuleMinimumDistanceLabelToLabel >(); copyCommonProperties( res.get() ); res->mLabeledLayer = mLabeledLayer; res->mTargetLayer = mTargetLayer; @@ -496,7 +496,7 @@ QgsLabelingEngineRuleAvoidLabelOverlapWithFeature::~QgsLabelingEngineRuleAvoidLa QgsLabelingEngineRuleAvoidLabelOverlapWithFeature *QgsLabelingEngineRuleAvoidLabelOverlapWithFeature::clone() const { - std::unique_ptr< QgsLabelingEngineRuleAvoidLabelOverlapWithFeature> res = std::make_unique< QgsLabelingEngineRuleAvoidLabelOverlapWithFeature >(); + auto res = std::make_unique< QgsLabelingEngineRuleAvoidLabelOverlapWithFeature >(); copyCommonProperties( res.get() ); res->mLabeledLayer = mLabeledLayer; res->mTargetLayer = mTargetLayer; diff --git a/src/core/layertree/qgslayertreegroup.cpp b/src/core/layertree/qgslayertreegroup.cpp index a67f0e501885..1e80288f36b0 100644 --- a/src/core/layertree/qgslayertreegroup.cpp +++ b/src/core/layertree/qgslayertreegroup.cpp @@ -503,7 +503,7 @@ QgsGroupLayer *QgsLayerTreeGroup::convertToGroupLayer( const QgsGroupLayer::Laye if ( !mGroupLayer.layerId.isEmpty() ) return nullptr; - std::unique_ptr< QgsGroupLayer > res = std::make_unique< QgsGroupLayer >( name(), options ); + auto res = std::make_unique< QgsGroupLayer >( name(), options ); mGroupLayer.setLayer( res.get() ); updateGroupLayers(); diff --git a/src/core/layertree/qgslayertreemodel.cpp b/src/core/layertree/qgslayertreemodel.cpp index 139e31365c00..b5bfd3688381 100644 --- a/src/core/layertree/qgslayertreemodel.cpp +++ b/src/core/layertree/qgslayertreemodel.cpp @@ -617,7 +617,7 @@ void QgsLayerTreeModel::setLegendFilter( const QgsMapSettings *settings, bool us { if ( settings && settings->hasValidSettings() ) { - std::unique_ptr< QgsLayerTreeFilterSettings > filterSettings = std::make_unique< QgsLayerTreeFilterSettings >( *settings ); + auto filterSettings = std::make_unique< QgsLayerTreeFilterSettings >( *settings ); if ( !useExtent ) // only expressions { diff --git a/src/core/layertree/qgslayertreemodellegendnode.cpp b/src/core/layertree/qgslayertreemodellegendnode.cpp index ac6709580df3..483d101cd9d5 100644 --- a/src/core/layertree/qgslayertreemodellegendnode.cpp +++ b/src/core/layertree/qgslayertreemodellegendnode.cpp @@ -490,7 +490,7 @@ QgsRenderContext *QgsLayerTreeModelLegendNode::createTemporaryRenderContext() co return nullptr; // setup temporary render context - std::unique_ptr context = std::make_unique( ); + auto context = std::make_unique( ); context->setScaleFactor( dpi / 25.4 ); context->setRendererScale( scale ); context->setMapToPixel( QgsMapToPixel( mupp ) ); diff --git a/src/core/layout/qgsabstractreportsection.cpp b/src/core/layout/qgsabstractreportsection.cpp index 52967e688226..923caed5770c 100644 --- a/src/core/layout/qgsabstractreportsection.cpp +++ b/src/core/layout/qgsabstractreportsection.cpp @@ -118,7 +118,7 @@ bool QgsAbstractReportSection::readXml( const QDomElement &element, const QDomDo if ( !headerElement.isNull() ) { const QDomElement headerLayoutElem = headerElement.firstChild().toElement(); - std::unique_ptr< QgsLayout > header = std::make_unique< QgsLayout >( project() ); + auto header = std::make_unique< QgsLayout >( project() ); header->readXml( headerLayoutElem, doc, context ); mHeader = std::move( header ); } @@ -126,7 +126,7 @@ bool QgsAbstractReportSection::readXml( const QDomElement &element, const QDomDo if ( !footerElement.isNull() ) { const QDomElement footerLayoutElem = footerElement.firstChild().toElement(); - std::unique_ptr< QgsLayout > footer = std::make_unique< QgsLayout >( project() ); + auto footer = std::make_unique< QgsLayout >( project() ); footer->readXml( footerLayoutElem, doc, context ); mFooter = std::move( footer ); } diff --git a/src/core/layout/qgscompositionconverter.cpp b/src/core/layout/qgscompositionconverter.cpp index c5e3c41d836f..7b675c92ada4 100644 --- a/src/core/layout/qgscompositionconverter.cpp +++ b/src/core/layout/qgscompositionconverter.cpp @@ -129,7 +129,7 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo const QDomElement parentElement = composerElement.parentNode().toElement(); - std::unique_ptr< QgsPrintLayout > layout = std::make_unique< QgsPrintLayout >( project ); + auto layout = std::make_unique< QgsPrintLayout >( project ); layout->undoStack()->blockCommands( true ); layout->mCustomProperties.readXml( composerElement ); @@ -170,7 +170,7 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo // Not necessary: double y2 = snapLineElem.attribute( QStringLiteral( "y2" ) ).toDouble(); const Qt::Orientation orientation( x1 == x2 ? Qt::Orientation::Vertical : Qt::Orientation::Horizontal ); const QgsLayoutMeasurement position( x1 == x2 ? x1 : y1 ); - std::unique_ptr< QgsLayoutGuide > guide = std::make_unique< QgsLayoutGuide >( orientation, position, page ); + auto guide = std::make_unique< QgsLayoutGuide >( orientation, position, page ); layout->guides().addGuide( guide.release() ); } } @@ -1128,8 +1128,8 @@ bool QgsCompositionConverter::readScaleBarXml( QgsLayoutItemScaleBar *layoutItem layoutItem->alternateFillSymbol()->setColor( QColor( itemElem.attribute( QStringLiteral( "brush2Color" ), QStringLiteral( "#ffffff" ) ) ) ); } - std::unique_ptr< QgsLineSymbol > lineSymbol = std::make_unique< QgsLineSymbol >(); - std::unique_ptr< QgsSimpleLineSymbolLayer > lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >(); + auto lineSymbol = std::make_unique< QgsLineSymbol >(); + auto lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >(); lineSymbolLayer->setWidth( itemElem.attribute( QStringLiteral( "outlineWidth" ), QStringLiteral( "0.3" ) ).toDouble() ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setPenJoinStyle( QgsSymbolLayerUtils::decodePenJoinStyle( itemElem.attribute( QStringLiteral( "lineJoinStyle" ), QStringLiteral( "miter" ) ) ) ); diff --git a/src/core/layout/qgslayout.cpp b/src/core/layout/qgslayout.cpp index d9100873f0ce..8a8f2f80ded7 100644 --- a/src/core/layout/qgslayout.cpp +++ b/src/core/layout/qgslayout.cpp @@ -98,7 +98,7 @@ QgsLayout *QgsLayout::clone() const QDomElement elem = writeXml( currentDoc, context ); currentDoc.appendChild( elem ); - std::unique_ptr< QgsLayout > newLayout = std::make_unique< QgsLayout >( mProject ); + auto newLayout = std::make_unique< QgsLayout >( mProject ); bool ok = false; newLayout->loadFromTemplate( currentDoc, context, true, &ok ); if ( !ok ) diff --git a/src/core/layout/qgslayoutitemattributetable.cpp b/src/core/layout/qgslayoutitemattributetable.cpp index 8d1c6905aac6..5c6d685cd2d7 100644 --- a/src/core/layout/qgslayoutitemattributetable.cpp +++ b/src/core/layout/qgslayoutitemattributetable.cpp @@ -614,7 +614,7 @@ bool QgsLayoutItemAttributeTable::getTableContents( QgsLayoutTableContents &cont else { // Lets assume it's an expression - std::unique_ptr< QgsExpression > expression = std::make_unique< QgsExpression >( column.attribute() ); + auto expression = std::make_unique< QgsExpression >( column.attribute() ); context.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "row_number" ), counter + 1, true ) ); expression->prepare( &context ); QVariant value = expression->evaluate( &context ); diff --git a/src/core/layout/qgslayoutitemscalebar.cpp b/src/core/layout/qgslayoutitemscalebar.cpp index 2937e1299a95..214af305c5e0 100644 --- a/src/core/layout/qgslayoutitemscalebar.cpp +++ b/src/core/layout/qgslayoutitemscalebar.cpp @@ -1253,8 +1253,8 @@ bool QgsLayoutItemScaleBar::readPropertiesFromElement( const QDomElement &itemEl if ( !foundLineSymbol ) { // old project compatibility - std::unique_ptr< QgsLineSymbol > lineSymbol = std::make_unique< QgsLineSymbol >(); - std::unique_ptr< QgsSimpleLineSymbolLayer > lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >(); + auto lineSymbol = std::make_unique< QgsLineSymbol >(); + auto lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >(); lineSymbolLayer->setWidth( itemElem.attribute( QStringLiteral( "outlineWidth" ), QStringLiteral( "0.3" ) ).toDouble() ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setPenJoinStyle( QgsSymbolLayerUtils::decodePenJoinStyle( itemElem.attribute( QStringLiteral( "lineJoinStyle" ), QStringLiteral( "miter" ) ) ) ); @@ -1346,8 +1346,8 @@ bool QgsLayoutItemScaleBar::readPropertiesFromElement( const QDomElement &itemEl if ( !foundFillSymbol1 ) { // old project compatibility - std::unique_ptr< QgsFillSymbol > fillSymbol = std::make_unique< QgsFillSymbol >(); - std::unique_ptr< QgsSimpleFillSymbolLayer > fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto fillSymbol = std::make_unique< QgsFillSymbol >(); + auto fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); fillSymbolLayer->setStrokeStyle( Qt::NoPen ); //fill color @@ -1397,8 +1397,8 @@ bool QgsLayoutItemScaleBar::readPropertiesFromElement( const QDomElement &itemEl if ( !foundFillSymbol2 ) { // old project compatibility - std::unique_ptr< QgsFillSymbol > fillSymbol = std::make_unique< QgsFillSymbol >(); - std::unique_ptr< QgsSimpleFillSymbolLayer > fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto fillSymbol = std::make_unique< QgsFillSymbol >(); + auto fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); fillSymbolLayer->setStrokeStyle( Qt::NoPen ); //fill color 2 diff --git a/src/core/layout/qgslayoutmanager.cpp b/src/core/layout/qgslayoutmanager.cpp index d4330287f486..1b66a2252f3b 100644 --- a/src/core/layout/qgslayoutmanager.cpp +++ b/src/core/layout/qgslayoutmanager.cpp @@ -210,7 +210,7 @@ bool QgsLayoutManager::readXml( const QDomElement &element, const QDomDocument & const QString layoutName = layoutNodes.at( i ).toElement().attribute( QStringLiteral( "name" ) ); QgsScopedRuntimeProfile profile( layoutName, QStringLiteral( "projectload" ) ); - std::unique_ptr< QgsPrintLayout > l = std::make_unique< QgsPrintLayout >( mProject ); + auto l = std::make_unique< QgsPrintLayout >( mProject ); l->undoStack()->blockCommands( true ); if ( !l->readLayoutXml( layoutNodes.at( i ).toElement(), doc, context ) ) { @@ -231,7 +231,7 @@ bool QgsLayoutManager::readXml( const QDomElement &element, const QDomDocument & const QString layoutName = reportNodes.at( i ).toElement().attribute( QStringLiteral( "name" ) ); QgsScopedRuntimeProfile profile( layoutName, QStringLiteral( "projectload" ) ); - std::unique_ptr< QgsReport > r = std::make_unique< QgsReport >( mProject ); + auto r = std::make_unique< QgsReport >( mProject ); if ( !r->readLayoutXml( reportNodes.at( i ).toElement(), doc, context ) ) { result = false; diff --git a/src/core/layout/qgslayoutmultiframe.cpp b/src/core/layout/qgslayoutmultiframe.cpp index 310916bcd803..13c11ab81a65 100644 --- a/src/core/layout/qgslayoutmultiframe.cpp +++ b/src/core/layout/qgslayoutmultiframe.cpp @@ -403,7 +403,7 @@ void QgsLayoutMultiFrame::handlePageChange() for ( int i = lastItemPage + 1; i < mLayout->pageCollection()->pageCount(); ++i ) { //copy last frame to current page - std::unique_ptr< QgsLayoutFrame > newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this ); + auto newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this ); newFrame->attemptSetSceneRect( QRectF( lastFrame->pos().x(), mLayout->pageCollection()->page( i )->pos().y() + lastFrame->pagePos().y(), @@ -557,7 +557,7 @@ bool QgsLayoutMultiFrame::readXml( const QDomElement &element, const QDomDocumen if ( !frameNodes.isEmpty() ) { QDomElement frameItemElement = frameNodes.at( 0 ).toElement(); - std::unique_ptr< QgsLayoutFrame > newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this ); + auto newFrame = std::make_unique< QgsLayoutFrame >( mLayout, this ); newFrame->readXml( frameItemElement, doc, context ); addFrame( newFrame.release(), false ); } diff --git a/src/core/layout/qgslayoutpagecollection.cpp b/src/core/layout/qgslayoutpagecollection.cpp index 6ed30610b901..b388be0b78f3 100644 --- a/src/core/layout/qgslayoutpagecollection.cpp +++ b/src/core/layout/qgslayoutpagecollection.cpp @@ -309,7 +309,7 @@ void QgsLayoutPageCollection::resizeToContents( const QgsMargins &margins, Qgis: if ( mPages.empty() ) { - std::unique_ptr< QgsLayoutItemPage > page = std::make_unique< QgsLayoutItemPage >( mLayout ); + auto page = std::make_unique< QgsLayoutItemPage >( mLayout ); addPage( page.release() ); } @@ -614,7 +614,7 @@ QgsLayoutItemPage *QgsLayoutPageCollection::extendByNewPage() return nullptr; QgsLayoutItemPage *lastPage = mPages.at( mPages.count() - 1 ); - std::unique_ptr< QgsLayoutItemPage > newPage = std::make_unique< QgsLayoutItemPage >( mLayout ); + auto newPage = std::make_unique< QgsLayoutItemPage >( mLayout ); newPage->attemptResize( lastPage->sizeWithUnits() ); addPage( newPage.release() ); return mPages.at( mPages.count() - 1 ); diff --git a/src/core/layout/qgslayouttable.cpp b/src/core/layout/qgslayouttable.cpp index 93aa1b3e60e7..ada214113ecc 100644 --- a/src/core/layout/qgslayouttable.cpp +++ b/src/core/layout/qgslayouttable.cpp @@ -430,7 +430,7 @@ void QgsLayoutTable::render( QgsLayoutItemRenderContext &context, const QRectF & int col = 0; for ( const QgsLayoutTableColumn &column : std::as_const( mColumns ) ) { - std::unique_ptr< QgsExpressionContextScope > headerCellScope = std::make_unique< QgsExpressionContextScope >(); + auto headerCellScope = std::make_unique< QgsExpressionContextScope >(); headerCellScope->setVariable( QStringLiteral( "column_number" ), col + 1, true ); QgsExpressionContextScopePopper popper( context.renderContext().expressionContext(), headerCellScope.release() ); @@ -1022,7 +1022,7 @@ QMap QgsLayoutTable::headerLabels() const QgsExpressionContextScope *QgsLayoutTable::scopeForCell( int row, int column ) const { - std::unique_ptr< QgsExpressionContextScope > cellScope = std::make_unique< QgsExpressionContextScope >(); + auto cellScope = std::make_unique< QgsExpressionContextScope >(); cellScope->setVariable( QStringLiteral( "row_number" ), row + 1, true ); cellScope->setVariable( QStringLiteral( "column_number" ), column + 1, true ); return cellScope.release(); @@ -1134,7 +1134,7 @@ bool QgsLayoutTable::calculateMaxColumnWidths() } else if ( mHeaderMode != QgsLayoutTable::NoHeaders ) { - std::unique_ptr< QgsExpressionContextScope > headerCellScope = std::make_unique< QgsExpressionContextScope >(); + auto headerCellScope = std::make_unique< QgsExpressionContextScope >(); headerCellScope->setVariable( QStringLiteral( "column_number" ), i + 1, true ); QgsExpressionContextScopePopper popper( context.expressionContext(), headerCellScope.release() ); @@ -1211,7 +1211,7 @@ bool QgsLayoutTable::calculateMaxRowHeights() int i = 0; for ( const QgsLayoutTableColumn &col : std::as_const( mColumns ) ) { - std::unique_ptr< QgsExpressionContextScope > headerCellScope = std::make_unique< QgsExpressionContextScope >(); + auto headerCellScope = std::make_unique< QgsExpressionContextScope >(); headerCellScope->setVariable( QStringLiteral( "column_number" ), i + 1, true ); QgsExpressionContextScopePopper popper( context.expressionContext(), headerCellScope.release() ); diff --git a/src/core/layout/qgsprintlayout.cpp b/src/core/layout/qgsprintlayout.cpp index e97fe7fff4b7..0a0c392be93d 100644 --- a/src/core/layout/qgsprintlayout.cpp +++ b/src/core/layout/qgsprintlayout.cpp @@ -35,7 +35,7 @@ QgsPrintLayout *QgsPrintLayout::clone() const const QDomElement elem = writeXml( currentDoc, context ); currentDoc.appendChild( elem ); - std::unique_ptr< QgsPrintLayout > newLayout = std::make_unique< QgsPrintLayout >( project() ); + auto newLayout = std::make_unique< QgsPrintLayout >( project() ); bool ok = false; newLayout->loadFromTemplate( currentDoc, context, true, &ok ); if ( !ok ) diff --git a/src/core/layout/qgsreport.cpp b/src/core/layout/qgsreport.cpp index dd495799385f..a6c416ff0448 100644 --- a/src/core/layout/qgsreport.cpp +++ b/src/core/layout/qgsreport.cpp @@ -32,7 +32,7 @@ QIcon QgsReport::icon() const QgsReport *QgsReport::clone() const { - std::unique_ptr< QgsReport > copy = std::make_unique< QgsReport >( mProject ); + auto copy = std::make_unique< QgsReport >( mProject ); copyCommonProperties( copy.get() ); return copy.release(); } diff --git a/src/core/layout/qgsreportsectionfieldgroup.cpp b/src/core/layout/qgsreportsectionfieldgroup.cpp index f39f7c34d610..e1f475880f54 100644 --- a/src/core/layout/qgsreportsectionfieldgroup.cpp +++ b/src/core/layout/qgsreportsectionfieldgroup.cpp @@ -40,7 +40,7 @@ QIcon QgsReportSectionFieldGroup::icon() const QgsReportSectionFieldGroup *QgsReportSectionFieldGroup::clone() const { - std::unique_ptr< QgsReportSectionFieldGroup > copy = std::make_unique< QgsReportSectionFieldGroup >( nullptr ); + auto copy = std::make_unique< QgsReportSectionFieldGroup >( nullptr ); copyCommonProperties( copy.get() ); if ( mBody ) @@ -219,7 +219,7 @@ bool QgsReportSectionFieldGroup::readPropertiesFromElement( const QDomElement &e if ( !bodyElement.isNull() ) { const QDomElement bodyLayoutElem = bodyElement.firstChild().toElement(); - std::unique_ptr< QgsLayout > body = std::make_unique< QgsLayout >( project() ); + auto body = std::make_unique< QgsLayout >( project() ); body->readXml( bodyLayoutElem, doc, context ); mBody = std::move( body ); } diff --git a/src/core/layout/qgsreportsectionlayout.cpp b/src/core/layout/qgsreportsectionlayout.cpp index 6f8f58d03f77..cc52beb7fef4 100644 --- a/src/core/layout/qgsreportsectionlayout.cpp +++ b/src/core/layout/qgsreportsectionlayout.cpp @@ -30,7 +30,7 @@ QIcon QgsReportSectionLayout::icon() const QgsReportSectionLayout *QgsReportSectionLayout::clone() const { - std::unique_ptr< QgsReportSectionLayout > copy = std::make_unique< QgsReportSectionLayout >( nullptr ); + auto copy = std::make_unique< QgsReportSectionLayout >( nullptr ); copyCommonProperties( copy.get() ); if ( mBody ) @@ -91,7 +91,7 @@ bool QgsReportSectionLayout::readPropertiesFromElement( const QDomElement &eleme if ( !bodyElement.isNull() ) { const QDomElement bodyLayoutElem = bodyElement.firstChild().toElement(); - std::unique_ptr< QgsLayout > body = std::make_unique< QgsLayout >( project() ); + auto body = std::make_unique< QgsLayout >( project() ); body->readXml( bodyLayoutElem, doc, context ); mBody = std::move( body ); } diff --git a/src/core/maprenderer/qgsmaprendererjob.cpp b/src/core/maprenderer/qgsmaprendererjob.cpp index 32b857868bbd..2746f07a857f 100644 --- a/src/core/maprenderer/qgsmaprendererjob.cpp +++ b/src/core/maprenderer/qgsmaprendererjob.cpp @@ -448,7 +448,7 @@ QImage *QgsMapRendererJob::allocateImage( QString layerId ) QgsElevationMap *QgsMapRendererJob::allocateElevationMap( QString layerId ) { - std::unique_ptr elevationMap = std::make_unique( mSettings.deviceOutputSize(), mSettings.devicePixelRatio() ); + auto elevationMap = std::make_unique( mSettings.deviceOutputSize(), mSettings.devicePixelRatio() ); if ( !elevationMap->isValid() ) { mErrors.append( Error( layerId, tr( "Insufficient memory for elevation map %1x%2" ).arg( mSettings.outputSize().width() ).arg( mSettings.outputSize().height() ) ) ); @@ -471,7 +471,7 @@ QPainter *QgsMapRendererJob::allocateImageAndPainter( QString layerId, QImage *& QgsMapRendererJob::PictureAndPainter QgsMapRendererJob::allocatePictureAndPainter( const QgsRenderContext *context ) { - std::unique_ptr picture = std::make_unique(); + auto picture = std::make_unique(); QPainter *painter = new QPainter( picture.get() ); context->setPainterFlagsUsingContext( painter ); return { std::move( picture ), painter }; @@ -830,7 +830,7 @@ std::vector< LayerRenderJob > QgsMapRendererJob::prepareSecondPassJobs( std::vec if ( forceVector && !labelHasEffects[ maskId ] ) { // set a painter to get all masking instruction in order to later clip masked symbol layer - std::unique_ptr< QgsGeometryPaintDevice > geomPaintDevice = std::make_unique< QgsGeometryPaintDevice >( true ); + auto geomPaintDevice = std::make_unique< QgsGeometryPaintDevice >( true ); geomPaintDevice->setStrokedPathSegments( 4 ); geomPaintDevice->setSimplificationTolerance( labelJob.context.maskSettings().simplifyTolerance() ); maskPaintDevice = geomPaintDevice.release(); @@ -914,7 +914,7 @@ std::vector< LayerRenderJob > QgsMapRendererJob::prepareSecondPassJobs( std::vec if ( forceVector && !maskLayerHasEffects[ job.layerId ] ) { // set a painter to get all masking instruction in order to later clip masked symbol layer - std::unique_ptr< QgsGeometryPaintDevice > geomPaintDevice = std::make_unique< QgsGeometryPaintDevice >( ); + auto geomPaintDevice = std::make_unique< QgsGeometryPaintDevice >( ); geomPaintDevice->setStrokedPathSegments( 4 ); geomPaintDevice->setSimplificationTolerance( job.context()->maskSettings().simplifyTolerance() ); maskPaintDevice = geomPaintDevice.release(); diff --git a/src/core/mesh/qgsmeshcalculator.cpp b/src/core/mesh/qgsmeshcalculator.cpp index 9aab85cda058..440125734a0c 100644 --- a/src/core/mesh/qgsmeshcalculator.cpp +++ b/src/core/mesh/qgsmeshcalculator.cpp @@ -226,7 +226,7 @@ QgsMeshCalculator::Result QgsMeshCalculator::processCalculation( QgsFeedback *fe return InvalidDatasets; } - std::unique_ptr outputGroup = std::make_unique ( mOutputGroupName, dsu.outputType() ); + auto outputGroup = std::make_unique ( mOutputGroupName, dsu.outputType() ); // calculate const bool ok = calcNode->calculate( dsu, *outputGroup ); diff --git a/src/core/mesh/qgsmesheditor.cpp b/src/core/mesh/qgsmesheditor.cpp index 79d520d27519..c790275e7a32 100644 --- a/src/core/mesh/qgsmesheditor.cpp +++ b/src/core/mesh/qgsmesheditor.cpp @@ -170,7 +170,7 @@ bool QgsMeshEditor::isFaceGeometricallyCompatible( const QList &vertexIndex const QgsPoint &vertex = vertices[i]; ring.append( vertex ); } - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); polygon->setExteriorRing( new QgsLineString( ring ) ); const QgsGeometry newFaceGeom( polygon.release() ); std::unique_ptr geomEngine( QgsGeometry::createGeometryEngine( newFaceGeom.constGet() ) ); diff --git a/src/core/mesh/qgsmeshlayerelevationproperties.cpp b/src/core/mesh/qgsmeshlayerelevationproperties.cpp index 3663900d8ace..95ffe400b833 100644 --- a/src/core/mesh/qgsmeshlayerelevationproperties.cpp +++ b/src/core/mesh/qgsmeshlayerelevationproperties.cpp @@ -182,7 +182,7 @@ QString QgsMeshLayerElevationProperties::htmlSummary() const QgsMeshLayerElevationProperties *QgsMeshLayerElevationProperties::clone() const { - std::unique_ptr< QgsMeshLayerElevationProperties > res = std::make_unique< QgsMeshLayerElevationProperties >( nullptr ); + auto res = std::make_unique< QgsMeshLayerElevationProperties >( nullptr ); res->setMode( mMode ); res->setProfileLineSymbol( mProfileLineSymbol->clone() ); res->setProfileFillSymbol( mProfileFillSymbol->clone() ); @@ -411,13 +411,13 @@ void QgsMeshLayerElevationProperties::setElevationLimit( double limit ) void QgsMeshLayerElevationProperties::setDefaultProfileLineSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); + auto profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); mProfileLineSymbol = std::make_unique< QgsLineSymbol>( QgsSymbolLayerList( { profileLineLayer.release() } ) ); } void QgsMeshLayerElevationProperties::setDefaultProfileFillSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); + auto profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); profileFillLayer->setStrokeStyle( Qt::NoPen ); mProfileFillSymbol = std::make_unique< QgsFillSymbol>( QgsSymbolLayerList( { profileFillLayer.release() } ) ); } diff --git a/src/core/mesh/qgsmeshlayerinterpolator.cpp b/src/core/mesh/qgsmeshlayerinterpolator.cpp index f4f7b1dffc78..f2581c479eab 100644 --- a/src/core/mesh/qgsmeshlayerinterpolator.cpp +++ b/src/core/mesh/qgsmeshlayerinterpolator.cpp @@ -242,9 +242,9 @@ QgsRasterBlock *QgsMeshUtils::exportRasterBlock( renderContext.setMapToPixel( mapToPixel ); renderContext.setExtent( extent ); - std::unique_ptr nativeMesh = std::make_unique(); + auto nativeMesh = std::make_unique(); layer.dataProvider()->populateMesh( nativeMesh.get() ); - std::unique_ptr triangularMesh = std::make_unique(); + auto triangularMesh = std::make_unique(); triangularMesh->update( nativeMesh.get(), transform ); const QgsMeshDatasetGroupMetadata metadata = layer.datasetGroupMetadata( datasetIndex ); diff --git a/src/core/mesh/qgsmeshvirtualdatasetgroup.cpp b/src/core/mesh/qgsmeshvirtualdatasetgroup.cpp index 755929bc3e14..46d261f2ae39 100644 --- a/src/core/mesh/qgsmeshvirtualdatasetgroup.cpp +++ b/src/core/mesh/qgsmeshvirtualdatasetgroup.cpp @@ -164,7 +164,7 @@ bool QgsMeshVirtualDatasetGroup::calculateDataset() const return false; //open output dataset - std::unique_ptr outputGroup = std::make_unique ( QString(), dsu.outputType() ); + auto outputGroup = std::make_unique ( QString(), dsu.outputType() ); mCalcNode->calculate( dsu, *outputGroup ); if ( outputGroup->memoryDatasets.isEmpty() ) diff --git a/src/core/mesh/qgstriangularmesh.cpp b/src/core/mesh/qgstriangularmesh.cpp index d16b083185f0..f3e23c5c05b6 100644 --- a/src/core/mesh/qgstriangularmesh.cpp +++ b/src/core/mesh/qgstriangularmesh.cpp @@ -635,7 +635,7 @@ std::unique_ptr< QgsPolygon > QgsMeshUtils::toPolygon( const QgsMeshFace &face, const QgsPoint &vertex = vertices[vertexId]; ring.append( vertex ); } - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); polygon->setExteriorRing( new QgsLineString( ring ) ); return polygon; } diff --git a/src/core/network/qgsblockingnetworkrequest.cpp b/src/core/network/qgsblockingnetworkrequest.cpp index e0dec75a4016..cee9476c69e4 100644 --- a/src/core/network/qgsblockingnetworkrequest.cpp +++ b/src/core/network/qgsblockingnetworkrequest.cpp @@ -259,7 +259,7 @@ QgsBlockingNetworkRequest::ErrorCode QgsBlockingNetworkRequest::doRequest( QgsBl if ( requestMadeFromMainThread ) { - std::unique_ptr downloaderThread = std::make_unique( downloaderFunction ); + auto downloaderThread = std::make_unique( downloaderFunction ); downloaderThread->start(); while ( true ) diff --git a/src/core/numericformats/qgsbasicnumericformat.cpp b/src/core/numericformats/qgsbasicnumericformat.cpp index ae76e2bbda98..38cf065c220d 100644 --- a/src/core/numericformats/qgsbasicnumericformat.cpp +++ b/src/core/numericformats/qgsbasicnumericformat.cpp @@ -145,7 +145,7 @@ QgsNumericFormat *QgsBasicNumericFormat::clone() const QgsNumericFormat *QgsBasicNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsBasicNumericFormat > res = std::make_unique< QgsBasicNumericFormat >(); + auto res = std::make_unique< QgsBasicNumericFormat >(); res->setConfiguration( configuration, context ); return res.release(); } diff --git a/src/core/numericformats/qgsbearingnumericformat.cpp b/src/core/numericformats/qgsbearingnumericformat.cpp index fcae60b651ad..4cf7625c0524 100644 --- a/src/core/numericformats/qgsbearingnumericformat.cpp +++ b/src/core/numericformats/qgsbearingnumericformat.cpp @@ -91,7 +91,7 @@ QgsBearingNumericFormat *QgsBearingNumericFormat::clone() const QgsNumericFormat *QgsBearingNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsBearingNumericFormat > res = std::make_unique< QgsBearingNumericFormat >(); + auto res = std::make_unique< QgsBearingNumericFormat >(); res->setConfiguration( configuration, context ); res->mDirectionFormat = static_cast< FormatDirectionOption >( configuration.value( QStringLiteral( "direction_format" ), 0 ).toInt() ); return res.release(); diff --git a/src/core/numericformats/qgscoordinatenumericformat.cpp b/src/core/numericformats/qgscoordinatenumericformat.cpp index 389d19e88cb7..896260da1a46 100644 --- a/src/core/numericformats/qgscoordinatenumericformat.cpp +++ b/src/core/numericformats/qgscoordinatenumericformat.cpp @@ -95,7 +95,7 @@ QgsGeographicCoordinateNumericFormat *QgsGeographicCoordinateNumericFormat::clon QgsNumericFormat *QgsGeographicCoordinateNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsGeographicCoordinateNumericFormat > res = std::make_unique< QgsGeographicCoordinateNumericFormat >(); + auto res = std::make_unique< QgsGeographicCoordinateNumericFormat >(); res->setConfiguration( configuration, context ); res->mAngleFormat = qgsEnumKeyToValue( configuration.value( QStringLiteral( "angle_format" ) ).toString(), AngleFormat::DecimalDegrees ); res->mShowLeadingZeros = configuration.value( QStringLiteral( "show_leading_zeros" ), false ).toBool(); diff --git a/src/core/numericformats/qgscurrencynumericformat.cpp b/src/core/numericformats/qgscurrencynumericformat.cpp index 2c59bb0abe58..70216d6b412e 100644 --- a/src/core/numericformats/qgscurrencynumericformat.cpp +++ b/src/core/numericformats/qgscurrencynumericformat.cpp @@ -61,7 +61,7 @@ QgsNumericFormat *QgsCurrencyNumericFormat::clone() const QgsNumericFormat *QgsCurrencyNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsCurrencyNumericFormat > res = std::make_unique< QgsCurrencyNumericFormat >(); + auto res = std::make_unique< QgsCurrencyNumericFormat >(); res->setConfiguration( configuration, context ); res->mPrefix = configuration.value( QStringLiteral( "prefix" ), QStringLiteral( "$" ) ).toString(); res->mSuffix = configuration.value( QStringLiteral( "suffix" ), QString() ).toString(); diff --git a/src/core/numericformats/qgsexpressionbasednumericformat.cpp b/src/core/numericformats/qgsexpressionbasednumericformat.cpp index 41f7c9546494..5a4922bdb052 100644 --- a/src/core/numericformats/qgsexpressionbasednumericformat.cpp +++ b/src/core/numericformats/qgsexpressionbasednumericformat.cpp @@ -51,7 +51,7 @@ QgsNumericFormat *QgsExpressionBasedNumericFormat::clone() const QgsNumericFormat *QgsExpressionBasedNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext & ) const { - std::unique_ptr< QgsExpressionBasedNumericFormat > res = std::make_unique< QgsExpressionBasedNumericFormat >(); + auto res = std::make_unique< QgsExpressionBasedNumericFormat >(); res->mExpression = QgsExpression( configuration.value( QStringLiteral( "expression" ), QStringLiteral( "@value" ) ).toString() ); return res.release(); } diff --git a/src/core/numericformats/qgsfractionnumericformat.cpp b/src/core/numericformats/qgsfractionnumericformat.cpp index 03c18182b654..b45057ecd5c7 100644 --- a/src/core/numericformats/qgsfractionnumericformat.cpp +++ b/src/core/numericformats/qgsfractionnumericformat.cpp @@ -155,7 +155,7 @@ QgsNumericFormat *QgsFractionNumericFormat::clone() const QgsNumericFormat *QgsFractionNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsFractionNumericFormat > res = std::make_unique< QgsFractionNumericFormat >(); + auto res = std::make_unique< QgsFractionNumericFormat >(); res->setConfiguration( configuration, context ); return res.release(); } diff --git a/src/core/numericformats/qgspercentagenumericformat.cpp b/src/core/numericformats/qgspercentagenumericformat.cpp index 43ce1df5f87a..a277fd0402c3 100644 --- a/src/core/numericformats/qgspercentagenumericformat.cpp +++ b/src/core/numericformats/qgspercentagenumericformat.cpp @@ -72,7 +72,7 @@ QgsNumericFormat *QgsPercentageNumericFormat::clone() const QgsNumericFormat *QgsPercentageNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsPercentageNumericFormat > res = std::make_unique< QgsPercentageNumericFormat >(); + auto res = std::make_unique< QgsPercentageNumericFormat >(); res->setConfiguration( configuration, context ); res->mInputValues = static_cast< InputValues >( configuration.value( QStringLiteral( "input_values" ), static_cast< int >( ValuesArePercentage ) ).toInt() ); res->setRoundingType( QgsBasicNumericFormat::DecimalPlaces ); diff --git a/src/core/numericformats/qgsscientificnumericformat.cpp b/src/core/numericformats/qgsscientificnumericformat.cpp index 9e1435398a2d..3949afa9aad0 100644 --- a/src/core/numericformats/qgsscientificnumericformat.cpp +++ b/src/core/numericformats/qgsscientificnumericformat.cpp @@ -50,7 +50,7 @@ QgsNumericFormat *QgsScientificNumericFormat::clone() const QgsNumericFormat *QgsScientificNumericFormat::create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const { - std::unique_ptr< QgsScientificNumericFormat > res = std::make_unique< QgsScientificNumericFormat >(); + auto res = std::make_unique< QgsScientificNumericFormat >(); res->setConfiguration( configuration, context ); res->setRoundingType( QgsBasicNumericFormat::DecimalPlaces ); return res.release(); diff --git a/src/core/painting/qgsgeometrypaintdevice.cpp b/src/core/painting/qgsgeometrypaintdevice.cpp index db95d0e000af..4422bc21c199 100644 --- a/src/core/painting/qgsgeometrypaintdevice.cpp +++ b/src/core/painting/qgsgeometrypaintdevice.cpp @@ -460,7 +460,7 @@ void QgsGeometryPaintEngine::addSubpathGeometries( const QPainterPath &path, con { if ( currentX.size() > 1 ) { - std::unique_ptr< QgsLineString > line = std::make_unique< QgsLineString >( currentX, currentY ); + auto line = std::make_unique< QgsLineString >( currentX, currentY ); if ( mUsePathStroker ) { addStrokedLine( line.get(), penWidth, endCapStyle, joinStyle, miterLimit, transformIsIdentity ? nullptr : &matrix ); @@ -547,7 +547,7 @@ void QgsGeometryPaintEngine::addSubpathGeometries( const QPainterPath &path, con if ( currentX.size() > 1 ) { - std::unique_ptr< QgsLineString > line = std::make_unique< QgsLineString >( currentX, currentY ); + auto line = std::make_unique< QgsLineString >( currentX, currentY ); if ( mUsePathStroker ) { addStrokedLine( line.get(), penWidth, endCapStyle, joinStyle, miterLimit, transformIsIdentity ? nullptr : &matrix ); diff --git a/src/core/pal/feature.cpp b/src/core/pal/feature.cpp index 81d40c6868c2..ceeb53e36de9 100644 --- a/src/core/pal/feature.cpp +++ b/src/core/pal/feature.cpp @@ -1435,14 +1435,14 @@ std::unique_ptr< LabelPosition > FeaturePart::curvedPlacementAtOffset( PointSet return nullptr; auto it = placement->graphemePlacement.constBegin(); - std::unique_ptr< LabelPosition > firstPosition = std::make_unique< LabelPosition >( 0, it->x, it->y, it->width, it->height, it->angle, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); + auto firstPosition = std::make_unique< LabelPosition >( 0, it->x, it->y, it->width, it->height, it->angle, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); firstPosition->setUpsideDownCharCount( placement->upsideDownCharCount ); firstPosition->setPartId( it->graphemeIndex ); LabelPosition *previousPosition = firstPosition.get(); it++; while ( it != placement->graphemePlacement.constEnd() ) { - std::unique_ptr< LabelPosition > position = std::make_unique< LabelPosition >( 0, it->x, it->y, it->width, it->height, it->angle, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); + auto position = std::make_unique< LabelPosition >( 0, it->x, it->y, it->width, it->height, it->angle, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); position->setPartId( it->graphemeIndex ); LabelPosition *nextPosition = position.get(); @@ -1739,7 +1739,7 @@ std::size_t FeaturePart::createCurvedCandidatesAlongLine( std::vector< std::uniq labelPosition->setCost( cost ); - std::unique_ptr< LabelPosition > p = std::make_unique< LabelPosition >( *labelPosition ); + auto p = std::make_unique< LabelPosition >( *labelPosition ); if ( p && mLF->permissibleZonePrepared() ) { bool within = true; @@ -1997,7 +1997,7 @@ std::size_t FeaturePart::createCandidatesForPolygon( std::vector< std::unique_pt // but the bugs noted in CostCalculator currently prevent this if ( mapShape->containsPoint( rx, ry ) ) { - std::unique_ptr< LabelPosition > potentialCandidate = std::make_unique< LabelPosition >( id++, rx - dlx, ry - dly, labelWidth, labelHeight, alpha, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); + auto potentialCandidate = std::make_unique< LabelPosition >( id++, rx - dlx, ry - dly, labelWidth, labelHeight, alpha, 0.0001, this, LabelPosition::LabelDirectionToLine::SameDirection, Qgis::LabelQuadrantPosition::Over ); // cost is set to minimal value, evaluated later lPos.emplace_back( std::move( potentialCandidate ) ); numberCandidatesGenerated++; @@ -2131,7 +2131,7 @@ std::size_t FeaturePart::createCandidatesOutsidePolygon( std::vector candidate = std::make_unique< LabelPosition >( i, labelX, labelY, labelWidth, labelHeight, labelAngle, 0, this, LabelPosition::LabelDirectionToLine::SameDirection, quadrant ); + auto candidate = std::make_unique< LabelPosition >( i, labelX, labelY, labelWidth, labelHeight, labelAngle, 0, this, LabelPosition::LabelDirectionToLine::SameDirection, quadrant ); if ( candidate->intersects( preparedBuffer.get() ) ) { // satisfy R3. Name should not cross the boundary of its area feature. diff --git a/src/core/pal/layer.cpp b/src/core/pal/layer.cpp index 7a275564396d..5b3fda155cad 100644 --- a/src/core/pal/layer.cpp +++ b/src/core/pal/layer.cpp @@ -128,7 +128,7 @@ bool Layer::registerFeature( QgsLabelFeature *lf ) throw InternalException::UnknownGeometry(); } - std::unique_ptr fpart = std::make_unique( lf, geom ); + auto fpart = std::make_unique( lf, geom ); // ignore invalid geometries if ( ( type == GEOS_LINESTRING && fpart->nbPoints < 2 ) || @@ -218,7 +218,7 @@ bool Layer::registerFeature( QgsLabelFeature *lf ) throw InternalException::UnknownGeometry(); } - std::unique_ptr fpart = std::make_unique( lf, geom.get() ); + auto fpart = std::make_unique( lf, geom.get() ); // ignore invalid geometries if ( ( type == GEOS_LINESTRING && fpart->nbPoints < 2 ) || @@ -458,7 +458,7 @@ void Layer::chopFeaturesAtRepeatDistance() GEOSCoordSeq_setXY_r( geosctxt, cooSeq, i, part[i].x, part[i].y ); } GEOSGeometry *newgeom = GEOSGeom_createLineString_r( geosctxt, cooSeq ); - std::unique_ptr< FeaturePart > newfpart = std::make_unique< FeaturePart >( fpart->feature(), newgeom ); + auto newfpart = std::make_unique< FeaturePart >( fpart->feature(), newgeom ); repeatParts.push_back( newfpart.get() ); newFeatureParts.emplace_back( std::move( newfpart ) ); break; @@ -475,7 +475,7 @@ void Layer::chopFeaturesAtRepeatDistance() } GEOSGeometry *newgeom = GEOSGeom_createLineString_r( geosctxt, cooSeq ); - std::unique_ptr< FeaturePart > newfpart = std::make_unique< FeaturePart >( fpart->feature(), newgeom ); + auto newfpart = std::make_unique< FeaturePart >( fpart->feature(), newgeom ); repeatParts.push_back( newfpart.get() ); newFeatureParts.emplace_back( std::move( newfpart ) ); part.clear(); diff --git a/src/core/pal/pal.cpp b/src/core/pal/pal.cpp index e4548ca69e61..8e8f6a1cafd3 100644 --- a/src/core/pal/pal.cpp +++ b/src/core/pal/pal.cpp @@ -95,7 +95,7 @@ Layer *Pal::addLayer( QgsAbstractLabelProvider *provider, const QString &layerNa } #endif - std::unique_ptr< Layer > layer = std::make_unique< Layer >( provider, layerName, arrangement, defaultPriority, active, toLabel, this ); + auto layer = std::make_unique< Layer >( provider, layerName, arrangement, defaultPriority, active, toLabel, this ); Layer *res = layer.get(); mLayers.emplace_back( std::make_pair( provider, std::move( layer ) ) ); mMutex.unlock(); @@ -126,7 +126,7 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const PalRtree< FeaturePart > obstacles( maxCoordinateExtentForSpatialIndices ); PalRtree< LabelPosition > allCandidatesFirstRound( maxCoordinateExtentForSpatialIndices ); std::vector< FeaturePart * > allObstacleParts; - std::unique_ptr< Problem > prob = std::make_unique< Problem >( maxCoordinateExtentForSpatialIndices ); + auto prob = std::make_unique< Problem >( maxCoordinateExtentForSpatialIndices ); double bbx[4]; double bby[4]; @@ -274,7 +274,7 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const std::sort( candidates.begin(), candidates.end(), CostCalculator::candidateSortGrow ); // valid features are added to fFeats - std::unique_ptr< Feats > ft = std::make_unique< Feats >(); + auto ft = std::make_unique< Feats >(); ft->feature = featurePart.get(); ft->shape = nullptr; ft->candidates = std::move( candidates ); @@ -296,7 +296,7 @@ std::unique_ptr Pal::extractProblem( const QgsRectangle &extent, const candidates.emplace_back( std::move( unplacedPosition ) ); // valid features are added to fFeats - std::unique_ptr< Feats > ft = std::make_unique< Feats >(); + auto ft = std::make_unique< Feats >(); ft->feature = featurePart.get(); ft->shape = nullptr; ft->candidates = std::move( candidates ); diff --git a/src/core/pal/pointset.cpp b/src/core/pal/pointset.cpp index 64fa7aa85e69..91f98bd73634 100644 --- a/src/core/pal/pointset.cpp +++ b/src/core/pal/pointset.cpp @@ -240,7 +240,7 @@ std::unique_ptr PointSet::extractShape( int nbPtSh, int imin, int imax { int i, j; - std::unique_ptr newShape = std::make_unique< PointSet >(); + auto newShape = std::make_unique< PointSet >(); newShape->type = GEOS_POLYGON; newShape->nbPoints = nbPtSh; newShape->x.resize( newShape->nbPoints ); diff --git a/src/core/plot/qgsplot.cpp b/src/core/plot/qgsplot.cpp index 31582f95fa70..d7315b84a5ae 100644 --- a/src/core/plot/qgsplot.cpp +++ b/src/core/plot/qgsplot.cpp @@ -784,26 +784,26 @@ QgsNumericFormat *QgsPlotDefaultSettings::axisLabelNumericFormat() QgsLineSymbol *QgsPlotDefaultSettings::axisGridMajorSymbol() { - std::unique_ptr< QgsSimpleLineSymbolLayer > gridMajor = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20, 150 ), 0.1 ); + auto gridMajor = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20, 150 ), 0.1 ); gridMajor->setPenCapStyle( Qt::FlatCap ); return new QgsLineSymbol( QgsSymbolLayerList( { gridMajor.release() } ) ); } QgsLineSymbol *QgsPlotDefaultSettings::axisGridMinorSymbol() { - std::unique_ptr< QgsSimpleLineSymbolLayer > gridMinor = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20, 50 ), 0.1 ); + auto gridMinor = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20, 50 ), 0.1 ); gridMinor->setPenCapStyle( Qt::FlatCap ); return new QgsLineSymbol( QgsSymbolLayerList( { gridMinor.release() } ) ); } QgsFillSymbol *QgsPlotDefaultSettings::chartBackgroundSymbol() { - std::unique_ptr< QgsSimpleFillSymbolLayer > chartFill = std::make_unique< QgsSimpleFillSymbolLayer >( QColor( 255, 255, 255 ) ); + auto chartFill = std::make_unique< QgsSimpleFillSymbolLayer >( QColor( 255, 255, 255 ) ); return new QgsFillSymbol( QgsSymbolLayerList( { chartFill.release() } ) ); } QgsFillSymbol *QgsPlotDefaultSettings::chartBorderSymbol() { - std::unique_ptr< QgsSimpleLineSymbolLayer > chartBorder = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20 ), 0.1 ); + auto chartBorder = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 20, 20, 20 ), 0.1 ); return new QgsFillSymbol( QgsSymbolLayerList( { chartBorder.release() } ) ); } diff --git a/src/core/pointcloud/qgseptdecoder.cpp b/src/core/pointcloud/qgseptdecoder.cpp index 407d71e17d70..eb6b83121da9 100644 --- a/src/core/pointcloud/qgseptdecoder.cpp +++ b/src/core/pointcloud/qgseptdecoder.cpp @@ -75,11 +75,11 @@ std::unique_ptr decompressBinary_( const QByteArray &dataUnc } int skippedPoints = 0; - std::unique_ptr< QgsPointCloudBlock > block = std::make_unique< QgsPointCloudBlock >( - count, - requestedAttributes, - data, scale, offset - ); + auto block = std::make_unique< QgsPointCloudBlock >( + count, + requestedAttributes, + data, scale, offset + ); const bool filterIsValid = filterExpression.isValid(); if ( !filterExpression.prepare( block.get() ) && filterIsValid ) diff --git a/src/core/pointcloud/qgslazdecoder.cpp b/src/core/pointcloud/qgslazdecoder.cpp index f78dc5cdf0ba..4109c0c1f5e1 100644 --- a/src/core/pointcloud/qgslazdecoder.cpp +++ b/src/core/pointcloud/qgslazdecoder.cpp @@ -557,11 +557,11 @@ std::unique_ptr decompressLaz_( FileType &file, const QgsPoi std::size_t outputOffset = 0; - std::unique_ptr< QgsPointCloudBlock > block = std::make_unique< QgsPointCloudBlock >( - count, - requestedAttributes, - data, scale, offset - ); + auto block = std::make_unique< QgsPointCloudBlock >( + count, + requestedAttributes, + data, scale, offset + ); int skippedPoints = 0; const bool filterIsValid = filterExpression.isValid(); @@ -672,10 +672,10 @@ std::unique_ptr QgsLazDecoder::decompressCopc( const QByteAr QVector extrabyteAttributesDetails = lazInfo.extrabytes(); std::vector< RequestedAttributeDetails > requestedAttributeDetails = prepareRequestedAttributeDetails_( requestedAttributes, extrabyteAttributesDetails ); - std::unique_ptr< QgsPointCloudBlock > block = std::make_unique< QgsPointCloudBlock >( - pointCount, requestedAttributes, - blockData, lazInfo.scale(), lazInfo.offset() - ); + auto block = std::make_unique< QgsPointCloudBlock >( + pointCount, requestedAttributes, + blockData, lazInfo.scale(), lazInfo.offset() + ); int skippedPoints = 0; const bool filterIsValid = filterExpression.isValid(); diff --git a/src/core/pointcloud/qgspointcloudattributebyramprenderer.cpp b/src/core/pointcloud/qgspointcloudattributebyramprenderer.cpp index ad07f19315a4..a9ecfb31b675 100644 --- a/src/core/pointcloud/qgspointcloudattributebyramprenderer.cpp +++ b/src/core/pointcloud/qgspointcloudattributebyramprenderer.cpp @@ -36,7 +36,7 @@ QString QgsPointCloudAttributeByRampRenderer::type() const QgsPointCloudRenderer *QgsPointCloudAttributeByRampRenderer::clone() const { - std::unique_ptr< QgsPointCloudAttributeByRampRenderer > res = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); + auto res = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); res->mAttribute = mAttribute; res->mColorRampShader = mColorRampShader; res->mMin = mMin; @@ -151,7 +151,7 @@ void QgsPointCloudAttributeByRampRenderer::renderBlock( const QgsPointCloudBlock QgsPointCloudRenderer *QgsPointCloudAttributeByRampRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsPointCloudAttributeByRampRenderer > r = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); + auto r = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); r->setAttribute( element.attribute( QStringLiteral( "attribute" ), QStringLiteral( "Intensity" ) ) ); @@ -269,7 +269,7 @@ void QgsPointCloudAttributeByRampRenderer::setMaximum( double value ) std::unique_ptr QgsPointCloudAttributeByRampRenderer::prepare() { - std::unique_ptr< QgsPointCloudAttributeByRampRendererPreparedData> data = std::make_unique< QgsPointCloudAttributeByRampRendererPreparedData >(); + auto data = std::make_unique< QgsPointCloudAttributeByRampRendererPreparedData >(); data->attributeName = mAttribute; data->colorRampShader = mColorRampShader; diff --git a/src/core/pointcloud/qgspointcloudclassifiedrenderer.cpp b/src/core/pointcloud/qgspointcloudclassifiedrenderer.cpp index d64a076e0a49..46703a82960d 100644 --- a/src/core/pointcloud/qgspointcloudclassifiedrenderer.cpp +++ b/src/core/pointcloud/qgspointcloudclassifiedrenderer.cpp @@ -58,7 +58,7 @@ QString QgsPointCloudClassifiedRenderer::type() const QgsPointCloudRenderer *QgsPointCloudClassifiedRenderer::clone() const { - std::unique_ptr< QgsPointCloudClassifiedRenderer > res = std::make_unique< QgsPointCloudClassifiedRenderer >(); + auto res = std::make_unique< QgsPointCloudClassifiedRenderer >(); res->mAttribute = mAttribute; res->mCategories = mCategories; @@ -186,7 +186,7 @@ bool QgsPointCloudClassifiedRenderer::willRenderPoint( const QVariantMap &pointA QgsPointCloudRenderer *QgsPointCloudClassifiedRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsPointCloudClassifiedRenderer > r = std::make_unique< QgsPointCloudClassifiedRenderer >(); + auto r = std::make_unique< QgsPointCloudClassifiedRenderer >(); r->setAttribute( element.attribute( QStringLiteral( "attribute" ), QStringLiteral( "Classification" ) ) ); @@ -353,7 +353,7 @@ void QgsPointCloudClassifiedRenderer::addCategory( const QgsPointCloudCategory & std::unique_ptr QgsPointCloudClassifiedRenderer::prepare() { - std::unique_ptr< QgsPointCloudClassifiedRendererPreparedData > data = std::make_unique< QgsPointCloudClassifiedRendererPreparedData >(); + auto data = std::make_unique< QgsPointCloudClassifiedRendererPreparedData >(); data->attributeName = mAttribute; for ( const QgsPointCloudCategory &category : std::as_const( mCategories ) ) diff --git a/src/core/pointcloud/qgspointclouddataprovider.cpp b/src/core/pointcloud/qgspointclouddataprovider.cpp index 05c1db4be8a9..ddcba70b738a 100644 --- a/src/core/pointcloud/qgspointclouddataprovider.cpp +++ b/src/core/pointcloud/qgspointclouddataprovider.cpp @@ -236,7 +236,7 @@ struct MapIndexedPointCloudNode const QgsPointCloudAttribute::DataType xType = blockAttributes.find( QStringLiteral( "X" ), xOffset )->type(); const QgsPointCloudAttribute::DataType yType = blockAttributes.find( QStringLiteral( "Y" ), yOffset )->type(); const QgsPointCloudAttribute::DataType zType = blockAttributes.find( QStringLiteral( "Z" ), zOffset )->type(); - std::unique_ptr< QgsGeos > extentEngine = std::make_unique< QgsGeos >( mExtentGeometry.constGet() ); + auto extentEngine = std::make_unique< QgsGeos >( mExtentGeometry.constGet() ); extentEngine->prepareGeometry(); std::optional copcTimeFlag = std::nullopt; diff --git a/src/core/pointcloud/qgspointcloudextentrenderer.cpp b/src/core/pointcloud/qgspointcloudextentrenderer.cpp index baec5441c7f7..09f9f2822e33 100644 --- a/src/core/pointcloud/qgspointcloudextentrenderer.cpp +++ b/src/core/pointcloud/qgspointcloudextentrenderer.cpp @@ -44,7 +44,7 @@ QString QgsPointCloudExtentRenderer::type() const QgsPointCloudRenderer *QgsPointCloudExtentRenderer::clone() const { - std::unique_ptr< QgsPointCloudExtentRenderer > res = std::make_unique< QgsPointCloudExtentRenderer >( mFillSymbol ? mFillSymbol->clone() : nullptr ); + auto res = std::make_unique< QgsPointCloudExtentRenderer >( mFillSymbol ? mFillSymbol->clone() : nullptr ); copyCommonProperties( res.get() ); return res.release(); } @@ -56,7 +56,7 @@ void QgsPointCloudExtentRenderer::renderBlock( const QgsPointCloudBlock *, QgsPo QgsPointCloudRenderer *QgsPointCloudExtentRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsPointCloudExtentRenderer > r = std::make_unique< QgsPointCloudExtentRenderer >(); + auto r = std::make_unique< QgsPointCloudExtentRenderer >(); const QDomElement symbolElem = element.firstChildElement( QStringLiteral( "symbol" ) ); if ( !symbolElem.isNull() ) @@ -121,7 +121,7 @@ void QgsPointCloudExtentRenderer::renderExtent( const QgsGeometry &extent, QgsPo QgsFillSymbol *QgsPointCloudExtentRenderer::defaultFillSymbol() { - std::unique_ptr< QgsSimpleLineSymbolLayer > layer = std::make_unique< QgsSimpleLineSymbolLayer >(); + auto layer = std::make_unique< QgsSimpleLineSymbolLayer >(); layer->setColor( QColor( 228, 26, 28 ) ); layer->setWidth( 0.960000 ); layer->setPenStyle( Qt::DotLine ); diff --git a/src/core/pointcloud/qgspointcloudlayerelevationproperties.cpp b/src/core/pointcloud/qgspointcloudlayerelevationproperties.cpp index 1a1dbafa9869..124c89b0c25a 100644 --- a/src/core/pointcloud/qgspointcloudlayerelevationproperties.cpp +++ b/src/core/pointcloud/qgspointcloudlayerelevationproperties.cpp @@ -92,7 +92,7 @@ bool QgsPointCloudLayerElevationProperties::readXml( const QDomElement &element, QgsPointCloudLayerElevationProperties *QgsPointCloudLayerElevationProperties::clone() const { - std::unique_ptr< QgsPointCloudLayerElevationProperties > res = std::make_unique< QgsPointCloudLayerElevationProperties >( nullptr ); + auto res = std::make_unique< QgsPointCloudLayerElevationProperties >( nullptr ); res->copyCommonProperties( this ); res->mMaximumScreenError = mMaximumScreenError; diff --git a/src/core/pointcloud/qgspointcloudrendererregistry.cpp b/src/core/pointcloud/qgspointcloudrendererregistry.cpp index 10f012d1d08d..011de8c5fd66 100644 --- a/src/core/pointcloud/qgspointcloudrendererregistry.cpp +++ b/src/core/pointcloud/qgspointcloudrendererregistry.cpp @@ -109,7 +109,7 @@ QgsPointCloudRenderer *QgsPointCloudRendererRegistry::defaultRenderer( const Qgs //if red/green/blue attributes are present, then default to a RGB renderer if ( attributes.indexOf( QLatin1String( "Red" ) ) >= 0 && attributes.indexOf( QLatin1String( "Green" ) ) >= 0 && attributes.indexOf( QLatin1String( "Blue" ) ) >= 0 ) { - std::unique_ptr< QgsPointCloudRgbRenderer > renderer = std::make_unique< QgsPointCloudRgbRenderer >(); + auto renderer = std::make_unique< QgsPointCloudRgbRenderer >(); // set initial guess for rgb ranges const double redMax = stats.maximum( QStringLiteral( "Red" ) ); @@ -170,13 +170,13 @@ QgsPointCloudRenderer *QgsPointCloudRendererRegistry::defaultRenderer( const Qgs if ( !classes.empty() ) { const QgsPointCloudCategoryList categories = classificationAttributeCategories( layer ); - std::unique_ptr< QgsPointCloudClassifiedRenderer > renderer = std::make_unique< QgsPointCloudClassifiedRenderer >( QLatin1String( "Classification" ), categories ); + auto renderer = std::make_unique< QgsPointCloudClassifiedRenderer >( QLatin1String( "Classification" ), categories ); return renderer.release(); } } // fallback to shading by Z - std::unique_ptr< QgsPointCloudAttributeByRampRenderer > renderer = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); + auto renderer = std::make_unique< QgsPointCloudAttributeByRampRenderer >(); renderer->setAttribute( QStringLiteral( "Z" ) ); // set initial range for z values if possible diff --git a/src/core/pointcloud/qgspointcloudrgbrenderer.cpp b/src/core/pointcloud/qgspointcloudrgbrenderer.cpp index 0196e091d0ea..211faac5df95 100644 --- a/src/core/pointcloud/qgspointcloudrgbrenderer.cpp +++ b/src/core/pointcloud/qgspointcloudrgbrenderer.cpp @@ -31,7 +31,7 @@ QString QgsPointCloudRgbRenderer::type() const QgsPointCloudRenderer *QgsPointCloudRgbRenderer::clone() const { - std::unique_ptr< QgsPointCloudRgbRenderer > res = std::make_unique< QgsPointCloudRgbRenderer >(); + auto res = std::make_unique< QgsPointCloudRgbRenderer >(); res->mRedAttribute = mRedAttribute; res->mGreenAttribute = mGreenAttribute; res->mBlueAttribute = mBlueAttribute; @@ -186,7 +186,7 @@ void QgsPointCloudRgbRenderer::renderBlock( const QgsPointCloudBlock *block, Qgs QgsPointCloudRenderer *QgsPointCloudRgbRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsPointCloudRgbRenderer > r = std::make_unique< QgsPointCloudRgbRenderer >(); + auto r = std::make_unique< QgsPointCloudRgbRenderer >(); r->setRedAttribute( element.attribute( QStringLiteral( "red" ), QStringLiteral( "Red" ) ) ); r->setGreenAttribute( element.attribute( QStringLiteral( "green" ), QStringLiteral( "Green" ) ) ); @@ -269,7 +269,7 @@ QSet QgsPointCloudRgbRenderer::usedAttributes( const QgsPointCloudRende std::unique_ptr QgsPointCloudRgbRenderer::prepare() { - std::unique_ptr< QgsPointCloudRgbRendererPreparedData > data = std::make_unique< QgsPointCloudRgbRendererPreparedData >(); + auto data = std::make_unique< QgsPointCloudRgbRendererPreparedData >(); data->redAttribute = mRedAttribute; if ( mRedContrastEnhancement ) data->redContrastEnhancement.reset( new QgsContrastEnhancement( *mRedContrastEnhancement ) ); diff --git a/src/core/processing/qgsprocessingutils.cpp b/src/core/processing/qgsprocessingutils.cpp index 8cf46a1480a5..a08ca30bb215 100644 --- a/src/core/processing/qgsprocessingutils.cpp +++ b/src/core/processing/qgsprocessingutils.cpp @@ -579,7 +579,7 @@ QgsProcessingFeatureSource *QgsProcessingUtils::variantToSource( const QVariant if ( QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( qvariant_cast( val ) ) ) { - std::unique_ptr< QgsProcessingFeatureSource> source = std::make_unique< QgsProcessingFeatureSource >( layer, context, false, featureLimit, filterExpression ); + auto source = std::make_unique< QgsProcessingFeatureSource >( layer, context, false, featureLimit, filterExpression ); if ( overrideGeometryCheck ) source->setInvalidGeometryCheck( geometryCheck ); return source.release(); @@ -595,7 +595,7 @@ QgsProcessingFeatureSource *QgsProcessingUtils::variantToSource( const QVariant // fall back to default if ( QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( qvariant_cast( fallbackValue ) ) ) { - std::unique_ptr< QgsProcessingFeatureSource> source = std::make_unique< QgsProcessingFeatureSource >( layer, context, false, featureLimit, filterExpression ); + auto source = std::make_unique< QgsProcessingFeatureSource >( layer, context, false, featureLimit, filterExpression ); if ( overrideGeometryCheck ) source->setInvalidGeometryCheck( geometryCheck ); return source.release(); @@ -1044,7 +1044,7 @@ QgsFeatureSink *QgsProcessingUtils::createFeatureSink( QString &destination, Qgs { saveOptions.actionOnExistingFile = QgsVectorFileWriter::AppendToLayerNoNewFields; // sniff destination file to get correct wkb type and crs - std::unique_ptr< QgsVectorLayer > vl = std::make_unique< QgsVectorLayer >( destination ); + auto vl = std::make_unique< QgsVectorLayer >( destination ); if ( vl->isValid() ) { remappingDefinition->setDestinationWkbType( vl->wkbType() ); @@ -1081,7 +1081,7 @@ QgsFeatureSink *QgsProcessingUtils::createFeatureSink( QString &destination, Qgs if ( remappingDefinition ) { - std::unique_ptr< QgsRemappingProxyFeatureSink > remapSink = std::make_unique< QgsRemappingProxyFeatureSink >( *remappingDefinition, writer.release(), true ); + auto remapSink = std::make_unique< QgsRemappingProxyFeatureSink >( *remappingDefinition, writer.release(), true ); remapSink->setExpressionContext( context.expressionContext() ); remapSink->setTransformContext( context.transformContext() ); return new QgsProcessingFeatureSink( remapSink.release(), destination, context, true ); @@ -1104,7 +1104,7 @@ QgsFeatureSink *QgsProcessingUtils::createFeatureSink( QString &destination, Qgs uri = QgsProviderRegistry::instance()->encodeUri( providerKey, parts ); } - std::unique_ptr< QgsVectorLayer > layer = std::make_unique( uri, destination, providerKey, layerOptions ); + auto layer = std::make_unique( uri, destination, providerKey, layerOptions ); // update destination to layer ID destination = layer->id(); if ( layer->isValid() ) @@ -1126,7 +1126,7 @@ QgsFeatureSink *QgsProcessingUtils::createFeatureSink( QString &destination, Qgs } } - std::unique_ptr< QgsRemappingProxyFeatureSink > remapSink = std::make_unique< QgsRemappingProxyFeatureSink >( *remappingDefinition, layer->dataProvider(), false ); + auto remapSink = std::make_unique< QgsRemappingProxyFeatureSink >( *remappingDefinition, layer->dataProvider(), false ); context.temporaryLayerStore()->addMapLayer( layer.release() ); remapSink->setExpressionContext( context.expressionContext() ); remapSink->setTransformContext( context.transformContext() ); @@ -1136,7 +1136,7 @@ QgsFeatureSink *QgsProcessingUtils::createFeatureSink( QString &destination, Qgs else { //create empty layer - std::unique_ptr< QgsVectorLayerExporter > exporter = std::make_unique( uri, providerKey, newFields, geometryType, crs, true, options, sinkFlags ); + auto exporter = std::make_unique( uri, providerKey, newFields, geometryType, crs, true, options, sinkFlags ); if ( exporter->errorCode() != Qgis::VectorExportResult::Success ) { throw QgsProcessingException( QObject::tr( "Could not create layer %1: %2" ).arg( destination, exporter->errorMessage() ) ); @@ -1275,7 +1275,7 @@ QString QgsProcessingUtils::tempFolder( const QgsProcessingContext *context ) if ( sTempFolders.empty() ) { const QString templatePath = QStringLiteral( "%1/processing_XXXXXX" ).arg( QDir::tempPath() ); - std::unique_ptr< QTemporaryDir > tempFolder = std::make_unique< QTemporaryDir >( templatePath ); + auto tempFolder = std::make_unique< QTemporaryDir >( templatePath ); sFolder = tempFolder->path(); sTempFolders.emplace_back( std::move( tempFolder ) ); } @@ -1286,7 +1286,7 @@ QString QgsProcessingUtils::tempFolder( const QgsProcessingContext *context ) QDir().mkpath( basePath ); const QString templatePath = QStringLiteral( "%1/processing_XXXXXX" ).arg( basePath ); - std::unique_ptr< QTemporaryDir > tempFolder = std::make_unique< QTemporaryDir >( templatePath ); + auto tempFolder = std::make_unique< QTemporaryDir >( templatePath ); sFolder = tempFolder->path(); sTempFolders.emplace_back( std::move( tempFolder ) ); } diff --git a/src/core/project/qgsproject.cpp b/src/core/project/qgsproject.cpp index 6741df458ac8..be8e457949d3 100644 --- a/src/core/project/qgsproject.cpp +++ b/src/core/project/qgsproject.cpp @@ -2855,7 +2855,7 @@ QgsExpressionContextScope *QgsProject::createExpressionContextScope() const // MUCH cheaper to clone than build if ( mProjectScope ) { - std::unique_ptr< QgsExpressionContextScope > projectScope = std::make_unique< QgsExpressionContextScope >( *mProjectScope ); + auto projectScope = std::make_unique< QgsExpressionContextScope >( *mProjectScope ); // we can't cache these variables projectScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_distance_units" ), QgsUnitTypes::toString( distanceUnits() ), true, true ) ); diff --git a/src/core/providers/arcgis/qgsarcgisrestutils.cpp b/src/core/providers/arcgis/qgsarcgisrestutils.cpp index e529dbb09848..c6c297953e05 100644 --- a/src/core/providers/arcgis/qgsarcgisrestutils.cpp +++ b/src/core/providers/arcgis/qgsarcgisrestutils.cpp @@ -164,7 +164,7 @@ std::unique_ptr< QgsCircularString > QgsArcGisRestUtils::convertCircularString( points << *interiorPoint; points << *endPoint; } - std::unique_ptr< QgsCircularString > curve = std::make_unique< QgsCircularString> (); + auto curve = std::make_unique< QgsCircularString> (); curve->setPoints( points ); return curve; } @@ -172,7 +172,7 @@ std::unique_ptr< QgsCircularString > QgsArcGisRestUtils::convertCircularString( std::unique_ptr< QgsCompoundCurve > QgsArcGisRestUtils::convertCompoundCurve( const QVariantList &curvesList, Qgis::WkbType pointType ) { // [[6,3],[5,3],{"b":[[3,2],[6,1],[2,4]]},[1,2],{"c": [[3,3],[1,4]]}] - std::unique_ptr< QgsCompoundCurve > compoundCurve = std::make_unique< QgsCompoundCurve >(); + auto compoundCurve = std::make_unique< QgsCompoundCurve >(); QVector< double > lineX; QVector< double > lineY; @@ -330,7 +330,7 @@ std::unique_ptr< QgsMultiPoint > QgsArcGisRestUtils::convertMultiPoint( const QV // {"points" : [[ , , , ] , [ , , , ], ... ]} const QVariantList coordsList = geometryData[QStringLiteral( "points" )].toList(); - std::unique_ptr< QgsMultiPoint > multiPoint = std::make_unique< QgsMultiPoint >(); + auto multiPoint = std::make_unique< QgsMultiPoint >(); multiPoint->reserve( coordsList.size() ); for ( const QVariant &coordData : coordsList ) { @@ -367,7 +367,7 @@ std::unique_ptr< QgsMultiCurve > QgsArcGisRestUtils::convertGeometryPolyline( co pathsList = geometryData[QStringLiteral( "curvePaths" )].toList(); if ( pathsList.isEmpty() ) return nullptr; - std::unique_ptr< QgsMultiCurve > multiCurve = std::make_unique< QgsMultiCurve >(); + auto multiCurve = std::make_unique< QgsMultiCurve >(); multiCurve->reserve( pathsList.size() ); for ( const QVariant &pathData : std::as_const( pathsList ) ) { @@ -405,11 +405,11 @@ std::unique_ptr< QgsMultiSurface > QgsArcGisRestUtils::convertGeometryPolygon( c if ( curves.count() == 0 ) return nullptr; - std::unique_ptr< QgsMultiSurface > result = std::make_unique< QgsMultiSurface >(); + auto result = std::make_unique< QgsMultiSurface >(); if ( curves.count() == 1 ) { // shortcut for exterior ring only - std::unique_ptr< QgsCurvePolygon > newPolygon = std::make_unique< QgsCurvePolygon >(); + auto newPolygon = std::make_unique< QgsCurvePolygon >(); newPolygon->setExteriorRing( curves.takeAt( 0 ) ); result->addGeometry( newPolygon.release() ); return result; @@ -460,13 +460,13 @@ std::unique_ptr< QgsPolygon > QgsArcGisRestUtils::convertEnvelope( const QVarian double ymax = geometryData[QStringLiteral( "ymax" )].toDouble( &ymaxOk ); if ( !xminOk || !yminOk || !xmaxOk || !ymaxOk ) return nullptr; - std::unique_ptr< QgsLineString > ext = std::make_unique< QgsLineString> (); + auto ext = std::make_unique< QgsLineString> (); ext->addVertex( QgsPoint( xmin, ymin ) ); ext->addVertex( QgsPoint( xmax, ymin ) ); ext->addVertex( QgsPoint( xmax, ymax ) ); ext->addVertex( QgsPoint( xmin, ymax ) ); ext->addVertex( QgsPoint( xmin, ymin ) ); - std::unique_ptr< QgsPolygon > poly = std::make_unique< QgsPolygon >(); + auto poly = std::make_unique< QgsPolygon >(); poly->setExteriorRing( ext.release() ); return poly; } @@ -591,11 +591,11 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriLineSymbolJson( cons QgsSymbolLayerList layers; Qt::PenStyle penStyle = convertLineStyle( symbolData.value( QStringLiteral( "style" ) ).toString() ); - std::unique_ptr< QgsSimpleLineSymbolLayer > lineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( lineColor, widthInPoints, penStyle ); + auto lineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( lineColor, widthInPoints, penStyle ); lineLayer->setWidthUnit( Qgis::RenderUnit::Points ); layers.append( lineLayer.release() ); - std::unique_ptr< QgsLineSymbol > symbol = std::make_unique< QgsLineSymbol >( layers ); + auto symbol = std::make_unique< QgsLineSymbol >( layers ); return symbol; } @@ -611,11 +611,11 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriFillSymbolJson( cons double penWidthInPoints = outlineData.value( QStringLiteral( "width" ) ).toDouble( &ok ); QgsSymbolLayerList layers; - std::unique_ptr< QgsSimpleFillSymbolLayer > fillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( fillColor, brushStyle, lineColor, penStyle, penWidthInPoints ); + auto fillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( fillColor, brushStyle, lineColor, penStyle, penWidthInPoints ); fillLayer->setStrokeWidthUnit( Qgis::RenderUnit::Points ); layers.append( fillLayer.release() ); - std::unique_ptr< QgsFillSymbol > symbol = std::make_unique< QgsFillSymbol >( layers ); + auto symbol = std::make_unique< QgsFillSymbol >( layers ); return symbol; } @@ -643,7 +643,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriPictureFillSymbolJso symbolPath.prepend( QLatin1String( "base64:" ) ); QgsSymbolLayerList layers; - std::unique_ptr< QgsRasterFillSymbolLayer > fillLayer = std::make_unique< QgsRasterFillSymbolLayer >( symbolPath ); + auto fillLayer = std::make_unique< QgsRasterFillSymbolLayer >( symbolPath ); fillLayer->setWidth( widthInPixels ); fillLayer->setAngle( angleCW ); fillLayer->setSizeUnit( Qgis::RenderUnit::Points ); @@ -656,11 +656,11 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriPictureFillSymbolJso Qt::PenStyle penStyle = convertLineStyle( outlineData.value( QStringLiteral( "style" ) ).toString() ); double penWidthInPoints = outlineData.value( QStringLiteral( "width" ) ).toDouble( &ok ); - std::unique_ptr< QgsSimpleLineSymbolLayer > lineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( lineColor, penWidthInPoints, penStyle ); + auto lineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( lineColor, penWidthInPoints, penStyle ); lineLayer->setWidthUnit( Qgis::RenderUnit::Points ); layers.append( lineLayer.release() ); - std::unique_ptr< QgsFillSymbol > symbol = std::make_unique< QgsFillSymbol >( layers ); + auto symbol = std::make_unique< QgsFillSymbol >( layers ); return symbol; } @@ -705,7 +705,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriMarkerSymbolJson( double penWidthInPoints = outlineData.value( QStringLiteral( "width" ) ).toDouble( &ok ); QgsSymbolLayerList layers; - std::unique_ptr< QgsSimpleMarkerSymbolLayer > markerLayer = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, sizeInPoints, angleCW, Qgis::ScaleMethod::ScaleArea, fillColor, lineColor ); + auto markerLayer = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, sizeInPoints, angleCW, Qgis::ScaleMethod::ScaleArea, fillColor, lineColor ); markerLayer->setSizeUnit( Qgis::RenderUnit::Points ); markerLayer->setStrokeWidthUnit( Qgis::RenderUnit::Points ); markerLayer->setStrokeStyle( penStyle ); @@ -714,7 +714,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriMarkerSymbolJson( markerLayer->setOffsetUnit( Qgis::RenderUnit::Points ); layers.append( markerLayer.release() ); - std::unique_ptr< QgsMarkerSymbol > symbol = std::make_unique< QgsMarkerSymbol >( layers ); + auto symbol = std::make_unique< QgsMarkerSymbol >( layers ); return symbol; } @@ -742,7 +742,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriPictureMarkerSymbo symbolPath.prepend( QLatin1String( "base64:" ) ); QgsSymbolLayerList layers; - std::unique_ptr< QgsRasterMarkerSymbolLayer > markerLayer = std::make_unique< QgsRasterMarkerSymbolLayer >( symbolPath, widthInPixels, angleCW, Qgis::ScaleMethod::ScaleArea ); + auto markerLayer = std::make_unique< QgsRasterMarkerSymbolLayer >( symbolPath, widthInPixels, angleCW, Qgis::ScaleMethod::ScaleArea ); markerLayer->setSizeUnit( Qgis::RenderUnit::Points ); // only change the default aspect ratio if the server height setting requires this @@ -753,7 +753,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriPictureMarkerSymbo markerLayer->setOffsetUnit( Qgis::RenderUnit::Points ); layers.append( markerLayer.release() ); - std::unique_ptr< QgsMarkerSymbol > symbol = std::make_unique< QgsMarkerSymbol >( layers ); + auto symbol = std::make_unique< QgsMarkerSymbol >( layers ); return symbol; } @@ -773,7 +773,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriTextMarkerSymbolJs const double angle = 90.0 - esriAngle; - std::unique_ptr< QgsFontMarkerSymbolLayer > markerLayer = std::make_unique< QgsFontMarkerSymbolLayer >( fontFamily, chr, pointSize, color, angle ); + auto markerLayer = std::make_unique< QgsFontMarkerSymbolLayer >( fontFamily, chr, pointSize, color, angle ); QColor strokeColor = convertColor( symbolData.value( QStringLiteral( "borderLineColor" ) ) ); markerLayer->setStrokeColor( strokeColor ); @@ -830,7 +830,7 @@ std::unique_ptr QgsArcGisRestUtils::parseEsriTextMarkerSymbolJs layers.append( markerLayer.release() ); - std::unique_ptr< QgsMarkerSymbol > symbol = std::make_unique< QgsMarkerSymbol >( layers ); + auto symbol = std::make_unique< QgsMarkerSymbol >( layers ); return symbol; } @@ -1094,9 +1094,9 @@ QgsFeatureRenderer *QgsArcGisRestUtils::convertRenderer( const QVariantMap &rend gradientStops.append( QgsGradientStop( scaledBreakpoint, fillColor ) ); } - std::unique_ptr< QgsGradientColorRamp > colorRamp = std::make_unique< QgsGradientColorRamp >( - minColor, maxColor, false, gradientStops - ); + auto colorRamp = std::make_unique< QgsGradientColorRamp >( + minColor, maxColor, false, gradientStops + ); QgsProperty colorProperty = QgsProperty::fromField( attrName ); colorProperty.setTransformer( @@ -1107,7 +1107,7 @@ QgsFeatureRenderer *QgsArcGisRestUtils::convertRenderer( const QVariantMap &rend symbol->symbolLayer( layer )->setDataDefinedProperty( QgsSymbolLayer::Property::FillColor, colorProperty ); } - std::unique_ptr< QgsSingleSymbolRenderer > singleSymbolRenderer = std::make_unique< QgsSingleSymbolRenderer >( symbol.release() ); + auto singleSymbolRenderer = std::make_unique< QgsSingleSymbolRenderer >( symbol.release() ); return singleSymbolRenderer.release(); } @@ -1119,7 +1119,7 @@ QgsFeatureRenderer *QgsArcGisRestUtils::convertRenderer( const QVariantMap &rend double lastValue = rendererData.value( QStringLiteral( "minValue" ) ).toDouble(); - std::unique_ptr< QgsGraduatedSymbolRenderer > graduatedRenderer = std::make_unique< QgsGraduatedSymbolRenderer >( attrName ); + auto graduatedRenderer = std::make_unique< QgsGraduatedSymbolRenderer >( attrName ); graduatedRenderer->setSourceSymbol( symbol.release() ); diff --git a/src/core/providers/gdal/qgsgdalprovider.cpp b/src/core/providers/gdal/qgsgdalprovider.cpp index 0d680459e6f7..4eb7e1d25558 100644 --- a/src/core/providers/gdal/qgsgdalprovider.cpp +++ b/src/core/providers/gdal/qgsgdalprovider.cpp @@ -665,7 +665,7 @@ QString QgsGdalProvider::bandDescription( int bandNumber ) QgsRasterBlock *QgsGdalProvider::block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback ) { - std::unique_ptr< QgsRasterBlock > block = std::make_unique< QgsRasterBlock >( dataType( bandNo ), width, height ); + auto block = std::make_unique< QgsRasterBlock >( dataType( bandNo ), width, height ); if ( !initIfNeeded() ) return block.release(); if ( sourceHasNoDataValue( bandNo ) && useSourceNoDataValue( bandNo ) ) @@ -3427,7 +3427,7 @@ bool QgsGdalProvider::readNativeAttributeTable( QString *errorMessage ) usages.append( usage ); } - std::unique_ptr rat = std::make_unique(); + auto rat = std::make_unique(); for ( const auto &field : std::as_const( ratFields ) ) { @@ -3467,7 +3467,7 @@ bool QgsGdalProvider::readNativeAttributeTable( QString *errorMessage ) // Try to cope with invalid rats due to generic fields if ( ! rat->isValid( ) ) { - std::unique_ptr ratCopy = std::make_unique( *rat ); + auto ratCopy = std::make_unique( *rat ); bool changed { false }; for ( int fieldIdx = 0; fieldIdx < ratCopy->fields().count( ); ++fieldIdx ) { diff --git a/src/core/providers/ogr/qgsgeopackagedataitems.cpp b/src/core/providers/ogr/qgsgeopackagedataitems.cpp index 8069d2a910b3..ae97519d04b0 100644 --- a/src/core/providers/ogr/qgsgeopackagedataitems.cpp +++ b/src/core/providers/ogr/qgsgeopackagedataitems.cpp @@ -186,7 +186,7 @@ QVector QgsGeoPackageCollectionItem::createChildren() if ( !fieldDomains.empty() || !domainError.isEmpty() ) { - std::unique_ptr< QgsFieldDomainsItem > domainsItem = std::make_unique< QgsFieldDomainsItem >( this, mPath + "/domains", path, QStringLiteral( "ogr" ) ); + auto domainsItem = std::make_unique< QgsFieldDomainsItem >( this, mPath + "/domains", path, QStringLiteral( "ogr" ) ); // force this item to appear last by setting a maximum string value for the sort key domainsItem->setSortKey( QString( QChar( 0x10FFFF ) ) ); children.append( domainsItem.release() ); @@ -207,7 +207,7 @@ QVector QgsGeoPackageCollectionItem::createChildren() if ( !relations.empty() || !relationError.isEmpty() ) { - std::unique_ptr< QgsRelationshipsItem > relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ) ); + auto relationsItem = std::make_unique< QgsRelationshipsItem >( this, mPath + "/relations", conn->uri(), QStringLiteral( "ogr" ) ); // force this item to appear last by setting a maximum string value for the sort key relationsItem->setSortKey( QString( QChar( 0x11FFFF ) ) ); children.append( relationsItem.release() ); diff --git a/src/core/providers/qgsprovidersublayermodel.cpp b/src/core/providers/qgsprovidersublayermodel.cpp index d0f52921faf3..e4d8f21ec906 100644 --- a/src/core/providers/qgsprovidersublayermodel.cpp +++ b/src/core/providers/qgsprovidersublayermodel.cpp @@ -46,7 +46,7 @@ void QgsProviderSublayerModelGroup::populateFromSublayers( const QListfindGroup( currentPath.constLast() ); if ( !nextChild ) { - std::unique_ptr< QgsProviderSublayerModelGroup > newNode = std::make_unique< QgsProviderSublayerModelGroup >( currentPath.constLast() ); + auto newNode = std::make_unique< QgsProviderSublayerModelGroup >( currentPath.constLast() ); groupNode = qgis::down_cast< QgsProviderSublayerModelGroup * >( groupNode->addChild( std::move( newNode ) ) ); } else diff --git a/src/core/qgsabstractgeopdfexporter.cpp b/src/core/qgsabstractgeopdfexporter.cpp index 356c09e922f4..e3df354380a9 100644 --- a/src/core/qgsabstractgeopdfexporter.cpp +++ b/src/core/qgsabstractgeopdfexporter.cpp @@ -408,7 +408,7 @@ QString QgsAbstractGeospatialPdfExporter::createCompositionXml( const QList std::unique_ptr< TreeNode > { - std::unique_ptr< TreeNode > group = std::make_unique< TreeNode >(); + auto group = std::make_unique< TreeNode >(); const QString id = QUuid::createUuid().toString(); group->id = id; groupNameToTreeNode[ groupName ] = group.get(); @@ -426,7 +426,7 @@ QString QgsAbstractGeospatialPdfExporter::createCompositionXml( const QList layer = std::make_unique< TreeNode >(); + auto layer = std::make_unique< TreeNode >(); layer->id = destinationGroup.isEmpty() ? component.mapLayerId : QStringLiteral( "%1_%2" ).arg( destinationGroup, component.mapLayerId ); layer->name = details.layerIdToPdfLayerTreeNameMap.contains( component.mapLayerId ) ? details.layerIdToPdfLayerTreeNameMap.value( component.mapLayerId ) : component.name; layer->initiallyVisible = details.initialLayerVisibility.value( component.mapLayerId, true ); diff --git a/src/core/qgsdatadefinedsizelegend.cpp b/src/core/qgsdatadefinedsizelegend.cpp index c8b2119a6d8e..38e0731356bf 100644 --- a/src/core/qgsdatadefinedsizelegend.cpp +++ b/src/core/qgsdatadefinedsizelegend.cpp @@ -30,7 +30,7 @@ QgsDataDefinedSizeLegend::QgsDataDefinedSizeLegend() { - std::unique_ptr< QgsSimpleLineSymbolLayer > lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 0, 0, 0 ), 0.2 ); + auto lineSymbolLayer = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 0, 0, 0 ), 0.2 ); mLineSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << lineSymbolLayer.release() ); } diff --git a/src/core/qgsdiagramrenderer.cpp b/src/core/qgsdiagramrenderer.cpp index 962fe477df4a..0b7db64f6fcf 100644 --- a/src/core/qgsdiagramrenderer.cpp +++ b/src/core/qgsdiagramrenderer.cpp @@ -1124,19 +1124,19 @@ void QgsStackedDiagramRenderer::_readXmlSubRenderers( const QDomElement &elem, c if ( subRendererElem.nodeName() == QLatin1String( "SingleCategoryDiagramRenderer" ) ) { - std::unique_ptr< QgsSingleCategoryDiagramRenderer > singleCatDiagramRenderer = std::make_unique< QgsSingleCategoryDiagramRenderer >(); + auto singleCatDiagramRenderer = std::make_unique< QgsSingleCategoryDiagramRenderer >(); singleCatDiagramRenderer->readXml( subRendererElem, context ); addRenderer( singleCatDiagramRenderer.release() ); } else if ( subRendererElem.nodeName() == QLatin1String( "LinearlyInterpolatedDiagramRenderer" ) ) { - std::unique_ptr< QgsLinearlyInterpolatedDiagramRenderer > linearDiagramRenderer = std::make_unique< QgsLinearlyInterpolatedDiagramRenderer >(); + auto linearDiagramRenderer = std::make_unique< QgsLinearlyInterpolatedDiagramRenderer >(); linearDiagramRenderer->readXml( subRendererElem, context ); addRenderer( linearDiagramRenderer.release() ); } else if ( subRendererElem.nodeName() == QLatin1String( "StackedDiagramRenderer" ) ) { - std::unique_ptr< QgsStackedDiagramRenderer > stackedDiagramRenderer = std::make_unique< QgsStackedDiagramRenderer >(); + auto stackedDiagramRenderer = std::make_unique< QgsStackedDiagramRenderer >(); stackedDiagramRenderer->readXml( subRendererElem, context ); addRenderer( stackedDiagramRenderer.release() ); } diff --git a/src/core/qgsdistancearea.cpp b/src/core/qgsdistancearea.cpp index fbcb6bc4b734..18a9816e27b5 100644 --- a/src/core/qgsdistancearea.cpp +++ b/src/core/qgsdistancearea.cpp @@ -542,7 +542,7 @@ QgsGeometry QgsDistanceArea::splitGeometryAtAntimeridian( const QgsGeometry &geo if ( QgsWkbTypes::isCurvedType( g.wkbType() ) ) g.convertToStraightSegment(); - std::unique_ptr< QgsMultiLineString > res = std::make_unique< QgsMultiLineString >(); + auto res = std::make_unique< QgsMultiLineString >(); for ( auto part = g.const_parts_begin(); part != g.const_parts_end(); ++part ) { const QgsLineString *line = qgsgeometry_cast< const QgsLineString * >( *part ); diff --git a/src/core/qgsfeatureiterator.h b/src/core/qgsfeatureiterator.h index b1f0a2c9b443..9a74049f6878 100644 --- a/src/core/qgsfeatureiterator.h +++ b/src/core/qgsfeatureiterator.h @@ -298,7 +298,7 @@ class CORE_EXPORT QgsFeatureIterator SIP_PYOBJECT __next__() SIP_TYPEHINT( QgsFeature ); % MethodCode - std::unique_ptr< QgsFeature > f = std::make_unique< QgsFeature >(); + auto f = std::make_unique< QgsFeature >(); bool result = false; Py_BEGIN_ALLOW_THREADS result = ( sipCpp->nextFeature( *f ) ); diff --git a/src/core/qgsgrouplayer.cpp b/src/core/qgsgrouplayer.cpp index b4deb13e49c0..63fa36496c43 100644 --- a/src/core/qgsgrouplayer.cpp +++ b/src/core/qgsgrouplayer.cpp @@ -54,7 +54,7 @@ QgsGroupLayer *QgsGroupLayer::clone() const QGIS_PROTECT_QOBJECT_THREAD_ACCESS const QgsGroupLayer::LayerOptions options( mTransformContext ); - std::unique_ptr< QgsGroupLayer > layer = std::make_unique< QgsGroupLayer >( name(), options ); + auto layer = std::make_unique< QgsGroupLayer >( name(), options ); QgsMapLayer::clone( layer.get() ); layer->setChildLayers( _qgis_listRefToRaw( mChildren ) ); layer->setPaintEffect( mPaintEffect ? mPaintEffect->clone() : nullptr ); diff --git a/src/core/qgsjsonutils.cpp b/src/core/qgsjsonutils.cpp index d906148189e1..2377dc9a0f4d 100644 --- a/src/core/qgsjsonutils.cpp +++ b/src/core/qgsjsonutils.cpp @@ -503,7 +503,7 @@ std::unique_ptr< QgsPolygon > parsePolygonFromGeoJson( const json &coords ) return nullptr; } - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >( exterior.release() ); + auto polygon = std::make_unique< QgsPolygon >( exterior.release() ); for ( std::size_t i = 1; i < coordsSize; ++i ) { std::unique_ptr< QgsLineString > ring = parseLineStringFromGeoJson( coords[i] ); @@ -558,7 +558,7 @@ std::unique_ptr< QgsAbstractGeometry > parseGeometryFromGeoJson( const json &geo return nullptr; } - std::unique_ptr< QgsMultiPoint > multiPoint = std::make_unique< QgsMultiPoint >(); + auto multiPoint = std::make_unique< QgsMultiPoint >(); multiPoint->reserve( static_cast< int >( coords.size() ) ); for ( const auto &pointCoords : coords ) { @@ -599,7 +599,7 @@ std::unique_ptr< QgsAbstractGeometry > parseGeometryFromGeoJson( const json &geo return nullptr; } - std::unique_ptr< QgsMultiLineString > multiLineString = std::make_unique< QgsMultiLineString >(); + auto multiLineString = std::make_unique< QgsMultiLineString >(); multiLineString->reserve( static_cast< int >( coords.size() ) ); for ( const auto &lineCoords : coords ) { @@ -646,7 +646,7 @@ std::unique_ptr< QgsAbstractGeometry > parseGeometryFromGeoJson( const json &geo return nullptr; } - std::unique_ptr< QgsMultiPolygon > multiPolygon = std::make_unique< QgsMultiPolygon >(); + auto multiPolygon = std::make_unique< QgsMultiPolygon >(); multiPolygon->reserve( static_cast< int >( coords.size() ) ); for ( const auto &polygonCoords : coords ) { @@ -676,7 +676,7 @@ std::unique_ptr< QgsAbstractGeometry > parseGeometryFromGeoJson( const json &geo return nullptr; } - std::unique_ptr< QgsGeometryCollection > collection = std::make_unique< QgsGeometryCollection >(); + auto collection = std::make_unique< QgsGeometryCollection >(); collection->reserve( static_cast< int >( geometries.size() ) ); for ( const auto &geometry : geometries ) { diff --git a/src/core/qgslocaldefaultsettings.cpp b/src/core/qgslocaldefaultsettings.cpp index 70244780d882..044904909b2c 100644 --- a/src/core/qgslocaldefaultsettings.cpp +++ b/src/core/qgslocaldefaultsettings.cpp @@ -48,7 +48,7 @@ QgsBearingNumericFormat *QgsLocalDefaultSettings::bearingFormat() } s.endGroup(); - std::unique_ptr< QgsBearingNumericFormat > res = std::make_unique< QgsBearingNumericFormat >(); + auto res = std::make_unique< QgsBearingNumericFormat >(); res->setConfiguration( config, QgsReadWriteContext() ); return res.release(); } @@ -79,7 +79,7 @@ QgsGeographicCoordinateNumericFormat *QgsLocalDefaultSettings::geographicCoordin } s.endGroup(); - std::unique_ptr< QgsGeographicCoordinateNumericFormat > res = std::make_unique< QgsGeographicCoordinateNumericFormat >(); + auto res = std::make_unique< QgsGeographicCoordinateNumericFormat >(); res->setConfiguration( config, QgsReadWriteContext() ); return res.release(); } diff --git a/src/core/qgsmaphittest.cpp b/src/core/qgsmaphittest.cpp index c6a9ccc53c08..d14ca02ac164 100644 --- a/src/core/qgsmaphittest.cpp +++ b/src/core/qgsmaphittest.cpp @@ -89,7 +89,7 @@ void QgsMapHitTest::run() if ( mapSettings.layerStyleOverrides().contains( vl->id() ) ) styleOverride.setOverrideStyle( mapSettings.layerStyleOverrides().value( vl->id() ) ); - std::unique_ptr< QgsVectorLayerFeatureSource > source = std::make_unique< QgsVectorLayerFeatureSource >( vl ); + auto source = std::make_unique< QgsVectorLayerFeatureSource >( vl ); runHitTestFeatureSource( source.get(), vl->id(), vl->fields(), vl->renderer(), usedSymbols, usedSymbolsRuleKey, context, @@ -367,7 +367,7 @@ bool QgsMapHitTestTask::run() mFeedback = std::make_unique< QgsFeedback >(); connect( mFeedback.get(), &QgsFeedback::progressChanged, this, &QgsTask::progressChanged ); - std::unique_ptr< QgsMapHitTest > hitTest = std::make_unique< QgsMapHitTest >( mSettings ); + auto hitTest = std::make_unique< QgsMapHitTest >( mSettings ); // TODO: do we need this temp image? const QgsMapSettings &mapSettings = mSettings.mapSettings(); diff --git a/src/core/qgsmaplayermodel.cpp b/src/core/qgsmaplayermodel.cpp index b59a002c985e..5c3c82b6a76b 100644 --- a/src/core/qgsmaplayermodel.cpp +++ b/src/core/qgsmaplayermodel.cpp @@ -515,7 +515,7 @@ bool QgsMapLayerModel::canDropMimeData( const QMimeData *data, Qt::DropAction ac QMimeData *QgsMapLayerModel::mimeData( const QModelIndexList &indexes ) const { - std::unique_ptr< QMimeData > mimeData = std::make_unique< QMimeData >(); + auto mimeData = std::make_unique< QMimeData >(); QByteArray encodedData; QDataStream stream( &encodedData, QIODevice::WriteOnly ); diff --git a/src/core/qgsmaptopixelgeometrysimplifier.cpp b/src/core/qgsmaptopixelgeometrysimplifier.cpp index 1502ea4f4001..d948b4710921 100644 --- a/src/core/qgsmaptopixelgeometrysimplifier.cpp +++ b/src/core/qgsmaptopixelgeometrysimplifier.cpp @@ -94,22 +94,22 @@ static std::unique_ptr< QgsAbstractGeometry > generalizeWkbGeometryByBoundingBox } else { - std::unique_ptr< QgsLineString > ext = std::make_unique< QgsLineString >( - QVector< double >() << x1 - << x2 - << x2 - << x1 - << x1, - QVector< double >() << y1 - << y1 - << y2 - << y2 - << y1 ); + auto ext = std::make_unique< QgsLineString >( + QVector< double >() << x1 + << x2 + << x2 + << x1 + << x1, + QVector< double >() << y1 + << y1 + << y2 + << y2 + << y1 ); if ( geometryType == Qgis::WkbType::LineString ) return std::move( ext ); else { - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); polygon->setExteriorRing( ext.release() ); return std::move( polygon ); } diff --git a/src/core/qgsogrutils.cpp b/src/core/qgsogrutils.cpp index cbe55dd209f7..e376b8a2432d 100644 --- a/src/core/qgsogrutils.cpp +++ b/src/core/qgsogrutils.cpp @@ -235,7 +235,7 @@ int QgsOgrUtils::OGRTZFlagFromQt( const QDateTime &datetime ) std::unique_ptr< OGRField > QgsOgrUtils::variantToOGRField( const QVariant &value, OGRFieldType type ) { - std::unique_ptr< OGRField > res = std::make_unique< OGRField >(); + auto res = std::make_unique< OGRField >(); switch ( value.userType() ) { @@ -788,7 +788,7 @@ std::unique_ptr< QgsPoint > ogrGeometryToQgsPoint( OGRGeometryH geom ) std::unique_ptr< QgsMultiPoint > ogrGeometryToQgsMultiPoint( OGRGeometryH geom ) { - std::unique_ptr< QgsMultiPoint > mp = std::make_unique< QgsMultiPoint >(); + auto mp = std::make_unique< QgsMultiPoint >(); const int count = OGR_G_GetGeometryCount( geom ); mp->reserve( count ); @@ -828,7 +828,7 @@ std::unique_ptr< QgsLineString > ogrGeometryToQgsLineString( OGRGeometryH geom ) std::unique_ptr< QgsMultiLineString > ogrGeometryToQgsMultiLineString( OGRGeometryH geom ) { - std::unique_ptr< QgsMultiLineString > mp = std::make_unique< QgsMultiLineString >(); + auto mp = std::make_unique< QgsMultiLineString >(); const int count = OGR_G_GetGeometryCount( geom ); mp->reserve( count ); @@ -842,7 +842,7 @@ std::unique_ptr< QgsMultiLineString > ogrGeometryToQgsMultiLineString( OGRGeomet std::unique_ptr< QgsPolygon > ogrGeometryToQgsPolygon( OGRGeometryH geom ) { - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); const int count = OGR_G_GetGeometryCount( geom ); if ( count >= 1 ) @@ -860,7 +860,7 @@ std::unique_ptr< QgsPolygon > ogrGeometryToQgsPolygon( OGRGeometryH geom ) std::unique_ptr< QgsMultiPolygon > ogrGeometryToQgsMultiPolygon( OGRGeometryH geom ) { - std::unique_ptr< QgsMultiPolygon > polygon = std::make_unique< QgsMultiPolygon >(); + auto polygon = std::make_unique< QgsMultiPolygon >(); const int count = OGR_G_GetGeometryCount( geom ); polygon->reserve( count ); @@ -1398,7 +1398,7 @@ std::unique_ptr QgsOgrUtils::symbolFromStyleString( const QString &st return res; } - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( color, lineWidth ); + auto simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( color, lineWidth ); simpleLine->setWidthUnit( lineWidthUnit ); // pattern @@ -1543,13 +1543,13 @@ std::unique_ptr QgsOgrUtils::symbolFromStyleString( const QString &st QgsSymbolLayerList layers; if ( backColor.isValid() && style != Qt::SolidPattern && style != Qt::NoBrush ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > backgroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( backColor ); + auto backgroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( backColor ); backgroundFill->setLocked( true ); backgroundFill->setStrokeStyle( Qt::NoPen ); layers << backgroundFill.release(); } - std::unique_ptr< QgsSimpleFillSymbolLayer > foregroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( foreColor ); + auto foregroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( foreColor ); foregroundFill->setBrushStyle( style ); foregroundFill->setStrokeStyle( Qt::NoPen ); @@ -1617,7 +1617,7 @@ std::unique_ptr QgsOgrUtils::symbolFromStyleString( const QString &st if ( familyFound ) { - std::unique_ptr< QgsFontMarkerSymbolLayer > fontMarker = std::make_unique< QgsFontMarkerSymbolLayer >( fontFamily, QChar( symId ), symbolSize ); + auto fontMarker = std::make_unique< QgsFontMarkerSymbolLayer >( fontFamily, QChar( symId ), symbolSize ); fontMarker->setSizeUnit( symbolSizeUnit ); fontMarker->setAngle( -angle ); @@ -1716,7 +1716,7 @@ std::unique_ptr QgsOgrUtils::symbolFromStyleString( const QString &st shape = Qgis::MarkerShape::Square; // to initialize the variable } - std::unique_ptr< QgsSimpleMarkerSymbolLayer > simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, symbolSize, -angle ); + auto simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, symbolSize, -angle ); simpleMarker->setSizeUnit( symbolSizeUnit ); simpleMarker->setStrokeWidth( 1.0 ); simpleMarker->setStrokeWidthUnit( Qgis::RenderUnit::Points ); @@ -1780,7 +1780,7 @@ std::unique_ptr QgsOgrUtils::symbolFromStyleString( const QString &st } else { - std::unique_ptr< QgsSimpleFillSymbolLayer > emptyFill = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto emptyFill = std::make_unique< QgsSimpleFillSymbolLayer >(); emptyFill->setBrushStyle( Qt::NoBrush ); fillSymbol = std::make_unique< QgsFillSymbol >( QgsSymbolLayerList() << emptyFill.release() ); } diff --git a/src/core/qgsrunprocess.cpp b/src/core/qgsrunprocess.cpp index c75e1b56aee1..0f2d6b11cbb7 100644 --- a/src/core/qgsrunprocess.cpp +++ b/src/core/qgsrunprocess.cpp @@ -280,7 +280,7 @@ int QgsBlockingProcess::run( QgsFeedback *feedback ) if ( requestMadeFromMainThread ) { - std::unique_ptr processThread = std::make_unique( runFunction ); + auto processThread = std::make_unique( runFunction ); processThread->start(); // wait for thread to gracefully exit processThread->wait(); diff --git a/src/core/qgsruntimeprofiler.cpp b/src/core/qgsruntimeprofiler.cpp index 7ad523b8993d..b7a2198b7ab7 100644 --- a/src/core/qgsruntimeprofiler.cpp +++ b/src/core/qgsruntimeprofiler.cpp @@ -215,7 +215,7 @@ QStringList QgsRuntimeProfiler::childGroups( const QString &parent, const QStrin void QgsRuntimeProfiler::start( const QString &name, const QString &group, const QString &id ) { - std::unique_ptr< QgsRuntimeProfilerNode > node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); + auto node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); node->start(); QgsRuntimeProfilerNode *child = node.get(); @@ -273,7 +273,7 @@ void QgsRuntimeProfiler::end( const QString &group ) void QgsRuntimeProfiler::record( const QString &name, double time, const QString &group, const QString &id ) { - std::unique_ptr< QgsRuntimeProfilerNode > node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); + auto node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); QgsRuntimeProfilerNode *child = node.get(); if ( !mCurrentStack[ group ].empty() ) @@ -465,7 +465,7 @@ void QgsRuntimeProfiler::otherProfilerStarted( const QString &group, const QStri if ( !child ) { - std::unique_ptr< QgsRuntimeProfilerNode > newChild = std::make_unique< QgsRuntimeProfilerNode >( group, part ); + auto newChild = std::make_unique< QgsRuntimeProfilerNode >( group, part ); const QModelIndex parentIndex = node2index( parentNode ); beginInsertRows( parentIndex, parentNode->childCount(), parentNode->childCount() ); @@ -507,7 +507,7 @@ void QgsRuntimeProfiler::otherProfilerEnded( const QString &group, const QString if ( !child ) { - std::unique_ptr< QgsRuntimeProfilerNode > newChild = std::make_unique< QgsRuntimeProfilerNode >( group, part ); + auto newChild = std::make_unique< QgsRuntimeProfilerNode >( group, part ); const QModelIndex parentIndex = node2index( parentNode ); beginInsertRows( parentIndex, parentNode->childCount(), parentNode->childCount() ); @@ -525,7 +525,7 @@ void QgsRuntimeProfiler::otherProfilerEnded( const QString &group, const QString QgsRuntimeProfilerNode *destNode = parentNode->child( group, name, id ); if ( !destNode ) { - std::unique_ptr< QgsRuntimeProfilerNode > node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); + auto node = std::make_unique< QgsRuntimeProfilerNode >( group, name, id ); destNode = node.get(); const QModelIndex parentIndex = node2index( parentNode ); beginInsertRows( parentIndex, parentNode->childCount(), parentNode->childCount() ); diff --git a/src/core/qgsspatialindex.h b/src/core/qgsspatialindex.h index 29f09ab3b6ff..9a2aa80b8148 100644 --- a/src/core/qgsspatialindex.h +++ b/src/core/qgsspatialindex.h @@ -254,7 +254,7 @@ class CORE_EXPORT QgsSpatialIndex : public QgsFeatureSink */ SIP_PYOBJECT geometry( QgsFeatureId id ) const SIP_TYPEHINT( QgsGeometry ); % MethodCode - std::unique_ptr< QgsGeometry > g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); + auto g = std::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) ); if ( g->isNull() ) { PyErr_SetString( PyExc_KeyError, QStringLiteral( "No geometry with feature id %1 exists in the index." ).arg( a0 ).toUtf8().constData() ); diff --git a/src/core/qgstemporalnavigationobject.cpp b/src/core/qgstemporalnavigationobject.cpp index 8e6b86827eb1..2fe641bcfdcb 100644 --- a/src/core/qgstemporalnavigationobject.cpp +++ b/src/core/qgstemporalnavigationobject.cpp @@ -90,7 +90,7 @@ void QgsTemporalNavigationObject::setLooping( bool loopAnimation ) QgsExpressionContextScope *QgsTemporalNavigationObject::createExpressionContextScope() const { - std::unique_ptr< QgsExpressionContextScope > scope = std::make_unique< QgsExpressionContextScope >( QStringLiteral( "temporal" ) ); + auto scope = std::make_unique< QgsExpressionContextScope >( QStringLiteral( "temporal" ) ); scope->setVariable( QStringLiteral( "frame_rate" ), mFramesPerSecond, true ); scope->setVariable( QStringLiteral( "frame_number" ), mCurrentFrameNumber, true ); scope->setVariable( QStringLiteral( "frame_duration" ), mFrameDuration, true ); diff --git a/src/core/qgstessellator.cpp b/src/core/qgstessellator.cpp index 03e4225fe7a8..6811b0bcbb86 100644 --- a/src/core/qgstessellator.cpp +++ b/src/core/qgstessellator.cpp @@ -817,7 +817,7 @@ int QgsTessellator::dataVerticesCount() const std::unique_ptr QgsTessellator::asMultiPolygon() const { - std::unique_ptr< QgsMultiPolygon > mp = std::make_unique< QgsMultiPolygon >(); + auto mp = std::make_unique< QgsMultiPolygon >(); const auto nVals = mData.size(); mp->reserve( nVals / 9 ); for ( auto i = decltype( nVals ) {0}; i + 8 < nVals; i += 9 ) diff --git a/src/core/raster/qgscolorrampshader.cpp b/src/core/raster/qgscolorrampshader.cpp index b6a747c0ce58..c96c3eb1fac0 100644 --- a/src/core/raster/qgscolorrampshader.cpp +++ b/src/core/raster/qgscolorrampshader.cpp @@ -136,7 +136,7 @@ QgsColorRamp *QgsColorRampShader::sourceColorRamp() const QgsColorRamp *QgsColorRampShader::createColorRamp() const { - std::unique_ptr ramp = std::make_unique< QgsGradientColorRamp >(); + auto ramp = std::make_unique< QgsGradientColorRamp >(); const int count = mColorRampItemList.size(); if ( count == 0 ) { diff --git a/src/core/raster/qgshillshaderenderer.cpp b/src/core/raster/qgshillshaderenderer.cpp index 6c61a29e1054..0b39b7a590ca 100644 --- a/src/core/raster/qgshillshaderenderer.cpp +++ b/src/core/raster/qgshillshaderenderer.cpp @@ -238,7 +238,7 @@ QgsRasterBlock *QgsHillshadeRenderer::block( int bandNo, const QgsRectangle &ext // Buffer scanlines, 1px height, 2px wider // Data type for input is Float32 (4 bytes) // keep only three scanlines in memory at a time, make room for initial and final nodata - std::unique_ptr scanLine = std::make_unique( inputBlock->dataType(), scanLineWidth, 1 ); + auto scanLine = std::make_unique( inputBlock->dataType(), scanLineWidth, 1 ); // Note: output block is not 2px wider and it is an image // Prepare context and queue cl::Context ctx = QgsOpenClUtils::context(); diff --git a/src/core/raster/qgspalettedrasterrenderer.cpp b/src/core/raster/qgspalettedrasterrenderer.cpp index fc29a0236ea2..1fedf3c751c6 100644 --- a/src/core/raster/qgspalettedrasterrenderer.cpp +++ b/src/core/raster/qgspalettedrasterrenderer.cpp @@ -82,7 +82,7 @@ QgsPalettedRasterRenderer::QgsPalettedRasterRenderer( QgsRasterInterface *input, QgsPalettedRasterRenderer *QgsPalettedRasterRenderer::clone() const { - std::unique_ptr< QgsPalettedRasterRenderer > renderer = std::make_unique< QgsPalettedRasterRenderer >( nullptr, mBand, mMultiValueClassData ); + auto renderer = std::make_unique< QgsPalettedRasterRenderer >( nullptr, mBand, mMultiValueClassData ); if ( mSourceColorRamp ) renderer->setSourceColorRamp( mSourceColorRamp->clone() ); diff --git a/src/core/raster/qgsrasterattributetable.cpp b/src/core/raster/qgsrasterattributetable.cpp index 2dbf92cbbcd7..eb6f63ccac52 100644 --- a/src/core/raster/qgsrasterattributetable.cpp +++ b/src/core/raster/qgsrasterattributetable.cpp @@ -1527,7 +1527,7 @@ QgsRasterRenderer *QgsRasterAttributeTable::createRenderer( QgsRasterDataProvide } else { - std::unique_ptr pseudoColorRenderer = std::make_unique( provider, bandNumber ); + auto pseudoColorRenderer = std::make_unique( provider, bandNumber ); QStringList labels; // Athematic classification is not supported, but the classificationColumn will be used for labels. // if it's not specified, try to guess it here. diff --git a/src/core/raster/qgsrasterdataprovider.cpp b/src/core/raster/qgsrasterdataprovider.cpp index 4cdc3d136c5e..9cb0fa7616ad 100644 --- a/src/core/raster/qgsrasterdataprovider.cpp +++ b/src/core/raster/qgsrasterdataprovider.cpp @@ -55,7 +55,7 @@ QgsRasterBlock *QgsRasterDataProvider::block( int bandNo, QgsRectangle const &b QgsDebugMsgLevel( QStringLiteral( "bandNo = %1 width = %2 height = %3" ).arg( bandNo ).arg( width ).arg( height ), 4 ); QgsDebugMsgLevel( QStringLiteral( "boundingBox = %1" ).arg( boundingBox.toString() ), 4 ); - std::unique_ptr< QgsRasterBlock > block = std::make_unique< QgsRasterBlock >( dataType( bandNo ), width, height ); + auto block = std::make_unique< QgsRasterBlock >( dataType( bandNo ), width, height ); if ( sourceHasNoDataValue( bandNo ) && useSourceNoDataValue( bandNo ) ) { block->setNoDataValue( sourceNoDataValue( bandNo ) ); @@ -154,7 +154,7 @@ QgsRasterBlock *QgsRasterDataProvider::block( int bandNo, QgsRectangle const &b QgsDebugMsgLevel( QStringLiteral( "Reading smaller block tmpWidth = %1 height = %2" ).arg( tmpWidth ).arg( tmpHeight ), 4 ); QgsDebugMsgLevel( QStringLiteral( "tmpExtent = %1" ).arg( tmpExtent.toString() ), 4 ); - std::unique_ptr< QgsRasterBlock > tmpBlock = std::make_unique< QgsRasterBlock >( dataType( bandNo ), tmpWidth, tmpHeight ); + auto tmpBlock = std::make_unique< QgsRasterBlock >( dataType( bandNo ), tmpWidth, tmpHeight ); if ( sourceHasNoDataValue( bandNo ) && useSourceNoDataValue( bandNo ) ) { tmpBlock->setNoDataValue( sourceNoDataValue( bandNo ) ); @@ -774,7 +774,7 @@ bool QgsRasterDataProvider::readFileBasedAttributeTable( int bandNumber, const Q { QGIS_PROTECT_QOBJECT_THREAD_ACCESS - std::unique_ptr rat = std::make_unique(); + auto rat = std::make_unique(); if ( rat->readFromFile( path, errorMessage ) ) { setAttributeTable( bandNumber, rat.release() ); diff --git a/src/core/raster/qgsrasterlabeling.cpp b/src/core/raster/qgsrasterlabeling.cpp index f00887b111d8..527e48a150b6 100644 --- a/src/core/raster/qgsrasterlabeling.cpp +++ b/src/core/raster/qgsrasterlabeling.cpp @@ -65,10 +65,10 @@ void QgsRasterLayerLabelProvider::addLabel( const QgsPoint &mapPoint, const QStr } const double uPP = m2p.mapUnitsPerPixel(); - std::unique_ptr< QgsTextLabelFeature > feature = std::make_unique< QgsTextLabelFeature >( mLabels.size(), - QgsGeos::asGeos( &geom ), - QSizeF( size.width() * uPP, - size.height() * uPP ) ); + auto feature = std::make_unique< QgsTextLabelFeature >( mLabels.size(), + QgsGeos::asGeos( &geom ), + QSizeF( size.width() * uPP, + size.height() * uPP ) ); feature->setDocument( doc, documentMetrics ); feature->setFixedAngle( 0 ); @@ -368,7 +368,7 @@ QString QgsRasterLayerSimpleLabeling::type() const QgsRasterLayerSimpleLabeling *QgsRasterLayerSimpleLabeling::clone() const { - std::unique_ptr< QgsRasterLayerSimpleLabeling > res = std::make_unique< QgsRasterLayerSimpleLabeling >(); + auto res = std::make_unique< QgsRasterLayerSimpleLabeling >(); res->setTextFormat( mTextFormat ); if ( mNumericFormat ) @@ -390,7 +390,7 @@ QgsRasterLayerSimpleLabeling *QgsRasterLayerSimpleLabeling::clone() const std::unique_ptr< QgsRasterLayerLabelProvider > QgsRasterLayerSimpleLabeling::provider( QgsRasterLayer *layer ) const { - std::unique_ptr< QgsRasterLayerLabelProvider > res = std::make_unique< QgsRasterLayerLabelProvider >( layer ); + auto res = std::make_unique< QgsRasterLayerLabelProvider >( layer ); res->setTextFormat( mTextFormat ); res->setBand( mBandNumber ); res->setPriority( mPriority ); @@ -474,7 +474,7 @@ bool QgsRasterLayerSimpleLabeling::requiresAdvancedEffects() const QgsRasterLayerSimpleLabeling *QgsRasterLayerSimpleLabeling::create( const QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsRasterLayerSimpleLabeling > res = std::make_unique< QgsRasterLayerSimpleLabeling >(); + auto res = std::make_unique< QgsRasterLayerSimpleLabeling >(); res->setBand( element.attribute( QStringLiteral( "band" ), QStringLiteral( "1" ) ).toInt() ); res->setPriority( element.attribute( QStringLiteral( "priority" ), QStringLiteral( "0.5" ) ).toDouble() ); res->setZIndex( element.attribute( QStringLiteral( "zIndex" ), QStringLiteral( "0" ) ).toDouble() ); @@ -612,7 +612,7 @@ void QgsRasterLayerSimpleLabeling::multiplyOpacity( double opacityFactor ) QgsAbstractRasterLayerLabeling *QgsAbstractRasterLayerLabeling::defaultLabelingForLayer( QgsRasterLayer *layer ) { - std::unique_ptr< QgsRasterLayerSimpleLabeling > res = std::make_unique< QgsRasterLayerSimpleLabeling >(); + auto res = std::make_unique< QgsRasterLayerSimpleLabeling >(); res->setTextFormat( QgsStyle::defaultTextFormatForProject( layer->project() ) ); res->setBand( 1 ); return res.release(); diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index ed2f42383cb7..811d5914bd11 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -172,7 +172,7 @@ QgsRasterLayer *QgsRasterLayer::clone() const { options.transformContext = mDataProvider->transformContext(); } - std::unique_ptr< QgsRasterLayer > layer = std::make_unique< QgsRasterLayer >( source(), name(), mProviderKey, options ); + auto layer = std::make_unique< QgsRasterLayer >( source(), name(), mProviderKey, options ); QgsMapLayer::clone( layer.get() ); layer->mElevationProperties = mElevationProperties->clone(); layer->mElevationProperties->setParent( layer.get() ); @@ -858,7 +858,7 @@ void QgsRasterLayer::setDataProvider( QString const &provider, const QgsDataProv QgsDebugMsgLevel( "Native Raster Raster Attribute Table read failed " + errorMessage, 2 ); if ( QFile::exists( mDataProvider->dataSourceUri( ) + ".vat.dbf" ) ) { - std::unique_ptr rat = std::make_unique(); + auto rat = std::make_unique(); hasRat = rat->readFromFile( mDataProvider->dataSourceUri( ) + ".vat.dbf", &errorMessage ); if ( hasRat ) { @@ -1192,7 +1192,7 @@ void QgsRasterLayer::readRasterAttributeTableExternalPaths( const QDomNode &laye continue; } - std::unique_ptr rat = std::make_unique(); + auto rat = std::make_unique(); QString errorMessage; if ( ! rat->readFromFile( path, &errorMessage ) ) { diff --git a/src/core/raster/qgsrasterlayerelevationproperties.cpp b/src/core/raster/qgsrasterlayerelevationproperties.cpp index f1053a1f1c9a..acb406f9dd55 100644 --- a/src/core/raster/qgsrasterlayerelevationproperties.cpp +++ b/src/core/raster/qgsrasterlayerelevationproperties.cpp @@ -167,7 +167,7 @@ bool QgsRasterLayerElevationProperties::readXml( const QDomElement &element, con QgsRasterLayerElevationProperties *QgsRasterLayerElevationProperties::clone() const { - std::unique_ptr< QgsRasterLayerElevationProperties > res = std::make_unique< QgsRasterLayerElevationProperties >( nullptr ); + auto res = std::make_unique< QgsRasterLayerElevationProperties >( nullptr ); res->setEnabled( mEnabled ); res->setMode( mMode ); res->setProfileLineSymbol( mProfileLineSymbol->clone() ); @@ -754,13 +754,13 @@ bool QgsRasterLayerElevationProperties::layerLooksLikeDem( QgsRasterLayer *layer void QgsRasterLayerElevationProperties::setDefaultProfileLineSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); + auto profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); mProfileLineSymbol = std::make_unique< QgsLineSymbol>( QgsSymbolLayerList( { profileLineLayer.release() } ) ); } void QgsRasterLayerElevationProperties::setDefaultProfileFillSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); + auto profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); profileFillLayer->setStrokeStyle( Qt::NoPen ); mProfileFillSymbol = std::make_unique< QgsFillSymbol>( QgsSymbolLayerList( { profileFillLayer.release() } ) ); } diff --git a/src/core/raster/qgsrasterprojector.cpp b/src/core/raster/qgsrasterprojector.cpp index 75c48aefd4a3..d0426f3f9e6b 100644 --- a/src/core/raster/qgsrasterprojector.cpp +++ b/src/core/raster/qgsrasterprojector.cpp @@ -855,7 +855,7 @@ QgsRasterBlock *QgsRasterProjector::block( int bandNo, QgsRectangle const &exte const qgssize pixelSize = static_cast( QgsRasterBlock::typeSize( mInput->dataType( bandNo ) ) ); - std::unique_ptr< QgsRasterBlock > outputBlock = std::make_unique< QgsRasterBlock >( input->dataType(), width, height ); + auto outputBlock = std::make_unique< QgsRasterBlock >( input->dataType(), width, height ); QgsRasterBlock *output = outputBlock.get(); if ( input->hasNoDataValue() ) diff --git a/src/core/raster/qgsrasterrendererregistry.cpp b/src/core/raster/qgsrasterrendererregistry.cpp index b905caccf6ea..e410a3b33100 100644 --- a/src/core/raster/qgsrasterrendererregistry.cpp +++ b/src/core/raster/qgsrasterrendererregistry.cpp @@ -250,7 +250,7 @@ QgsRasterRenderer *QgsRasterRendererRegistry::defaultRendererForDrawingStyle( Qg return nullptr; } - std::unique_ptr< QgsRasterTransparency > tr = std::make_unique< QgsRasterTransparency >(); + auto tr = std::make_unique< QgsRasterTransparency >(); const int bandCount = renderer->usesBands().size(); if ( bandCount == 1 ) { diff --git a/src/core/raster/qgssinglebandgrayrenderer.cpp b/src/core/raster/qgssinglebandgrayrenderer.cpp index 3e1a78b787ae..3011f695fea5 100644 --- a/src/core/raster/qgssinglebandgrayrenderer.cpp +++ b/src/core/raster/qgssinglebandgrayrenderer.cpp @@ -82,7 +82,7 @@ QgsRasterRenderer *QgsSingleBandGrayRenderer::create( const QDomElement &elem, Q r->setContrastEnhancement( ce ); } - std::unique_ptr< QgsColorRampLegendNodeSettings > legendSettings = std::make_unique< QgsColorRampLegendNodeSettings >(); + auto legendSettings = std::make_unique< QgsColorRampLegendNodeSettings >(); legendSettings->readXml( elem, QgsReadWriteContext() ); r->setLegendSettings( legendSettings.release() ); diff --git a/src/core/scalebar/qgsdoubleboxscalebarrenderer.cpp b/src/core/scalebar/qgsdoubleboxscalebarrenderer.cpp index ab643561cf98..9ef6484f527f 100644 --- a/src/core/scalebar/qgsdoubleboxscalebarrenderer.cpp +++ b/src/core/scalebar/qgsdoubleboxscalebarrenderer.cpp @@ -199,8 +199,8 @@ bool QgsDoubleBoxScaleBarRenderer::applyDefaultSettings( QgsScaleBarSettings &se // restore the fill symbols by default if ( fill && fill->brushStyle() == Qt::NoBrush ) { - std::unique_ptr< QgsFillSymbol > fillSymbol = std::make_unique< QgsFillSymbol >(); - std::unique_ptr< QgsSimpleFillSymbolLayer > fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto fillSymbol = std::make_unique< QgsFillSymbol >(); + auto fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); fillSymbolLayer->setColor( QColor( 0, 0, 0 ) ); fillSymbolLayer->setBrushStyle( Qt::SolidPattern ); fillSymbolLayer->setStrokeStyle( Qt::SolidLine ); diff --git a/src/core/scalebar/qgshollowscalebarrenderer.cpp b/src/core/scalebar/qgshollowscalebarrenderer.cpp index dcc8f6de7b1f..31459f155934 100644 --- a/src/core/scalebar/qgshollowscalebarrenderer.cpp +++ b/src/core/scalebar/qgshollowscalebarrenderer.cpp @@ -178,8 +178,8 @@ void QgsHollowScaleBarRenderer::draw( QgsRenderContext &context, const QgsScaleB bool QgsHollowScaleBarRenderer::applyDefaultSettings( QgsScaleBarSettings &settings ) const { // null the fill symbols by default - std::unique_ptr< QgsFillSymbol > fillSymbol = std::make_unique< QgsFillSymbol >(); - std::unique_ptr< QgsSimpleFillSymbolLayer > fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto fillSymbol = std::make_unique< QgsFillSymbol >(); + auto fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); fillSymbolLayer->setColor( QColor( 0, 0, 0 ) ); fillSymbolLayer->setBrushStyle( Qt::NoBrush ); fillSymbolLayer->setStrokeStyle( Qt::NoPen ); diff --git a/src/core/scalebar/qgssingleboxscalebarrenderer.cpp b/src/core/scalebar/qgssingleboxscalebarrenderer.cpp index f258a7fbf241..a9145920fae7 100644 --- a/src/core/scalebar/qgssingleboxscalebarrenderer.cpp +++ b/src/core/scalebar/qgssingleboxscalebarrenderer.cpp @@ -165,8 +165,8 @@ bool QgsSingleBoxScaleBarRenderer::applyDefaultSettings( QgsScaleBarSettings &se // restore the fill symbols by default if ( fill && fill->brushStyle() == Qt::NoBrush ) { - std::unique_ptr< QgsFillSymbol > fillSymbol = std::make_unique< QgsFillSymbol >(); - std::unique_ptr< QgsSimpleFillSymbolLayer > fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); + auto fillSymbol = std::make_unique< QgsFillSymbol >(); + auto fillSymbolLayer = std::make_unique< QgsSimpleFillSymbolLayer >(); fillSymbolLayer->setColor( QColor( 0, 0, 0 ) ); fillSymbolLayer->setBrushStyle( Qt::SolidPattern ); fillSymbolLayer->setStrokeStyle( Qt::SolidLine ); diff --git a/src/core/stac/qgsstacparser.cpp b/src/core/stac/qgsstacparser.cpp index f44510cdb68c..2e7ad657e5db 100644 --- a/src/core/stac/qgsstacparser.cpp +++ b/src/core/stac/qgsstacparser.cpp @@ -104,10 +104,10 @@ QgsStacCatalog *QgsStacParser::parseCatalog( const nlohmann::json &data ) QVector< QgsStacLink > links = parseLinks( data.at( "links" ) ); - std::unique_ptr< QgsStacCatalog > catalog = std::make_unique< QgsStacCatalog >( id, - ver, - description, - links ); + auto catalog = std::make_unique< QgsStacCatalog >( id, + ver, + description, + links ); if ( data.contains( "title" ) ) catalog->setTitle( getString( data["title"] ) ); @@ -218,12 +218,12 @@ QgsStacCollection *QgsStacParser::parseCollection( const nlohmann::json &data ) QVector< QgsStacLink > links = parseLinks( data.at( "links" ) ); - std::unique_ptr< QgsStacCollection > collection = std::make_unique< QgsStacCollection >( id, - ver, - description, - links, - license, - stacExtent ); + auto collection = std::make_unique< QgsStacCollection >( id, + ver, + description, + links, + license, + stacExtent ); if ( data.contains( "title" ) ) collection->setTitle( getString( data["title"] ) ); @@ -371,13 +371,13 @@ QgsStacItem *QgsStacParser::parseItem( const nlohmann::json &data ) QMap< QString, QgsStacAsset > assets = parseAssets( data.at( "assets" ) ); - std::unique_ptr< QgsStacItem > item = std::make_unique< QgsStacItem >( id, - ver, - geom, - properties, - links, - assets, - bbox ); + auto item = std::make_unique< QgsStacItem >( id, + ver, + geom, + properties, + links, + assets, + bbox ); if ( data.contains( "stac_extensions" ) ) { diff --git a/src/core/symbology/qgs25drenderer.cpp b/src/core/symbology/qgs25drenderer.cpp index 0f51d1ece18f..ceb594c2abaf 100644 --- a/src/core/symbology/qgs25drenderer.cpp +++ b/src/core/symbology/qgs25drenderer.cpp @@ -287,7 +287,7 @@ Qgs25DRenderer *Qgs25DRenderer::convertFromRenderer( QgsFeatureRenderer *rendere } else { - std::unique_ptr< Qgs25DRenderer > res = std::make_unique< Qgs25DRenderer >(); + auto res = std::make_unique< Qgs25DRenderer >(); renderer->copyRendererData( res.get() ); return res.release(); } diff --git a/src/core/symbology/qgsembeddedsymbolrenderer.cpp b/src/core/symbology/qgsembeddedsymbolrenderer.cpp index 035362dfb936..f430ce66ee40 100644 --- a/src/core/symbology/qgsembeddedsymbolrenderer.cpp +++ b/src/core/symbology/qgsembeddedsymbolrenderer.cpp @@ -124,7 +124,7 @@ QgsEmbeddedSymbolRenderer *QgsEmbeddedSymbolRenderer::convertFromRenderer( const } else if ( renderer->type() == QLatin1String( "singleSymbol" ) ) { - std::unique_ptr< QgsEmbeddedSymbolRenderer > symbolRenderer = std::make_unique< QgsEmbeddedSymbolRenderer >( static_cast< const QgsSingleSymbolRenderer * >( renderer )->symbol()->clone() ); + auto symbolRenderer = std::make_unique< QgsEmbeddedSymbolRenderer >( static_cast< const QgsSingleSymbolRenderer * >( renderer )->symbol()->clone() ); renderer->copyRendererData( symbolRenderer.get() ); return symbolRenderer.release(); } diff --git a/src/core/symbology/qgsfillsymbollayer.cpp b/src/core/symbology/qgsfillsymbollayer.cpp index 1ed02d5385e8..d335825401ad 100644 --- a/src/core/symbology/qgsfillsymbollayer.cpp +++ b/src/core/symbology/qgsfillsymbollayer.cpp @@ -225,7 +225,7 @@ QgsSymbolLayer *QgsSimpleFillSymbolLayer::create( const QVariantMap &props ) if ( props.contains( QStringLiteral( "joinstyle" ) ) ) penJoinStyle = QgsSymbolLayerUtils::decodePenJoinStyle( props[QStringLiteral( "joinstyle" )].toString() ); - std::unique_ptr< QgsSimpleFillSymbolLayer > sl = std::make_unique< QgsSimpleFillSymbolLayer >( color, style, strokeColor, strokeStyle, strokeWidth, penJoinStyle ); + auto sl = std::make_unique< QgsSimpleFillSymbolLayer >( color, style, strokeColor, strokeStyle, strokeWidth, penJoinStyle ); sl->setOffset( offset ); if ( props.contains( QStringLiteral( "border_width_unit" ) ) ) { @@ -376,7 +376,7 @@ QVariantMap QgsSimpleFillSymbolLayer::properties() const QgsSimpleFillSymbolLayer *QgsSimpleFillSymbolLayer::clone() const { - std::unique_ptr< QgsSimpleFillSymbolLayer > sl = std::make_unique< QgsSimpleFillSymbolLayer >( mColor, mBrushStyle, mStrokeColor, mStrokeStyle, mStrokeWidth, mPenJoinStyle ); + auto sl = std::make_unique< QgsSimpleFillSymbolLayer >( mColor, mBrushStyle, mStrokeColor, mStrokeStyle, mStrokeWidth, mPenJoinStyle ); sl->setOffset( mOffset ); sl->setOffsetUnit( mOffsetUnit ); sl->setOffsetMapUnitScale( mOffsetMapUnitScale ); @@ -504,7 +504,7 @@ QgsSymbolLayer *QgsSimpleFillSymbolLayer::createFromSld( QDomElement &element ) offset.setY( offset.y() * scaleFactor ); strokeWidth = strokeWidth * scaleFactor; - std::unique_ptr< QgsSimpleFillSymbolLayer > sl = std::make_unique< QgsSimpleFillSymbolLayer >( color, fillStyle, strokeColor, strokeStyle, strokeWidth ); + auto sl = std::make_unique< QgsSimpleFillSymbolLayer >( color, fillStyle, strokeColor, strokeStyle, strokeWidth ); sl->setOutputUnit( sldUnitSize ); sl->setOffset( offset ); return sl.release(); @@ -677,7 +677,7 @@ QgsSymbolLayer *QgsGradientFillSymbolLayer::create( const QVariantMap &props ) } //create a new gradient fill layer with desired properties - std::unique_ptr< QgsGradientFillSymbolLayer > sl = std::make_unique< QgsGradientFillSymbolLayer >( color, color2, colorType, type, coordinateMode, gradientSpread ); + auto sl = std::make_unique< QgsGradientFillSymbolLayer >( color, color2, colorType, type, coordinateMode, gradientSpread ); sl->setOffset( offset ); if ( props.contains( QStringLiteral( "offset_unit" ) ) ) sl->setOffsetUnit( QgsUnitTypes::decodeRenderUnit( props[QStringLiteral( "offset_unit" )].toString() ) ); @@ -1051,7 +1051,7 @@ QVariantMap QgsGradientFillSymbolLayer::properties() const QgsGradientFillSymbolLayer *QgsGradientFillSymbolLayer::clone() const { - std::unique_ptr< QgsGradientFillSymbolLayer > sl = std::make_unique< QgsGradientFillSymbolLayer >( mColor, mColor2, mGradientColorType, mGradientType, mCoordinateMode, mGradientSpread ); + auto sl = std::make_unique< QgsGradientFillSymbolLayer >( mColor, mColor2, mGradientColorType, mGradientType, mCoordinateMode, mGradientSpread ); if ( mGradientRamp ) sl->setColorRamp( mGradientRamp->clone() ); sl->setReferencePoint1( mReferencePoint1 ); @@ -1181,7 +1181,7 @@ QgsSymbolLayer *QgsShapeburstFillSymbolLayer::create( const QVariantMap &props ) } //create a new shapeburst fill layer with desired properties - std::unique_ptr< QgsShapeburstFillSymbolLayer > sl = std::make_unique< QgsShapeburstFillSymbolLayer >( color, color2, colorType, blurRadius, useWholeShape, maxDistance ); + auto sl = std::make_unique< QgsShapeburstFillSymbolLayer >( color, color2, colorType, blurRadius, useWholeShape, maxDistance ); sl->setOffset( offset ); if ( props.contains( QStringLiteral( "offset_unit" ) ) ) { @@ -1375,8 +1375,8 @@ void QgsShapeburstFillSymbolLayer::renderPolygon( const QPolygonF &points, const if ( context.renderContext().feedback() && context.renderContext().feedback()->isCanceled() ) return; - std::unique_ptr< QImage > fillImage = std::make_unique< QImage >( imWidth, - imHeight, QImage::Format_ARGB32_Premultiplied ); + auto fillImage = std::make_unique< QImage >( imWidth, + imHeight, QImage::Format_ARGB32_Premultiplied ); if ( fillImage->isNull() ) { QgsMessageLog::logMessage( QObject::tr( "Could not allocate sufficient memory for shapeburst fill" ) ); @@ -1387,7 +1387,7 @@ void QgsShapeburstFillSymbolLayer::renderPolygon( const QPolygonF &points, const return; //also create an image to store the alpha channel - std::unique_ptr< QImage > alphaImage = std::make_unique< QImage >( fillImage->width(), fillImage->height(), QImage::Format_ARGB32_Premultiplied ); + auto alphaImage = std::make_unique< QImage >( fillImage->width(), fillImage->height(), QImage::Format_ARGB32_Premultiplied ); if ( alphaImage->isNull() ) { QgsMessageLog::logMessage( QObject::tr( "Could not allocate sufficient memory for shapeburst fill" ) ); @@ -1711,7 +1711,7 @@ QVariantMap QgsShapeburstFillSymbolLayer::properties() const QgsShapeburstFillSymbolLayer *QgsShapeburstFillSymbolLayer::clone() const { - std::unique_ptr< QgsShapeburstFillSymbolLayer > sl = std::make_unique< QgsShapeburstFillSymbolLayer >( mColor, mColor2, mColorType, mBlurRadius, mUseWholeShape, mMaxDistance ); + auto sl = std::make_unique< QgsShapeburstFillSymbolLayer >( mColor, mColor2, mColorType, mBlurRadius, mUseWholeShape, mMaxDistance ); if ( mGradientRamp ) { sl->setColorRamp( mGradientRamp->clone() ); @@ -2431,7 +2431,7 @@ QgsSymbolLayer *QgsSVGFillSymbolLayer::createFromSld( QDomElement &element ) angle = d; } - std::unique_ptr< QgsSVGFillSymbolLayer > sl = std::make_unique< QgsSVGFillSymbolLayer >( path, size, angle ); + auto sl = std::make_unique< QgsSVGFillSymbolLayer >( path, size, angle ); sl->setOutputUnit( sldUnitSize ); sl->setSvgFillColor( fillColor ); sl->setSvgStrokeColor( strokeColor ); @@ -2763,7 +2763,7 @@ QgsMapUnitScale QgsLinePatternFillSymbolLayer::mapUnitScale() const QgsSymbolLayer *QgsLinePatternFillSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsLinePatternFillSymbolLayer > patternLayer = std::make_unique< QgsLinePatternFillSymbolLayer >(); + auto patternLayer = std::make_unique< QgsLinePatternFillSymbolLayer >(); //default values double lineAngle = 45; @@ -3589,7 +3589,7 @@ QgsSymbolLayer *QgsLinePatternFillSymbolLayer::createFromSld( QDomElement &eleme size = size * scaleFactor; lineWidth = lineWidth * scaleFactor; - std::unique_ptr< QgsLinePatternFillSymbolLayer > sl = std::make_unique< QgsLinePatternFillSymbolLayer >(); + auto sl = std::make_unique< QgsLinePatternFillSymbolLayer >(); sl->setOutputUnit( sldUnitSize ); sl->setColor( lineColor ); sl->setLineWidth( lineWidth ); @@ -3710,7 +3710,7 @@ QgsMapUnitScale QgsPointPatternFillSymbolLayer::mapUnitScale() const QgsSymbolLayer *QgsPointPatternFillSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsPointPatternFillSymbolLayer > layer = std::make_unique< QgsPointPatternFillSymbolLayer >(); + auto layer = std::make_unique< QgsPointPatternFillSymbolLayer >(); if ( properties.contains( QStringLiteral( "distance_x" ) ) ) { layer->setDistanceX( properties[QStringLiteral( "distance_x" )].toDouble() ); @@ -4544,12 +4544,12 @@ QgsSymbolLayer *QgsPointPatternFillSymbolLayer::createFromSld( QDomElement &elem QgsSymbolLayerList layers; layers.append( simpleMarkerSl ); - std::unique_ptr< QgsMarkerSymbol > marker = std::make_unique< QgsMarkerSymbol >( layers ); + auto marker = std::make_unique< QgsMarkerSymbol >( layers ); // Converts from GeoServer "graphic-margin": symbol size must be added and margin doubled const double markerSize { marker->size() }; - std::unique_ptr< QgsPointPatternFillSymbolLayer > pointPatternFillSl = std::make_unique< QgsPointPatternFillSymbolLayer >(); + auto pointPatternFillSl = std::make_unique< QgsPointPatternFillSymbolLayer >(); pointPatternFillSl->setSubSymbol( marker.release() ); // This may not be correct in all cases, TODO: check "uom" pointPatternFillSl->setDistanceXUnit( Qgis::RenderUnit::Pixels ); @@ -4784,7 +4784,7 @@ QgsCentroidFillSymbolLayer::~QgsCentroidFillSymbolLayer() = default; QgsSymbolLayer *QgsCentroidFillSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsCentroidFillSymbolLayer > sl = std::make_unique< QgsCentroidFillSymbolLayer >(); + auto sl = std::make_unique< QgsCentroidFillSymbolLayer >(); if ( properties.contains( QStringLiteral( "point_on_surface" ) ) ) sl->setPointOnSurface( properties[QStringLiteral( "point_on_surface" )].toInt() != 0 ); @@ -4977,7 +4977,7 @@ QVariantMap QgsCentroidFillSymbolLayer::properties() const QgsCentroidFillSymbolLayer *QgsCentroidFillSymbolLayer::clone() const { - std::unique_ptr< QgsCentroidFillSymbolLayer > x = std::make_unique< QgsCentroidFillSymbolLayer >(); + auto x = std::make_unique< QgsCentroidFillSymbolLayer >(); x->mAngle = mAngle; x->mColor = mColor; x->setSubSymbol( mMarker->clone() ); @@ -5008,7 +5008,7 @@ QgsSymbolLayer *QgsCentroidFillSymbolLayer::createFromSld( QDomElement &element layers.append( l ); std::unique_ptr< QgsMarkerSymbol > marker( new QgsMarkerSymbol( layers ) ); - std::unique_ptr< QgsCentroidFillSymbolLayer > sl = std::make_unique< QgsCentroidFillSymbolLayer >(); + auto sl = std::make_unique< QgsCentroidFillSymbolLayer >(); sl->setSubSymbol( marker.release() ); sl->setPointOnAllParts( false ); return sl.release(); @@ -5146,7 +5146,7 @@ QgsSymbolLayer *QgsRasterFillSymbolLayer::create( const QVariantMap &properties { width = properties[QStringLiteral( "width" )].toDouble(); } - std::unique_ptr< QgsRasterFillSymbolLayer > symbolLayer = std::make_unique< QgsRasterFillSymbolLayer >( imagePath ); + auto symbolLayer = std::make_unique< QgsRasterFillSymbolLayer >( imagePath ); symbolLayer->setCoordinateMode( mode ); symbolLayer->setOpacity( alpha ); symbolLayer->setOffset( offset ); @@ -5206,7 +5206,7 @@ QgsSymbolLayer *QgsRasterFillSymbolLayer::createFromSld( QDomElement &element ) path = QgsProject::instance()->pathResolver().readPath( path ); // skip-keyword-check } - std::unique_ptr< QgsRasterFillSymbolLayer> sl = std::make_unique< QgsRasterFillSymbolLayer>( path ); + auto sl = std::make_unique< QgsRasterFillSymbolLayer>( path ); return sl.release(); } @@ -5308,7 +5308,7 @@ QVariantMap QgsRasterFillSymbolLayer::properties() const QgsRasterFillSymbolLayer *QgsRasterFillSymbolLayer::clone() const { - std::unique_ptr< QgsRasterFillSymbolLayer > sl = std::make_unique< QgsRasterFillSymbolLayer >( mImageFilePath ); + auto sl = std::make_unique< QgsRasterFillSymbolLayer >( mImageFilePath ); sl->setCoordinateMode( mCoordinateMode ); sl->setOpacity( mOpacity ); sl->setOffset( mOffset ); @@ -5542,7 +5542,7 @@ QgsSymbolLayer *QgsRandomMarkerFillSymbolLayer::create( const QVariantMap &prope seed = uniformDist( mt ); } - std::unique_ptr< QgsRandomMarkerFillSymbolLayer > sl = std::make_unique< QgsRandomMarkerFillSymbolLayer >( pointCount, countMethod, densityArea, seed ); + auto sl = std::make_unique< QgsRandomMarkerFillSymbolLayer >( pointCount, countMethod, densityArea, seed ); if ( properties.contains( QStringLiteral( "density_area_unit" ) ) ) sl->setDensityAreaUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "density_area_unit" )].toString() ) ); @@ -5739,7 +5739,7 @@ QVariantMap QgsRandomMarkerFillSymbolLayer::properties() const QgsRandomMarkerFillSymbolLayer *QgsRandomMarkerFillSymbolLayer::clone() const { - std::unique_ptr< QgsRandomMarkerFillSymbolLayer > res = std::make_unique< QgsRandomMarkerFillSymbolLayer >( mPointCount, mCountMethod, mDensityArea, mSeed ); + auto res = std::make_unique< QgsRandomMarkerFillSymbolLayer >( mPointCount, mCountMethod, mDensityArea, mSeed ); res->mAngle = mAngle; res->mColor = mColor; res->setDensityAreaUnit( mDensityAreaUnit ); diff --git a/src/core/symbology/qgsgeometrygeneratorsymbollayer.cpp b/src/core/symbology/qgsgeometrygeneratorsymbollayer.cpp index 6f93c0fac265..a5728ee2bf60 100644 --- a/src/core/symbology/qgsgeometrygeneratorsymbollayer.cpp +++ b/src/core/symbology/qgsgeometrygeneratorsymbollayer.cpp @@ -416,7 +416,7 @@ void QgsGeometryGeneratorSymbolLayer::render( QgsSymbolRenderContext &context, Q case Qgis::GeometryType::Polygon: { std::unique_ptr < QgsLineString > exterior( QgsLineString::fromQPolygonF( *points ) ); - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); polygon->setExteriorRing( exterior.release() ); if ( rings ) { diff --git a/src/core/symbology/qgsgraduatedsymbolrenderer.cpp b/src/core/symbology/qgsgraduatedsymbolrenderer.cpp index 45af09db707a..ae54d81ddfe5 100644 --- a/src/core/symbology/qgsgraduatedsymbolrenderer.cpp +++ b/src/core/symbology/qgsgraduatedsymbolrenderer.cpp @@ -412,7 +412,7 @@ QgsGraduatedSymbolRenderer *QgsGraduatedSymbolRenderer::createRenderer( Q_UNUSED( listForCboPrettyBreaks ) QgsRangeList ranges; - std::unique_ptr< QgsGraduatedSymbolRenderer > r = std::make_unique< QgsGraduatedSymbolRenderer >( attrName, ranges ); + auto r = std::make_unique< QgsGraduatedSymbolRenderer >( attrName, ranges ); r->setSourceSymbol( symbol->clone() ); r->setSourceColorRamp( ramp->clone() ); @@ -513,7 +513,7 @@ QgsFeatureRenderer *QgsGraduatedSymbolRenderer::create( QDomElement &element, co QString attrName = element.attribute( QStringLiteral( "attr" ) ); - std::unique_ptr< QgsGraduatedSymbolRenderer > r = std::make_unique< QgsGraduatedSymbolRenderer >( attrName, ranges ); + auto r = std::make_unique< QgsGraduatedSymbolRenderer >( attrName, ranges ); QString attrMethod = element.attribute( QStringLiteral( "graduatedMethod" ) ); if ( !attrMethod.isEmpty() ) diff --git a/src/core/symbology/qgsheatmaprenderer.cpp b/src/core/symbology/qgsheatmaprenderer.cpp index 98dfa74453c6..66dc63a767bc 100644 --- a/src/core/symbology/qgsheatmaprenderer.cpp +++ b/src/core/symbology/qgsheatmaprenderer.cpp @@ -396,7 +396,7 @@ QgsHeatmapRenderer *QgsHeatmapRenderer::convertFromRenderer( const QgsFeatureRen } else { - std::unique_ptr< QgsHeatmapRenderer > res = std::make_unique< QgsHeatmapRenderer >(); + auto res = std::make_unique< QgsHeatmapRenderer >(); renderer->copyRendererData( res.get() ); return res.release(); } diff --git a/src/core/symbology/qgsinvertedpolygonrenderer.cpp b/src/core/symbology/qgsinvertedpolygonrenderer.cpp index ab0a76372b8e..6ff8853ff2fd 100644 --- a/src/core/symbology/qgsinvertedpolygonrenderer.cpp +++ b/src/core/symbology/qgsinvertedpolygonrenderer.cpp @@ -109,13 +109,13 @@ QgsInvertedPolygonRenderer *QgsInvertedPolygonRenderer::convertFromRenderer( con renderer->type() == QLatin1String( "graduatedSymbol" ) || renderer->type() == QLatin1String( "RuleRenderer" ) ) { - std::unique_ptr< QgsInvertedPolygonRenderer > res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->clone() ); + auto res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->clone() ); renderer->copyRendererData( res.get() ); return res.release(); } else if ( renderer->type() == QLatin1String( "mergedFeatureRenderer" ) ) { - std::unique_ptr< QgsInvertedPolygonRenderer > res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->embeddedRenderer() ? renderer->embeddedRenderer()->clone() : nullptr ); + auto res = std::make_unique< QgsInvertedPolygonRenderer >( renderer->embeddedRenderer() ? renderer->embeddedRenderer()->clone() : nullptr ); renderer->copyRendererData( res.get() ); return res.release(); } diff --git a/src/core/symbology/qgslinearreferencingsymbollayer.cpp b/src/core/symbology/qgslinearreferencingsymbollayer.cpp index f06f42e79aae..55f9afe0c369 100644 --- a/src/core/symbology/qgslinearreferencingsymbollayer.cpp +++ b/src/core/symbology/qgslinearreferencingsymbollayer.cpp @@ -74,8 +74,8 @@ class QgsLinearReferencingSymbolLayerLabelProvider final : public QgsAbstractLab const QSizeF size = documentMetrics.documentSize( Qgis::TextLayoutMode::Point, Qgis::TextOrientation::Horizontal ); double uPP = context.mapToPixel().mapUnitsPerPixel(); - std::unique_ptr< QgsTextLabelFeatureWithFormat > feature = std::make_unique< QgsTextLabelFeatureWithFormat >( mLabels.size(), - QgsGeos::asGeos( &mapPoint ), QSizeF( size.width() * uPP, size.height() * uPP ), format ); + auto feature = std::make_unique< QgsTextLabelFeatureWithFormat >( mLabels.size(), + QgsGeos::asGeos( &mapPoint ), QSizeF( size.width() * uPP, size.height() * uPP ), format ); feature->setDocument( doc, documentMetrics ); feature->setFixedAngle( angleRadians ); @@ -121,7 +121,7 @@ QgsLinearReferencingSymbolLayer::~QgsLinearReferencingSymbolLayer() = default; QgsSymbolLayer *QgsLinearReferencingSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsLinearReferencingSymbolLayer > res = std::make_unique< QgsLinearReferencingSymbolLayer >(); + auto res = std::make_unique< QgsLinearReferencingSymbolLayer >(); res->setPlacement( qgsEnumKeyToValue( properties.value( QStringLiteral( "placement" ) ).toString(), Qgis::LinearReferencingPlacement::IntervalCartesian2D ) ); res->setLabelSource( qgsEnumKeyToValue( properties.value( QStringLiteral( "source" ) ).toString(), Qgis::LinearReferencingLabelSource::CartesianDistance2D ) ); bool ok = false; @@ -190,7 +190,7 @@ QgsSymbolLayer *QgsLinearReferencingSymbolLayer::create( const QVariantMap &prop QgsLinearReferencingSymbolLayer *QgsLinearReferencingSymbolLayer::clone() const { - std::unique_ptr< QgsLinearReferencingSymbolLayer > res = std::make_unique< QgsLinearReferencingSymbolLayer >(); + auto res = std::make_unique< QgsLinearReferencingSymbolLayer >(); res->setPlacement( mPlacement ); res->setLabelSource( mLabelSource ); res->setInterval( mInterval ); diff --git a/src/core/symbology/qgslinesymbollayer.cpp b/src/core/symbology/qgslinesymbollayer.cpp index cf48a1f5616c..33d058b3f892 100644 --- a/src/core/symbology/qgslinesymbollayer.cpp +++ b/src/core/symbology/qgslinesymbollayer.cpp @@ -2451,7 +2451,7 @@ QgsSymbolLayer *QgsMarkerLineSymbolLayer::create( const QVariantMap &props ) if ( props.contains( QStringLiteral( "rotate" ) ) ) rotate = ( props[QStringLiteral( "rotate" )].toString() == QLatin1String( "1" ) ); - std::unique_ptr< QgsMarkerLineSymbolLayer > x = std::make_unique< QgsMarkerLineSymbolLayer >( rotate, interval ); + auto x = std::make_unique< QgsMarkerLineSymbolLayer >( rotate, interval ); setCommonProperties( x.get(), props ); return x.release(); } @@ -2491,7 +2491,7 @@ void QgsMarkerLineSymbolLayer::stopRender( QgsSymbolRenderContext &context ) QgsMarkerLineSymbolLayer *QgsMarkerLineSymbolLayer::clone() const { - std::unique_ptr< QgsMarkerLineSymbolLayer > x = std::make_unique< QgsMarkerLineSymbolLayer >( rotateSymbols(), interval() ); + auto x = std::make_unique< QgsMarkerLineSymbolLayer >( rotateSymbols(), interval() ); copyTemplateSymbolProperties( x.get() ); return x.release(); } @@ -2774,7 +2774,7 @@ QgsSymbolLayer *QgsHashedLineSymbolLayer::create( const QVariantMap &props ) if ( props.contains( QStringLiteral( "rotate" ) ) ) rotate = ( props[QStringLiteral( "rotate" )] == QLatin1String( "1" ) ); - std::unique_ptr< QgsHashedLineSymbolLayer > x = std::make_unique< QgsHashedLineSymbolLayer >( rotate, interval ); + auto x = std::make_unique< QgsHashedLineSymbolLayer >( rotate, interval ); setCommonProperties( x.get(), props ); if ( props.contains( QStringLiteral( "hash_angle" ) ) ) { @@ -2828,7 +2828,7 @@ QVariantMap QgsHashedLineSymbolLayer::properties() const QgsHashedLineSymbolLayer *QgsHashedLineSymbolLayer::clone() const { - std::unique_ptr< QgsHashedLineSymbolLayer > x = std::make_unique< QgsHashedLineSymbolLayer >( rotateSymbols(), interval() ); + auto x = std::make_unique< QgsHashedLineSymbolLayer >( rotateSymbols(), interval() ); copyTemplateSymbolProperties( x.get() ); x->setHashAngle( mHashAngle ); x->setHashLength( mHashLength ); @@ -3338,7 +3338,7 @@ QgsRasterLineSymbolLayer::~QgsRasterLineSymbolLayer() = default; QgsSymbolLayer *QgsRasterLineSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsRasterLineSymbolLayer > res = std::make_unique(); + auto res = std::make_unique(); if ( properties.contains( QStringLiteral( "line_width" ) ) ) { @@ -3406,7 +3406,7 @@ QVariantMap QgsRasterLineSymbolLayer::properties() const QgsRasterLineSymbolLayer *QgsRasterLineSymbolLayer::clone() const { - std::unique_ptr< QgsRasterLineSymbolLayer > res = std::make_unique< QgsRasterLineSymbolLayer >( mPath ); + auto res = std::make_unique< QgsRasterLineSymbolLayer >( mPath ); res->setWidth( mWidth ); res->setWidthUnit( mWidthUnit ); res->setWidthMapUnitScale( mWidthMapUnitScale ); @@ -3583,7 +3583,7 @@ QgsLineburstSymbolLayer::~QgsLineburstSymbolLayer() = default; QgsSymbolLayer *QgsLineburstSymbolLayer::create( const QVariantMap &properties ) { - std::unique_ptr< QgsLineburstSymbolLayer > res = std::make_unique(); + auto res = std::make_unique(); if ( properties.contains( QStringLiteral( "line_width" ) ) ) { @@ -3669,7 +3669,7 @@ QVariantMap QgsLineburstSymbolLayer::properties() const QgsLineburstSymbolLayer *QgsLineburstSymbolLayer::clone() const { - std::unique_ptr< QgsLineburstSymbolLayer > res = std::make_unique< QgsLineburstSymbolLayer >(); + auto res = std::make_unique< QgsLineburstSymbolLayer >(); res->setWidth( mWidth ); res->setWidthUnit( mWidthUnit ); res->setWidthMapUnitScale( mWidthMapUnitScale ); @@ -3849,7 +3849,7 @@ QgsSymbolLayer *QgsFilledLineSymbolLayer::create( const QVariantMap &props ) width = props[QStringLiteral( "width" )].toDouble(); } - std::unique_ptr l = std::make_unique< QgsFilledLineSymbolLayer >( width, QgsFillSymbol::createSimple( props ) ); + auto l = std::make_unique< QgsFilledLineSymbolLayer >( width, QgsFillSymbol::createSimple( props ) ); if ( props.contains( QStringLiteral( "line_width_unit" ) ) ) { diff --git a/src/core/symbology/qgsmapinfosymbolconverter.cpp b/src/core/symbology/qgsmapinfosymbolconverter.cpp index 26eb958719f7..2a37cc919ccd 100644 --- a/src/core/symbology/qgsmapinfosymbolconverter.cpp +++ b/src/core/symbology/qgsmapinfosymbolconverter.cpp @@ -35,7 +35,7 @@ void QgsMapInfoSymbolConversionContext::pushWarning( const QString &warning ) QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, QgsMapInfoSymbolConversionContext &context, const QColor &foreColor, double size, Qgis::RenderUnit sizeUnit, bool interleaved ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); + auto simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); simpleLine->setWidthUnit( sizeUnit ); simpleLine->setPenCapStyle( Qt::RoundCap ); simpleLine->setPenJoinStyle( Qt::RoundJoin ); @@ -311,11 +311,11 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs simpleLine->setDashPatternOffsetUnit( sizeUnit ); } - std::unique_ptr< QgsLineSymbol > symbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << simpleLine.release() ); + auto symbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << simpleLine.release() ); if ( ( identifier >= 26 && identifier < 29 ) || ( identifier >= 31 && identifier < 34 ) || ( identifier >= 36 && identifier < 38 ) || ( identifier >= 47 && identifier <= 53 ) || identifier == 118 ) { - std::unique_ptr< QgsHashedLineSymbolLayer > hash = std::make_unique< QgsHashedLineSymbolLayer >(); + auto hash = std::make_unique< QgsHashedLineSymbolLayer >(); double spacing = 1; double offset = 1; @@ -432,12 +432,12 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs hash->setHashLength( length * size ); hash->setHashLengthUnit( sizeUnit ); - std::unique_ptr< QgsSimpleLineSymbolLayer > subSimpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); + auto subSimpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); subSimpleLine->setWidthUnit( sizeUnit ); subSimpleLine->setPenCapStyle( Qt::RoundCap ); subSimpleLine->setPenJoinStyle( Qt::RoundJoin ); - std::unique_ptr< QgsLineSymbol > subSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << subSimpleLine.release() ); + auto subSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << subSimpleLine.release() ); hash->setSubSymbol( subSymbol.release() ); if ( identifier == 31 || identifier == 33 ) @@ -499,7 +499,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs break; } - std::unique_ptr< QgsHashedLineSymbolLayer > hash = std::make_unique< QgsHashedLineSymbolLayer >(); + auto hash = std::make_unique< QgsHashedLineSymbolLayer >(); hash->setInterval( spacing * size * 2 ); hash->setIntervalUnit( sizeUnit ); @@ -509,12 +509,12 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs hash->setHashLength( 3.5 * size * 0.5 ); hash->setHashLengthUnit( sizeUnit ); - std::unique_ptr< QgsSimpleLineSymbolLayer > subSimpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); + auto subSimpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); subSimpleLine->setWidthUnit( sizeUnit ); subSimpleLine->setPenCapStyle( Qt::RoundCap ); subSimpleLine->setPenJoinStyle( Qt::RoundJoin ); - std::unique_ptr< QgsLineSymbol > subSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << subSimpleLine.release() ); + auto subSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << subSimpleLine.release() ); hash->setSubSymbol( subSymbol.release() ); std::unique_ptr< QgsHashedLineSymbolLayer > hash2( hash->clone() ); @@ -553,7 +553,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs } else if ( ( identifier >= 38 && identifier < 41 ) || ( identifier >= 54 && identifier <= 61 ) || ( identifier >= 78 && identifier <= 109 ) || ( identifier >= 114 && identifier <= 117 ) ) { - std::unique_ptr< QgsMarkerLineSymbolLayer > marker = std::make_unique< QgsMarkerLineSymbolLayer >(); + auto marker = std::make_unique< QgsMarkerLineSymbolLayer >(); double spacing = 1; double offset = 1; @@ -837,7 +837,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs marker->setOffset( lineOffset * size ); marker->setOffsetUnit( sizeUnit ); - std::unique_ptr< QgsSimpleMarkerSymbolLayer > subSimpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, markerSize * size ); + auto subSimpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, markerSize * size ); subSimpleMarker->setColor( foreColor ); subSimpleMarker->setSizeUnit( sizeUnit ); subSimpleMarker->setStrokeWidth( size ); @@ -856,7 +856,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs subSimpleMarker->setStrokeStyle( Qt::NoPen ); } - std::unique_ptr< QgsMarkerSymbol > subSymbol = std::make_unique< QgsMarkerSymbol >( QgsSymbolLayerList() << subSimpleMarker.release() ); + auto subSymbol = std::make_unique< QgsMarkerSymbol >( QgsSymbolLayerList() << subSimpleMarker.release() ); marker->setSubSymbol( subSymbol.release() ); if ( identifier == 56 ) @@ -909,7 +909,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs symbol->appendSymbolLayer( dashLine.release() ); } - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 1.6 * size ); + auto simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 1.6 * size ); simpleLine2->setWidthUnit( sizeUnit ); simpleLine2->setPenCapStyle( Qt::RoundCap ); simpleLine2->setPenJoinStyle( Qt::RoundJoin ); @@ -922,7 +922,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs } else if ( identifier == 45 ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 1.6 * size ); + auto simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 1.6 * size ); simpleLine2->setWidthUnit( sizeUnit ); simpleLine2->setPenCapStyle( Qt::RoundCap ); simpleLine2->setPenJoinStyle( Qt::RoundJoin ); @@ -935,7 +935,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs } else if ( identifier == 46 ) { - std::unique_ptr< QgsHashedLineSymbolLayer > hashLine = std::make_unique< QgsHashedLineSymbolLayer >(); + auto hashLine = std::make_unique< QgsHashedLineSymbolLayer >(); hashLine->setInterval( 4 * size ); hashLine->setIntervalUnit( sizeUnit ); @@ -950,12 +950,12 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs } else if ( identifier == 62 ) { - std::unique_ptr< QgsMarkerLineSymbolLayer > markerLine = std::make_unique< QgsMarkerLineSymbolLayer >(); + auto markerLine = std::make_unique< QgsMarkerLineSymbolLayer >(); markerLine->setPlacements( Qgis::MarkerLinePlacement::FirstVertex ); markerLine->setOffsetAlongLine( 2 * size ); markerLine->setOffsetAlongLineUnit( sizeUnit ); - std::unique_ptr< QgsSimpleMarkerSymbolLayer > subSimpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Line, size * 4 ); + auto subSimpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Line, size * 4 ); subSimpleMarker->setColor( foreColor ); subSimpleMarker->setSizeUnit( sizeUnit ); subSimpleMarker->setStrokeWidth( 1.25 * size ); @@ -965,7 +965,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs subSimpleMarker->setPenJoinStyle( Qt::RoundJoin ); subSimpleMarker->setPenCapStyle( Qt::RoundCap ); - std::unique_ptr< QgsMarkerSymbol > subSymbol = std::make_unique< QgsMarkerSymbol >( QgsSymbolLayerList() << subSimpleMarker.release() ); + auto subSymbol = std::make_unique< QgsMarkerSymbol >( QgsSymbolLayerList() << subSimpleMarker.release() ); markerLine->setSubSymbol( subSymbol.release() ); symbol->appendSymbolLayer( markerLine.release() ); @@ -1011,7 +1011,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs if ( identifier == 75 || identifier == 76 ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 255, 255, 255 ), upperLine->width() ); + auto middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 255, 255, 255 ), upperLine->width() ); middleLine->setWidthUnit( sizeUnit ); middleLine->setLocked( true ); middleLine->setPenCapStyle( Qt::RoundCap ); @@ -1029,7 +1029,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs if ( identifier == 64 || identifier == 66 ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( identifier == 64 ? foreColor : QColor( 0, 0, 0 ), 0 ); + auto middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( identifier == 64 ? foreColor : QColor( 0, 0, 0 ), 0 ); if ( identifier == 66 ) middleLine->setLocked( true ); @@ -1042,9 +1042,9 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs else if ( identifier == 69 ) { - std::unique_ptr< QgsHashedLineSymbolLayer > hashedLine = std::make_unique< QgsHashedLineSymbolLayer >(); + auto hashedLine = std::make_unique< QgsHashedLineSymbolLayer >(); - std::unique_ptr< QgsSimpleLineSymbolLayer > middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 0 ); + auto middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, 0 ); hashedLine->setSubSymbol( new QgsLineSymbol( { middleLine.release() } ) ); hashedLine->setInterval( 18 * size ); hashedLine->setIntervalUnit( sizeUnit ); @@ -1061,7 +1061,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs } else if ( identifier == 77 ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 255, 255, 255 ), qgis::down_cast< QgsSimpleLineSymbolLayer * >( symbol->symbolLayer( 1 ) )->width() ); + auto middleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 255, 255, 255 ), qgis::down_cast< QgsSimpleLineSymbolLayer * >( symbol->symbolLayer( 1 ) )->width() ); middleLine->setWidthUnit( sizeUnit ); middleLine->setLocked( true ); middleLine->setPenCapStyle( Qt::RoundCap ); @@ -1081,7 +1081,7 @@ QgsLineSymbol *QgsMapInfoSymbolConverter::convertLineSymbol( int identifier, Qgs qgis::down_cast< QgsSimpleLineSymbolLayer * >( symbol->symbolLayer( 0 ) )->setColor( QColor( 0, 0, 0 ) ); qgis::down_cast< QgsSimpleLineSymbolLayer * >( symbol->symbolLayer( 0 ) )->setLocked( true ); - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); + auto simpleLine2 = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, size ); simpleLine2->setWidthUnit( sizeUnit ); simpleLine2->setPenCapStyle( Qt::RoundCap ); simpleLine2->setPenJoinStyle( Qt::RoundJoin ); @@ -1354,7 +1354,7 @@ QgsFillSymbol *QgsMapInfoSymbolConverter::convertFillSymbol( int identifier, Qgs QgsSymbolLayerList layers; if ( backColor.isValid() && style != Qt::SolidPattern && ( useLineFill || style != Qt::NoBrush ) ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > backgroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( backColor ); + auto backgroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( backColor ); backgroundFill->setLocked( true ); backgroundFill->setStrokeStyle( Qt::NoPen ); layers << backgroundFill.release(); @@ -1362,16 +1362,16 @@ QgsFillSymbol *QgsMapInfoSymbolConverter::convertFillSymbol( int identifier, Qgs if ( !useLineFill ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > foregroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( foreColor ); + auto foregroundFill = std::make_unique< QgsSimpleFillSymbolLayer >( foreColor ); foregroundFill->setBrushStyle( style ); foregroundFill->setStrokeStyle( Qt::NoPen ); layers << foregroundFill.release(); } else { - std::unique_ptr< QgsLinePatternFillSymbolLayer > lineFill = std::make_unique< QgsLinePatternFillSymbolLayer >(); + auto lineFill = std::make_unique< QgsLinePatternFillSymbolLayer >(); - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, lineWidth ); + auto simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( foreColor, lineWidth ); simpleLine->setWidthUnit( Qgis::RenderUnit::Points ); lineFill->setSubSymbol( new QgsLineSymbol( QgsSymbolLayerList() << simpleLine.release() ) ); @@ -1513,7 +1513,7 @@ QgsMarkerSymbol *QgsMapInfoSymbolConverter::convertMarkerSymbol( int identifier, return nullptr; } - std::unique_ptr< QgsSimpleMarkerSymbolLayer > simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, size ); + auto simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( shape, size ); simpleMarker->setSizeUnit( sizeUnit ); simpleMarker->setAngle( angle ); simpleMarker->setVerticalAnchorPoint( vertAlign ); diff --git a/src/core/symbology/qgsmarkersymbollayer.cpp b/src/core/symbology/qgsmarkersymbollayer.cpp index 86eb93fa6a82..a93ab3a254fa 100644 --- a/src/core/symbology/qgsmarkersymbollayer.cpp +++ b/src/core/symbology/qgsmarkersymbollayer.cpp @@ -3043,7 +3043,7 @@ QgsSymbolLayer *QgsRasterMarkerSymbolLayer::create( const QVariantMap &props ) if ( props.contains( QStringLiteral( "scale_method" ) ) ) scaleMethod = QgsSymbolLayerUtils::decodeScaleMethod( props[QStringLiteral( "scale_method" )].toString() ); - std::unique_ptr< QgsRasterMarkerSymbolLayer > m = std::make_unique< QgsRasterMarkerSymbolLayer >( path, size, angle, scaleMethod ); + auto m = std::make_unique< QgsRasterMarkerSymbolLayer >( path, size, angle, scaleMethod ); m->setCommonProperties( props ); return m.release(); } @@ -3365,7 +3365,7 @@ QVariantMap QgsRasterMarkerSymbolLayer::properties() const QgsRasterMarkerSymbolLayer *QgsRasterMarkerSymbolLayer::clone() const { - std::unique_ptr< QgsRasterMarkerSymbolLayer > m = std::make_unique< QgsRasterMarkerSymbolLayer >( mPath, mSize, mAngle ); + auto m = std::make_unique< QgsRasterMarkerSymbolLayer >( mPath, mSize, mAngle ); copyCommonProperties( m.get() ); return m.release(); } @@ -4051,7 +4051,7 @@ QgsSymbolLayer *QgsAnimatedMarkerSymbolLayer::create( const QVariantMap &propert if ( properties.contains( QStringLiteral( "angle" ) ) ) angle = properties[QStringLiteral( "angle" )].toDouble(); - std::unique_ptr< QgsAnimatedMarkerSymbolLayer > m = std::make_unique< QgsAnimatedMarkerSymbolLayer >( path, size, angle ); + auto m = std::make_unique< QgsAnimatedMarkerSymbolLayer >( path, size, angle ); m->setFrameRate( properties.value( QStringLiteral( "frameRate" ), QStringLiteral( "10" ) ).toDouble() ); m->setCommonProperties( properties ); @@ -4072,7 +4072,7 @@ QVariantMap QgsAnimatedMarkerSymbolLayer::properties() const QgsAnimatedMarkerSymbolLayer *QgsAnimatedMarkerSymbolLayer::clone() const { - std::unique_ptr< QgsAnimatedMarkerSymbolLayer > m = std::make_unique< QgsAnimatedMarkerSymbolLayer >( mPath, mSize, mAngle ); + auto m = std::make_unique< QgsAnimatedMarkerSymbolLayer >( mPath, mSize, mAngle ); m->setFrameRate( mFrameRateFps ); copyCommonProperties( m.get() ); return m.release(); diff --git a/src/core/symbology/qgsmergedfeaturerenderer.cpp b/src/core/symbology/qgsmergedfeaturerenderer.cpp index dd7f388bcf9c..2c354bada5a4 100644 --- a/src/core/symbology/qgsmergedfeaturerenderer.cpp +++ b/src/core/symbology/qgsmergedfeaturerenderer.cpp @@ -592,13 +592,13 @@ QgsMergedFeatureRenderer *QgsMergedFeatureRenderer::convertFromRenderer( const Q renderer->type() == QLatin1String( "graduatedSymbol" ) || renderer->type() == QLatin1String( "RuleRenderer" ) ) { - std::unique_ptr< QgsMergedFeatureRenderer > res = std::make_unique< QgsMergedFeatureRenderer >( renderer->clone() ); + auto res = std::make_unique< QgsMergedFeatureRenderer >( renderer->clone() ); renderer->copyRendererData( res.get() ); return res.release(); } else if ( renderer->type() == QLatin1String( "invertedPolygonRenderer" ) ) { - std::unique_ptr< QgsMergedFeatureRenderer > res = std::make_unique< QgsMergedFeatureRenderer >( renderer->embeddedRenderer() ? renderer->embeddedRenderer()->clone() : nullptr ); + auto res = std::make_unique< QgsMergedFeatureRenderer >( renderer->embeddedRenderer() ? renderer->embeddedRenderer()->clone() : nullptr ); renderer->copyRendererData( res.get() ); return res.release(); } diff --git a/src/core/symbology/qgsnullsymbolrenderer.cpp b/src/core/symbology/qgsnullsymbolrenderer.cpp index e2c05832d65d..b86caf6c40de 100644 --- a/src/core/symbology/qgsnullsymbolrenderer.cpp +++ b/src/core/symbology/qgsnullsymbolrenderer.cpp @@ -121,7 +121,7 @@ QDomElement QgsNullSymbolRenderer::save( QDomDocument &doc, const QgsReadWriteCo QgsNullSymbolRenderer *QgsNullSymbolRenderer::convertFromRenderer( const QgsFeatureRenderer *renderer ) { - std::unique_ptr< QgsNullSymbolRenderer > res = std::make_unique< QgsNullSymbolRenderer >(); + auto res = std::make_unique< QgsNullSymbolRenderer >(); renderer->copyRendererData( res.get() ); return res.release(); } diff --git a/src/core/symbology/qgsrulebasedrenderer.cpp b/src/core/symbology/qgsrulebasedrenderer.cpp index 0fdf48dc11dd..5b2ec2f20b8b 100644 --- a/src/core/symbology/qgsrulebasedrenderer.cpp +++ b/src/core/symbology/qgsrulebasedrenderer.cpp @@ -1496,14 +1496,14 @@ QgsRuleBasedRenderer *QgsRuleBasedRenderer::convertFromRenderer( const QgsFeatur attr = QgsExpression::quotedColumnRef( attr ); } - std::unique_ptr< QgsRuleBasedRenderer::Rule > rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); QString expression; QString value; QgsRendererCategory category; for ( const QgsRendererCategory &category : categorizedRenderer->categories() ) { - std::unique_ptr< QgsRuleBasedRenderer::Rule > rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); rule->setLabel( category.label() ); @@ -1600,14 +1600,14 @@ QgsRuleBasedRenderer *QgsRuleBasedRenderer::convertFromRenderer( const QgsFeatur attr = QStringLiteral( "(%1)" ).arg( attr ); } - std::unique_ptr< QgsRuleBasedRenderer::Rule > rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); QString expression; QgsRendererRange range; for ( int i = 0; i < graduatedRenderer->ranges().size(); ++i ) { range = graduatedRenderer->ranges().value( i ); - std::unique_ptr< QgsRuleBasedRenderer::Rule > rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); rule->setLabel( range.label() ); if ( i == 0 )//The lower boundary of the first range is included, while it is excluded for the others { @@ -1652,7 +1652,7 @@ QgsRuleBasedRenderer *QgsRuleBasedRenderer::convertFromRenderer( const QgsFeatur { const QgsEmbeddedSymbolRenderer *embeddedRenderer = dynamic_cast( renderer ); - std::unique_ptr< QgsRuleBasedRenderer::Rule > rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rootrule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); QgsFeatureRequest req; req.setFlags( Qgis::FeatureRequestFlag::EmbeddedSymbols | Qgis::FeatureRequestFlag::NoGeometry ); @@ -1663,7 +1663,7 @@ QgsRuleBasedRenderer *QgsRuleBasedRenderer::convertFromRenderer( const QgsFeatur { if ( feature.embeddedSymbol() ) { - std::unique_ptr< QgsRuleBasedRenderer::Rule > rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); rule->setFilterExpression( QStringLiteral( "$id=%1" ).arg( feature.id() ) ); rule->setLabel( QString::number( feature.id() ) ); rule->setSymbol( feature.embeddedSymbol()->clone() ); @@ -1671,7 +1671,7 @@ QgsRuleBasedRenderer *QgsRuleBasedRenderer::convertFromRenderer( const QgsFeatur } } - std::unique_ptr< QgsRuleBasedRenderer::Rule > rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); + auto rule = std::make_unique< QgsRuleBasedRenderer::Rule >( nullptr ); rule->setFilterExpression( QStringLiteral( "ELSE" ) ); rule->setLabel( QObject::tr( "All other features" ) ); rule->setSymbol( embeddedRenderer->defaultSymbol()->clone() ); diff --git a/src/core/symbology/qgsstyle.cpp b/src/core/symbology/qgsstyle.cpp index e8f0dada2b9b..3eb2de9d5149 100644 --- a/src/core/symbology/qgsstyle.cpp +++ b/src/core/symbology/qgsstyle.cpp @@ -80,16 +80,16 @@ QgsStyle *QgsStyle::sDefaultStyle = nullptr; QgsStyle::QgsStyle( QObject *parent ) : QObject( parent ) { - std::unique_ptr< QgsSimpleMarkerSymbolLayer > simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Circle, - 1.6, 0, Qgis::ScaleMethod::ScaleArea, QColor( 84, 176, 74 ), QColor( 61, 128, 53 ) ); + auto simpleMarker = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Circle, + 1.6, 0, Qgis::ScaleMethod::ScaleArea, QColor( 84, 176, 74 ), QColor( 61, 128, 53 ) ); simpleMarker->setStrokeWidth( 0.4 ); mPatchMarkerSymbol = std::make_unique< QgsMarkerSymbol >( QgsSymbolLayerList() << simpleMarker.release() ); - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 84, 176, 74 ), 0.6 ); + auto simpleLine = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 84, 176, 74 ), 0.6 ); mPatchLineSymbol = std::make_unique< QgsLineSymbol >( QgsSymbolLayerList() << simpleLine.release() ); - std::unique_ptr< QgsGradientFillSymbolLayer > gradientFill = std::make_unique< QgsGradientFillSymbolLayer >( QColor( 66, 150, 63 ), QColor( 84, 176, 74 ) ); - std::unique_ptr< QgsSimpleLineSymbolLayer > simpleOutline = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 56, 128, 54 ), 0.26 ); + auto gradientFill = std::make_unique< QgsGradientFillSymbolLayer >( QColor( 66, 150, 63 ), QColor( 84, 176, 74 ) ); + auto simpleOutline = std::make_unique< QgsSimpleLineSymbolLayer >( QColor( 56, 128, 54 ), 0.26 ); mPatchFillSymbol = std::make_unique< QgsFillSymbol >( QgsSymbolLayerList() << gradientFill.release() << simpleOutline.release() ); } diff --git a/src/core/symbology/qgssvgcache.cpp b/src/core/symbology/qgssvgcache.cpp index f157a5239db5..dd3ea7c34700 100644 --- a/src/core/symbology/qgssvgcache.cpp +++ b/src/core/symbology/qgssvgcache.cpp @@ -433,7 +433,7 @@ void QgsSvgCache::cacheImage( QgsSvgCacheEntry *entry ) const QSize imageSize = sizeForImage( *entry, viewBoxSize, scaledSize ); // cast double image sizes to int for QImage - std::unique_ptr< QImage > image = std::make_unique< QImage >( imageSize, QImage::Format_ARGB32_Premultiplied ); + auto image = std::make_unique< QImage >( imageSize, QImage::Format_ARGB32_Premultiplied ); image->fill( 0 ); // transparent background const bool isFixedAR = entry->fixedAspectRatio > 0; @@ -469,7 +469,7 @@ void QgsSvgCache::cachePicture( QgsSvgCacheEntry *entry, bool forceVectorOutput const bool isFixedAR = entry->fixedAspectRatio > 0; //correct QPictures dpi correction - std::unique_ptr< QPicture > picture = std::make_unique< QPicture >(); + auto picture = std::make_unique< QPicture >(); QRectF rect; QSvgRenderer r( entry->svgContent ); double hwRatio = 1.0; diff --git a/src/core/symbology/qgssymbollayerutils.cpp b/src/core/symbology/qgssymbollayerutils.cpp index 2ee8bd20c1e6..ba66abd62f0f 100644 --- a/src/core/symbology/qgssymbollayerutils.cpp +++ b/src/core/symbology/qgssymbollayerutils.cpp @@ -1349,7 +1349,7 @@ QgsSymbol *QgsSymbolLayerUtils::loadSymbol( const QDomElement &element, const Qg if ( !element.firstChildElement( QStringLiteral( "buffer" ) ).isNull() ) { - std::unique_ptr< QgsSymbolBufferSettings > bufferSettings = std::make_unique< QgsSymbolBufferSettings >(); + auto bufferSettings = std::make_unique< QgsSymbolBufferSettings >(); bufferSettings->readXml( element, context ); symbol->setBufferSettings( bufferSettings.release() ); } diff --git a/src/core/textrenderer/qgstextrendererutils.cpp b/src/core/textrenderer/qgstextrendererutils.cpp index ee01be6240fc..0868d1269de4 100644 --- a/src/core/textrenderer/qgstextrendererutils.cpp +++ b/src/core/textrenderer/qgstextrendererutils.cpp @@ -193,7 +193,7 @@ std::unique_ptr< QgsTextRendererUtils::CurvePlacementProperties > QgsTextRendere std::unique_ptr< QgsTextRendererUtils::CurvePlacementProperties > QgsTextRendererUtils::generateCurvedTextPlacementPrivate( const QgsPrecalculatedTextMetrics &metrics, const double *x, const double *y, int numPoints, const std::vector &pathDistances, double offsetAlongLine, LabelLineDirection direction, CurvedTextFlags flags, double maxConcaveAngle, double maxConvexAngle, bool isSecondAttempt ) { - std::unique_ptr< CurvePlacementProperties > output = std::make_unique< CurvePlacementProperties >(); + auto output = std::make_unique< CurvePlacementProperties >(); output->graphemePlacement.reserve( metrics.count() ); double offsetAlongSegment = offsetAlongLine; diff --git a/src/core/tiledscene/qgscesiumtilesdataprovider.cpp b/src/core/tiledscene/qgscesiumtilesdataprovider.cpp index b52e2d8f4e0a..d9824e98c452 100644 --- a/src/core/tiledscene/qgscesiumtilesdataprovider.cpp +++ b/src/core/tiledscene/qgscesiumtilesdataprovider.cpp @@ -195,7 +195,7 @@ QgsCesiumTiledSceneIndex::QgsCesiumTiledSceneIndex( const json &tileset, const Q std::unique_ptr< QgsTiledSceneTile > QgsCesiumTiledSceneIndex::tileFromJson( const json &json, const QUrl &baseUrl, const QgsTiledSceneTile *parent, Qgis::Axis gltfUpAxis ) { - std::unique_ptr< QgsTiledSceneTile > tile = std::make_unique< QgsTiledSceneTile >( mNextTileId++ ); + auto tile = std::make_unique< QgsTiledSceneTile >( mNextTileId++ ); tile->setBaseUrl( baseUrl ); tile->setMetadata( @@ -348,7 +348,7 @@ std::unique_ptr< QgsTiledSceneTile > QgsCesiumTiledSceneIndex::tileFromJson( con QgsTiledSceneNode *QgsCesiumTiledSceneIndex::nodeFromJson( const json &json, const QUrl &baseUrl, QgsTiledSceneNode *parent, Qgis::Axis gltfUpAxis ) { std::unique_ptr< QgsTiledSceneTile > tile = tileFromJson( json, baseUrl, parent ? parent->tile() : nullptr, gltfUpAxis ); - std::unique_ptr< QgsTiledSceneNode > newNode = std::make_unique< QgsTiledSceneNode >( tile.release() ); + auto newNode = std::make_unique< QgsTiledSceneNode >( tile.release() ); mNodeMap.insert( newNode->tile()->id(), newNode.get() ); if ( parent ) diff --git a/src/core/tiledscene/qgstiledsceneboundingvolume.cpp b/src/core/tiledscene/qgstiledsceneboundingvolume.cpp index 082ca82f7346..95d0c2e72efc 100644 --- a/src/core/tiledscene/qgstiledsceneboundingvolume.cpp +++ b/src/core/tiledscene/qgstiledsceneboundingvolume.cpp @@ -66,7 +66,7 @@ QgsBox3D QgsTiledSceneBoundingVolume::bounds( const QgsCoordinateTransform &tran QgsAbstractGeometry *QgsTiledSceneBoundingVolume::as2DGeometry( const QgsCoordinateTransform &transform, Qgis::TransformDirection direction ) const { - std::unique_ptr< QgsPolygon > polygon = std::make_unique< QgsPolygon >(); + auto polygon = std::make_unique< QgsPolygon >(); const QVector< QgsVector3D > corners = mBox.corners(); QVector< double > x; @@ -88,7 +88,7 @@ QgsAbstractGeometry *QgsTiledSceneBoundingVolume::as2DGeometry( const QgsCoordin transform.transformInPlace( x, y, z, direction ); } - std::unique_ptr< QgsMultiPoint > mp = std::make_unique< QgsMultiPoint >( x, y ); + auto mp = std::make_unique< QgsMultiPoint >( x, y ); QgsGeos geosMp( mp.get() ); return geosMp.convexHull(); } diff --git a/src/core/tiledscene/qgstiledscenelayerelevationproperties.cpp b/src/core/tiledscene/qgstiledscenelayerelevationproperties.cpp index 2659af5105b6..233ae977cc2f 100644 --- a/src/core/tiledscene/qgstiledscenelayerelevationproperties.cpp +++ b/src/core/tiledscene/qgstiledscenelayerelevationproperties.cpp @@ -48,7 +48,7 @@ bool QgsTiledSceneLayerElevationProperties::readXml( const QDomElement &element, QgsTiledSceneLayerElevationProperties *QgsTiledSceneLayerElevationProperties::clone() const { - std::unique_ptr< QgsTiledSceneLayerElevationProperties > res = std::make_unique< QgsTiledSceneLayerElevationProperties >( nullptr ); + auto res = std::make_unique< QgsTiledSceneLayerElevationProperties >( nullptr ); res->copyCommonProperties( this ); return res.release(); diff --git a/src/core/tiledscene/qgstiledscenetexturerenderer.cpp b/src/core/tiledscene/qgstiledscenetexturerenderer.cpp index 6a477f5f1f47..43b3799e387c 100644 --- a/src/core/tiledscene/qgstiledscenetexturerenderer.cpp +++ b/src/core/tiledscene/qgstiledscenetexturerenderer.cpp @@ -34,7 +34,7 @@ QString QgsTiledSceneTextureRenderer::type() const QgsTiledSceneRenderer *QgsTiledSceneTextureRenderer::clone() const { - std::unique_ptr< QgsTiledSceneTextureRenderer > res = std::make_unique< QgsTiledSceneTextureRenderer >(); + auto res = std::make_unique< QgsTiledSceneTextureRenderer >(); res->setFillSymbol( mFillSymbol->clone() ); copyCommonProperties( res.get() ); @@ -44,7 +44,7 @@ QgsTiledSceneRenderer *QgsTiledSceneTextureRenderer::clone() const QgsTiledSceneRenderer *QgsTiledSceneTextureRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsTiledSceneTextureRenderer > r = std::make_unique< QgsTiledSceneTextureRenderer >(); + auto r = std::make_unique< QgsTiledSceneTextureRenderer >(); { const QDomElement fillSymbolElem = element.firstChildElement( QStringLiteral( "fillSymbol" ) ); if ( !fillSymbolElem.isNull() ) diff --git a/src/core/tiledscene/qgstiledscenewireframerenderer.cpp b/src/core/tiledscene/qgstiledscenewireframerenderer.cpp index 1b1a0a534a6d..fb9614d20d4f 100644 --- a/src/core/tiledscene/qgstiledscenewireframerenderer.cpp +++ b/src/core/tiledscene/qgstiledscenewireframerenderer.cpp @@ -35,7 +35,7 @@ QString QgsTiledSceneWireframeRenderer::type() const QgsTiledSceneRenderer *QgsTiledSceneWireframeRenderer::clone() const { - std::unique_ptr< QgsTiledSceneWireframeRenderer > res = std::make_unique< QgsTiledSceneWireframeRenderer >(); + auto res = std::make_unique< QgsTiledSceneWireframeRenderer >(); res->setFillSymbol( mFillSymbol->clone() ); res->setLineSymbol( mLineSymbol->clone() ); @@ -48,7 +48,7 @@ QgsTiledSceneRenderer *QgsTiledSceneWireframeRenderer::clone() const QgsTiledSceneRenderer *QgsTiledSceneWireframeRenderer::create( QDomElement &element, const QgsReadWriteContext &context ) { - std::unique_ptr< QgsTiledSceneWireframeRenderer > r = std::make_unique< QgsTiledSceneWireframeRenderer >(); + auto r = std::make_unique< QgsTiledSceneWireframeRenderer >(); { const QDomElement fillSymbolElem = element.firstChildElement( QStringLiteral( "fillSymbol" ) ); if ( !fillSymbolElem.isNull() ) diff --git a/src/core/vector/qgsfielddomain.cpp b/src/core/vector/qgsfielddomain.cpp index 058d6ba9a77a..d73d96454aa3 100644 --- a/src/core/vector/qgsfielddomain.cpp +++ b/src/core/vector/qgsfielddomain.cpp @@ -85,7 +85,7 @@ QString QgsCodedFieldDomain::typeName() const QgsCodedFieldDomain *QgsCodedFieldDomain::clone() const { - std::unique_ptr< QgsCodedFieldDomain > res = std::make_unique< QgsCodedFieldDomain >( mName, mDescription, mFieldType, mValues ); + auto res = std::make_unique< QgsCodedFieldDomain >( mName, mDescription, mFieldType, mValues ); res->mSplitPolicy = mSplitPolicy; res->mMergePolicy = mMergePolicy; return res.release(); @@ -122,7 +122,7 @@ QString QgsRangeFieldDomain::typeName() const QgsRangeFieldDomain *QgsRangeFieldDomain::clone() const { - std::unique_ptr< QgsRangeFieldDomain > res = std::make_unique< QgsRangeFieldDomain >( mName, mDescription, mFieldType, mMin, mMinIsInclusive, mMax, mMaxIsInclusive ); + auto res = std::make_unique< QgsRangeFieldDomain >( mName, mDescription, mFieldType, mMin, mMinIsInclusive, mMax, mMaxIsInclusive ); res->mSplitPolicy = mSplitPolicy; res->mMergePolicy = mMergePolicy; return res.release(); @@ -157,7 +157,7 @@ QString QgsGlobFieldDomain::typeName() const QgsGlobFieldDomain *QgsGlobFieldDomain::clone() const { - std::unique_ptr< QgsGlobFieldDomain > res = std::make_unique< QgsGlobFieldDomain >( mName, mDescription, mFieldType, mGlob ); + auto res = std::make_unique< QgsGlobFieldDomain >( mName, mDescription, mFieldType, mGlob ); res->mSplitPolicy = mSplitPolicy; res->mMergePolicy = mMergePolicy; return res.release(); diff --git a/src/core/vector/qgsvectorlayer.cpp b/src/core/vector/qgsvectorlayer.cpp index 38452e9d9ed4..a08758adeaa2 100644 --- a/src/core/vector/qgsvectorlayer.cpp +++ b/src/core/vector/qgsvectorlayer.cpp @@ -4397,7 +4397,7 @@ void QgsVectorLayer::destroyEditCommand() // and delete, so we add a dummy obsolete command to force this to occur. // Pushing the new command deletes the destroyed one, and since the new // command is obsolete it's automatically deleted by the undo stack. - std::unique_ptr< QUndoCommand > command = std::make_unique< QUndoCommand >(); + auto command = std::make_unique< QUndoCommand >(); command->setObsolete( true ); undoStack()->push( command.release() ); diff --git a/src/core/vector/qgsvectorlayerelevationproperties.cpp b/src/core/vector/qgsvectorlayerelevationproperties.cpp index 09a6518c3182..4c8b2cb0e284 100644 --- a/src/core/vector/qgsvectorlayerelevationproperties.cpp +++ b/src/core/vector/qgsvectorlayerelevationproperties.cpp @@ -162,7 +162,7 @@ void QgsVectorLayerElevationProperties::setDefaultsFromLayer( QgsMapLayer *layer QgsVectorLayerElevationProperties *QgsVectorLayerElevationProperties::clone() const { - std::unique_ptr< QgsVectorLayerElevationProperties > res = std::make_unique< QgsVectorLayerElevationProperties >( nullptr ); + auto res = std::make_unique< QgsVectorLayerElevationProperties >( nullptr ); res->setClamping( mClamping ); res->setBinding( mBinding ); res->setType( mType ); @@ -426,13 +426,13 @@ void QgsVectorLayerElevationProperties::setShowMarkerSymbolInSurfacePlots( bool void QgsVectorLayerElevationProperties::setDefaultProfileLineSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleLineSymbolLayer > profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); + auto profileLineLayer = std::make_unique< QgsSimpleLineSymbolLayer >( color, 0.6 ); mProfileLineSymbol = std::make_unique< QgsLineSymbol>( QgsSymbolLayerList( { profileLineLayer.release() } ) ); } void QgsVectorLayerElevationProperties::setDefaultProfileMarkerSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleMarkerSymbolLayer > profileMarkerLayer = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Diamond, 3 ); + auto profileMarkerLayer = std::make_unique< QgsSimpleMarkerSymbolLayer >( Qgis::MarkerShape::Diamond, 3 ); profileMarkerLayer->setColor( color ); profileMarkerLayer->setStrokeWidth( 0.2 ); profileMarkerLayer->setStrokeColor( color.darker( 140 ) ); @@ -441,7 +441,7 @@ void QgsVectorLayerElevationProperties::setDefaultProfileMarkerSymbol( const QCo void QgsVectorLayerElevationProperties::setDefaultProfileFillSymbol( const QColor &color ) { - std::unique_ptr< QgsSimpleFillSymbolLayer > profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); + auto profileFillLayer = std::make_unique< QgsSimpleFillSymbolLayer >( color ); profileFillLayer->setStrokeWidth( 0.2 ); profileFillLayer->setStrokeColor( color.darker( 140 ) ); mProfileFillSymbol = std::make_unique< QgsFillSymbol>( QgsSymbolLayerList( { profileFillLayer.release() } ) ); diff --git a/src/core/vector/qgsvectorlayerfeatureiterator.cpp b/src/core/vector/qgsvectorlayerfeatureiterator.cpp index 18569d3e8ca0..611d990e487e 100644 --- a/src/core/vector/qgsvectorlayerfeatureiterator.cpp +++ b/src/core/vector/qgsvectorlayerfeatureiterator.cpp @@ -852,7 +852,7 @@ void QgsVectorLayerFeatureIterator::prepareExpression( int fieldIdx ) const QList &exps = mSource->mExpressionFieldBuffer->expressions(); const int oi = mSource->mFields.fieldOriginIndex( fieldIdx ); - std::unique_ptr exp = std::make_unique( exps[oi].cachedExpression ); + auto exp = std::make_unique( exps[oi].cachedExpression ); QgsDistanceArea da; da.setSourceCrs( mSource->mCrs, QgsProject::instance()->transformContext() ); // skip-keyword-check diff --git a/src/core/vector/qgsvectorlayerprofilegenerator.cpp b/src/core/vector/qgsvectorlayerprofilegenerator.cpp index dfdb408af247..1bf679dd5c00 100644 --- a/src/core/vector/qgsvectorlayerprofilegenerator.cpp +++ b/src/core/vector/qgsvectorlayerprofilegenerator.cpp @@ -1012,15 +1012,15 @@ void QgsVectorLayerProfileGenerator::processIntersectionCurve( const QgsLineStri // create geometries from vector data if ( mExtrusionEnabled ) { - std::unique_ptr< QgsLineString > ring = std::make_unique< QgsLineString >( newX, newY, newZ ); - std::unique_ptr< QgsLineString > extrudedRing = std::make_unique< QgsLineString >( newX, newY, extrudedZ ); + auto ring = std::make_unique< QgsLineString >( newX, newY, newZ ); + auto extrudedRing = std::make_unique< QgsLineString >( newX, newY, extrudedZ ); std::unique_ptr< QgsLineString > reversedExtrusion( extrudedRing->reversed() ); ring->append( reversedExtrusion.get() ); ring->close(); resultFeature.geometry = QgsGeometry( new QgsPolygon( ring.release() ) ); - std::unique_ptr< QgsLineString > distanceVHeightRing = std::make_unique< QgsLineString >( newDistance, newZ ); - std::unique_ptr< QgsLineString > extrudedDistanceVHeightRing = std::make_unique< QgsLineString >( newDistance, extrudedZ ); + auto distanceVHeightRing = std::make_unique< QgsLineString >( newDistance, newZ ); + auto extrudedDistanceVHeightRing = std::make_unique< QgsLineString >( newDistance, extrudedZ ); std::unique_ptr< QgsLineString > reversedDistanceVHeightExtrusion( extrudedDistanceVHeightRing->reversed() ); distanceVHeightRing->append( reversedDistanceVHeightExtrusion.get() ); distanceVHeightRing->close(); @@ -1227,15 +1227,15 @@ void QgsVectorLayerProfileGenerator::processTriangleIntersectForLine( const QgsP if ( mExtrusionEnabled ) { - std::unique_ptr< QgsLineString > ring = std::make_unique< QgsLineString >( newX, newY, newZ ); - std::unique_ptr< QgsLineString > extrudedRing = std::make_unique< QgsLineString >( newX, newY, extrudedZ ); + auto ring = std::make_unique< QgsLineString >( newX, newY, newZ ); + auto extrudedRing = std::make_unique< QgsLineString >( newX, newY, extrudedZ ); std::unique_ptr< QgsLineString > reversedExtrusion( extrudedRing->reversed() ); ring->append( reversedExtrusion.get() ); ring->close(); transformedParts.append( QgsGeometry( new QgsPolygon( ring.release() ) ) ); - std::unique_ptr< QgsLineString > distanceVHeightRing = std::make_unique< QgsLineString >( newDistance, newZ ); - std::unique_ptr< QgsLineString > extrudedDistanceVHeightRing = std::make_unique< QgsLineString >( newDistance, extrudedZ ); + auto distanceVHeightRing = std::make_unique< QgsLineString >( newDistance, newZ ); + auto extrudedDistanceVHeightRing = std::make_unique< QgsLineString >( newDistance, extrudedZ ); std::unique_ptr< QgsLineString > reversedDistanceVHeightExtrusion( extrudedDistanceVHeightRing->reversed() ); distanceVHeightRing->append( reversedDistanceVHeightExtrusion.get() ); distanceVHeightRing->close(); @@ -1461,7 +1461,7 @@ bool QgsVectorLayerProfileGenerator::generateProfileForPolygons() if ( clampedPolygon->numInteriorRings() == 0 && clampedPolygon->exteriorRing() && clampedPolygon->exteriorRing()->numPoints() == 4 && clampedPolygon->exteriorRing()->isClosed() ) { // special case -- polygon is already a triangle, so no need to tessellate - std::unique_ptr< QgsMultiPolygon > multiPolygon = std::make_unique< QgsMultiPolygon >(); + auto multiPolygon = std::make_unique< QgsMultiPolygon >(); multiPolygon->addGeometry( clampedPolygon.release() ); tessellation = QgsGeometry( std::move( multiPolygon ) ); } diff --git a/src/core/vector/qgsvectorlayerrenderer.cpp b/src/core/vector/qgsvectorlayerrenderer.cpp index 34afa9f29a0d..23f3ba641136 100644 --- a/src/core/vector/qgsvectorlayerrenderer.cpp +++ b/src/core/vector/qgsvectorlayerrenderer.cpp @@ -690,7 +690,7 @@ void QgsVectorLayerRenderer::drawRendererLevels( QgsFeatureRenderer *renderer, Q } QgsExpressionContextScope *symbolScope = QgsExpressionContextUtils::updateSymbolScope( nullptr, new QgsExpressionContextScope() ); - std::unique_ptr< QgsExpressionContextScopePopper > scopePopper = std::make_unique< QgsExpressionContextScopePopper >( context.expressionContext(), symbolScope ); + auto scopePopper = std::make_unique< QgsExpressionContextScopePopper >( context.expressionContext(), symbolScope ); std::unique_ptr< QgsGeometryEngine > clipEngine; diff --git a/src/core/vector/qgsvectorlayerselectionproperties.cpp b/src/core/vector/qgsvectorlayerselectionproperties.cpp index fe01e2fb3499..d4c6774e4c07 100644 --- a/src/core/vector/qgsvectorlayerselectionproperties.cpp +++ b/src/core/vector/qgsvectorlayerselectionproperties.cpp @@ -65,7 +65,7 @@ bool QgsVectorLayerSelectionProperties::readXml( const QDomElement &element, con QgsVectorLayerSelectionProperties *QgsVectorLayerSelectionProperties::clone() const { - std::unique_ptr< QgsVectorLayerSelectionProperties > res = std::make_unique< QgsVectorLayerSelectionProperties >( nullptr ); + auto res = std::make_unique< QgsVectorLayerSelectionProperties >( nullptr ); res->mSelectionRenderingMode = mSelectionRenderingMode; res->mSelectionColor = mSelectionColor; res->mSelectionSymbol.reset( mSelectionSymbol ? mSelectionSymbol->clone() : nullptr ); diff --git a/src/core/vectortile/qgsmapboxglstyleconverter.cpp b/src/core/vectortile/qgsmapboxglstyleconverter.cpp index 5882ca201609..bd3a9ac4f916 100644 --- a/src/core/vectortile/qgsmapboxglstyleconverter.cpp +++ b/src/core/vectortile/qgsmapboxglstyleconverter.cpp @@ -4045,7 +4045,7 @@ void QgsMapBoxGlStyleConverter::parseRasterSource( const QVariantMap &source, co context = tmpContext.get(); } - std::unique_ptr< QgsMapBoxGlStyleRasterSource > raster = std::make_unique< QgsMapBoxGlStyleRasterSource >( name ); + auto raster = std::make_unique< QgsMapBoxGlStyleRasterSource >( name ); if ( raster->setFromJson( source, context ) ) mSources.append( raster.release() ); } @@ -4194,7 +4194,7 @@ QgsRasterLayer *QgsMapBoxGlStyleRasterSource::toRasterLayer() const parts.insert( QStringLiteral( "zmax" ), QString::number( mMaxZoom ) ); parts.insert( QStringLiteral( "zmin" ), QString::number( mMinZoom ) ); - std::unique_ptr< QgsRasterLayer > rl = std::make_unique< QgsRasterLayer >( QgsProviderRegistry::instance()->encodeUri( QStringLiteral( "wms" ), parts ), name(), QStringLiteral( "wms" ) ); + auto rl = std::make_unique< QgsRasterLayer >( QgsProviderRegistry::instance()->encodeUri( QStringLiteral( "wms" ), parts ), name(), QStringLiteral( "wms" ) ); return rl.release(); } diff --git a/src/gui/annotations/qgscreateannotationitemmaptool_impl.cpp b/src/gui/annotations/qgscreateannotationitemmaptool_impl.cpp index 3f0f7de1f2b0..9ea5f7e78bc5 100644 --- a/src/gui/annotations/qgscreateannotationitemmaptool_impl.cpp +++ b/src/gui/annotations/qgscreateannotationitemmaptool_impl.cpp @@ -109,7 +109,7 @@ void QgsCreatePointTextItemMapTool::cadCanvasPressEvent( QgsMapMouseEvent *event const QgsPointXY layerPoint = toLayerCoordinates( mHandler->targetLayer(), event->mapPoint() ); - std::unique_ptr createdItem = std::make_unique( tr( "Text" ), layerPoint ); + auto createdItem = std::make_unique( tr( "Text" ), layerPoint ); createdItem->setAlignment( Qt::AlignLeft ); QgsTextFormat format = QgsStyle::defaultTextFormatForProject( QgsProject::instance(), QgsStyle::TextFormatContext::Labeling ); // default to HTML formatting @@ -148,7 +148,7 @@ void QgsCreateMarkerItemMapTool::cadCanvasReleaseEvent( QgsMapMouseEvent *event return; const QgsPointXY layerPoint = toLayerCoordinates( mHandler->targetLayer(), event->mapPoint() ); - std::unique_ptr createdItem = std::make_unique( QgsPoint( layerPoint ) ); + auto createdItem = std::make_unique( QgsPoint( layerPoint ) ); std::unique_ptr markerSymbol = QgsApplication::recentStyleHandler()->recentSymbol( QStringLiteral( "marker_annotation_item" ) ); if ( !markerSymbol ) @@ -184,7 +184,7 @@ void QgsCreateLineItemMapTool::lineCaptured( const QgsCurve *line ) std::unique_ptr geometry( line->simplifiedTypeRef()->clone() ); if ( qgsgeometry_cast( geometry.get() ) ) { - std::unique_ptr createdItem = std::make_unique( qgsgeometry_cast( geometry.release() ) ); + auto createdItem = std::make_unique( qgsgeometry_cast( geometry.release() ) ); std::unique_ptr lineSymbol = QgsApplication::recentStyleHandler()->recentSymbol( QStringLiteral( "line_annotation_item" ) ); if ( !lineSymbol ) @@ -216,9 +216,9 @@ void QgsCreatePolygonItemMapTool::polygonCaptured( const QgsCurvePolygon *polygo std::unique_ptr geometry( polygon->exteriorRing()->simplifiedTypeRef()->clone() ); if ( qgsgeometry_cast( geometry.get() ) ) { - std::unique_ptr newPolygon = std::make_unique(); + auto newPolygon = std::make_unique(); newPolygon->setExteriorRing( qgsgeometry_cast( geometry.release() ) ); - std::unique_ptr createdItem = std::make_unique( newPolygon.release() ); + auto createdItem = std::make_unique( newPolygon.release() ); std::unique_ptr fillSymbol = QgsApplication::recentStyleHandler()->recentSymbol( QStringLiteral( "polygon_annotation_item" ) ); if ( !fillSymbol ) @@ -322,7 +322,7 @@ void QgsCreatePictureItemMapTool::cadCanvasPressEvent( QgsMapMouseEvent *event ) cadDockWidget()->clearPoints(); - std::unique_ptr createdItem = std::make_unique( format, imagePath, QgsRectangle( point1, point2 ) ); + auto createdItem = std::make_unique( format, imagePath, QgsRectangle( point1, point2 ) ); if ( size.isValid() ) { const double pixelsToMm = mCanvas->mapSettings().outputDpi() / 25.4; @@ -429,7 +429,7 @@ void QgsCreateRectangleTextItemMapTool::cadCanvasPressEvent( QgsMapMouseEvent *e cadDockWidget()->clearPoints(); - std::unique_ptr createdItem = std::make_unique( tr( "Text" ), QgsRectangle( point1, point2 ) ); + auto createdItem = std::make_unique( tr( "Text" ), QgsRectangle( point1, point2 ) ); QgsTextFormat format = QgsStyle::defaultTextFormatForProject( QgsProject::instance(), QgsStyle::TextFormatContext::Labeling ); // default to HTML formatting @@ -501,7 +501,7 @@ void QgsCreateLineTextItemMapTool::lineCaptured( const QgsCurve *line ) std::unique_ptr geometry( line->simplifiedTypeRef()->clone() ); if ( qgsgeometry_cast( geometry.get() ) ) { - std::unique_ptr createdItem = std::make_unique( tr( "Text" ), qgsgeometry_cast( geometry.release() ) ); + auto createdItem = std::make_unique( tr( "Text" ), qgsgeometry_cast( geometry.release() ) ); std::unique_ptr lineSymbol = QgsApplication::recentStyleHandler()->recentSymbol( QStringLiteral( "line_annotation_item" ) ); if ( !lineSymbol ) diff --git a/src/gui/codeeditors/qgscodeeditorpython.cpp b/src/gui/codeeditors/qgscodeeditorpython.cpp index 359945653f1e..0d05c99fd38e 100644 --- a/src/gui/codeeditors/qgscodeeditorpython.cpp +++ b/src/gui/codeeditors/qgscodeeditorpython.cpp @@ -136,7 +136,7 @@ void QgsCodeEditorPython::initializeLexer() pyLexer->setColor( lexerColor( QgsCodeEditorColorScheme::ColorRole::TripleSingleQuote ), QsciLexerPython::TripleSingleQuotedString ); pyLexer->setColor( lexerColor( QgsCodeEditorColorScheme::ColorRole::TripleDoubleQuote ), QsciLexerPython::TripleDoubleQuotedString ); - std::unique_ptr apis = std::make_unique( pyLexer ); + auto apis = std::make_unique( pyLexer ); QgsSettings settings; if ( mAPISFilesList.isEmpty() ) diff --git a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp index 9ac2dc9cb5d5..8d6c1ae5b4b5 100644 --- a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp +++ b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp @@ -333,7 +333,7 @@ void QgsValueMapConfigDlg::copySelectionToClipboard() QString clipboardText; QModelIndex previous = indexes.first(); - std::unique_ptr mimeData = std::make_unique(); + auto mimeData = std::make_unique(); for ( const QModelIndex ¤t : indexes ) { const QString text = model->data( current ).toString(); diff --git a/src/gui/labeling/qgslabelingenginerulewidget.cpp b/src/gui/labeling/qgslabelingenginerulewidget.cpp index c90ddd4b2393..5cbfe1a470de 100644 --- a/src/gui/labeling/qgslabelingenginerulewidget.cpp +++ b/src/gui/labeling/qgslabelingenginerulewidget.cpp @@ -97,7 +97,7 @@ void QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget::setRule( const Qgs QgsAbstractLabelingEngineRule *QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget::rule() { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->setName( mEditName->text() ); res->setLabeledLayer( mComboLabeledLayer->currentLayer() ); res->setTargetLayer( qobject_cast( mComboTargetLayer->currentLayer() ) ); @@ -158,7 +158,7 @@ void QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget::setRule( const Qg QgsAbstractLabelingEngineRule *QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget::rule() { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->setName( mEditName->text() ); res->setLabeledLayer( mComboLabeledLayer->currentLayer() ); res->setTargetLayer( qobject_cast( mComboTargetLayer->currentLayer() ) ); @@ -226,7 +226,7 @@ void QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget::setRule( const Qg QgsAbstractLabelingEngineRule *QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget::rule() { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->setName( mEditName->text() ); res->setLabeledLayer( mComboLabeledLayer->currentLayer() ); res->setTargetLayer( qobject_cast( mComboTargetLayer->currentLayer() ) ); @@ -292,7 +292,7 @@ void QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget::setRule( const QgsA QgsAbstractLabelingEngineRule *QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget::rule() { - std::unique_ptr res = std::make_unique(); + auto res = std::make_unique(); res->setName( mEditName->text() ); res->setLabeledLayer( mComboLabeledLayer->currentLayer() ); res->setTargetLayer( mComboTargetLayer->currentLayer() ); diff --git a/src/gui/labeling/qgsrulebasedlabelingwidget.cpp b/src/gui/labeling/qgsrulebasedlabelingwidget.cpp index a1a0c19f9adf..3a5ae0fef047 100644 --- a/src/gui/labeling/qgsrulebasedlabelingwidget.cpp +++ b/src/gui/labeling/qgsrulebasedlabelingwidget.cpp @@ -94,7 +94,7 @@ QgsRuleBasedLabelingWidget::QgsRuleBasedLabelingWidget( QgsVectorLayer *layer, Q { // copy simple label settings to first rule mRootRule = new QgsRuleBasedLabeling::Rule( nullptr ); - std::unique_ptr newSettings = std::make_unique( mLayer->labeling()->settings() ); + auto newSettings = std::make_unique( mLayer->labeling()->settings() ); newSettings->drawLabels = true; // otherwise we may be trying to copy a "blocking" setting to a rule - which is confusing for users! mRootRule->appendChild( new QgsRuleBasedLabeling::Rule( newSettings.release() ) ); } diff --git a/src/gui/layout/qgslayoutattributetablewidget.cpp b/src/gui/layout/qgslayoutattributetablewidget.cpp index cd68e3bffacf..544f4546f0b0 100644 --- a/src/gui/layout/qgslayoutattributetablewidget.cpp +++ b/src/gui/layout/qgslayoutattributetablewidget.cpp @@ -182,7 +182,7 @@ QgsExpressionContext QgsLayoutAttributeTableWidget::createExpressionContext() co else if ( mTable ) context = mTable->createExpressionContext(); - std::unique_ptr cellScope = std::make_unique(); + auto cellScope = std::make_unique(); cellScope->setVariable( QStringLiteral( "row_number" ), 1, true ); cellScope->setVariable( QStringLiteral( "column_number" ), 1, true ); context.appendScope( cellScope.release() ); diff --git a/src/gui/layout/qgslayoutguiutils.cpp b/src/gui/layout/qgslayoutguiutils.cpp index 252abf03a689..eb0bcd2cfa58 100644 --- a/src/gui/layout/qgslayoutguiutils.cpp +++ b/src/gui/layout/qgslayoutguiutils.cpp @@ -306,7 +306,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) // north arrow - std::unique_ptr northArrowMetadata = std::make_unique( + auto northArrowMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutPicture, QObject::tr( "North Arrow" ), QgsApplication::getThemeIcon( QStringLiteral( "/north_arrow.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutPictureWidget( qobject_cast( item ) ); @@ -329,7 +329,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) northArrowCount++; } - std::unique_ptr picture = std::make_unique( layout ); + auto picture = std::make_unique( layout ); picture->setNorthMode( QgsLayoutItemPicture::GridNorth ); picture->setPicturePath( defaultPath ); // set an id by default, so that north arrows are discernible in layout item lists @@ -356,17 +356,17 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) }; registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutShape, QObject::tr( "Rectangle" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddBasicRectangle.svg" ) ), createShapeWidget, createRubberBand, QStringLiteral( "shapes" ), false, QgsLayoutItemAbstractGuiMetadata::Flags(), []( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr shape = std::make_unique( layout ); + auto shape = std::make_unique( layout ); shape->setShapeType( QgsLayoutItemShape::Rectangle ); return shape.release(); } ) ); registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutShape, QObject::tr( "Ellipse" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddBasicCircle.svg" ) ), createShapeWidget, createEllipseBand, QStringLiteral( "shapes" ), false, QgsLayoutItemAbstractGuiMetadata::Flags(), []( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr shape = std::make_unique( layout ); + auto shape = std::make_unique( layout ); shape->setShapeType( QgsLayoutItemShape::Ellipse ); return shape.release(); } ) ); registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutShape, QObject::tr( "Triangle" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddBasicTriangle.svg" ) ), createShapeWidget, createTriangleBand, QStringLiteral( "shapes" ), false, QgsLayoutItemAbstractGuiMetadata::Flags(), []( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr shape = std::make_unique( layout ); + auto shape = std::make_unique( layout ); shape->setShapeType( QgsLayoutItemShape::Triangle ); return shape.release(); } ) ); @@ -375,7 +375,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutMarker, QObject::tr( "Marker" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddMarker.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutMarkerWidget( qobject_cast( item ) ); }, nullptr ) ); // arrow - std::unique_ptr arrowMetadata = std::make_unique( + auto arrowMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutPolyline, QObject::tr( "Arrow" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddArrow.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutPolylineWidget( qobject_cast( item ) ); @@ -383,12 +383,12 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) createRubberBand, QString(), true ); arrowMetadata->setItemCreationFunction( []( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr arrow = std::make_unique( layout ); + auto arrow = std::make_unique( layout ); arrow->setEndMarker( QgsLayoutItemPolyline::ArrowHead ); return arrow.release(); } ); arrowMetadata->setNodeRubberBandCreationFunction( []( QgsLayoutView * ) -> QGraphicsItemGroup * { - std::unique_ptr band = std::make_unique(); + auto band = std::make_unique(); QGraphicsPathItem *poly = new QGraphicsPathItem( band.get() ); poly->setPen( QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 ) ); @@ -402,7 +402,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) // node items - std::unique_ptr polygonMetadata = std::make_unique( + auto polygonMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutPolygon, QObject::tr( "Polygon" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddPolygon.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutPolygonWidget( qobject_cast( item ) ); @@ -410,7 +410,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) createRubberBand, QStringLiteral( "nodes" ), true ); polygonMetadata->setNodeRubberBandCreationFunction( []( QgsLayoutView * ) -> QGraphicsItemGroup * { - std::unique_ptr band = std::make_unique(); + auto band = std::make_unique(); QGraphicsPolygonItem *poly = new QGraphicsPolygonItem( band.get() ); poly->setBrush( QBrush( QColor( 227, 22, 22, 20 ) ) ); poly->setPen( QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 ) ); @@ -424,7 +424,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) } ); registry->addLayoutItemGuiMetadata( polygonMetadata.release() ); - std::unique_ptr polylineMetadata = std::make_unique( + auto polylineMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutPolyline, QObject::tr( "Polyline" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddPolyline.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutPolylineWidget( qobject_cast( item ) ); @@ -432,7 +432,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) createRubberBand, QStringLiteral( "nodes" ), true ); polylineMetadata->setNodeRubberBandCreationFunction( []( QgsLayoutView * ) -> QGraphicsItemGroup * { - std::unique_ptr band = std::make_unique(); + auto band = std::make_unique(); QGraphicsPathItem *poly = new QGraphicsPathItem( band.get() ); poly->setPen( QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 ) ); @@ -449,10 +449,10 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) auto htmlItemMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutHtml, QObject::tr( "HTML" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddHtml.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutHtmlWidget( qobject_cast( item ) ); }, createRubberBand ); htmlItemMetadata->setItemCreationFunction( [=]( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr htmlMultiFrame = std::make_unique( layout ); + auto htmlMultiFrame = std::make_unique( layout ); QgsLayoutItemHtml *html = htmlMultiFrame.get(); layout->addMultiFrame( htmlMultiFrame.release() ); - std::unique_ptr frame = std::make_unique( layout, html ); + auto frame = std::make_unique( layout, html ); QgsLayoutFrame *f = frame.get(); html->addFrame( frame.release() ); // cppcheck-suppress returnDanglingLifetime @@ -464,7 +464,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) auto attributeTableItemMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutAttributeTable, QObject::tr( "Attribute Table" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddTable.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutAttributeTableWidget( qobject_cast( item ) ); }, createRubberBand ); attributeTableItemMetadata->setItemCreationFunction( [=]( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr tableMultiFrame = std::make_unique( layout ); + auto tableMultiFrame = std::make_unique( layout ); QgsLayoutItemAttributeTable *table = tableMultiFrame.get(); //set first vector layer from layer registry as table source @@ -494,7 +494,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) } layout->addMultiFrame( tableMultiFrame.release() ); - std::unique_ptr frame = std::make_unique( layout, table ); + auto frame = std::make_unique( layout, table ); QgsLayoutFrame *f = frame.get(); table->addFrame( frame.release() ); // cppcheck-suppress returnDanglingLifetime @@ -506,7 +506,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) auto manualTableItemMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutManualTable, QObject::tr( "Fixed Table" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddManualTable.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutManualTableWidget( qobject_cast( item ) ); }, createRubberBand ); manualTableItemMetadata->setItemCreationFunction( [=]( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr tableMultiFrame = std::make_unique( layout ); + auto tableMultiFrame = std::make_unique( layout ); QgsLayoutItemManualTable *table = tableMultiFrame.get(); // initially start with a 2x2 empty table @@ -532,7 +532,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) layout->addMultiFrame( tableMultiFrame.release() ); - std::unique_ptr frame = std::make_unique( layout, table ); + auto frame = std::make_unique( layout, table ); QgsLayoutFrame *f = frame.get(); table->addFrame( frame.release() ); // cppcheck-suppress returnDanglingLifetime @@ -548,7 +548,7 @@ void QgsLayoutGuiUtils::registerGuiForKnownItemTypes( QgsMapCanvas *mapCanvas ) auto elevationProfileItemMetadata = std::make_unique( QgsLayoutItemRegistry::LayoutElevationProfile, QObject::tr( "Elevation Profile" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionElevationProfile.svg" ) ), [=]( QgsLayoutItem *item ) -> QgsLayoutItemBaseWidget * { return new QgsLayoutElevationProfileWidget( qobject_cast( item ) ); }, createRubberBand ); elevationProfileItemMetadata->setItemCreationFunction( [=]( QgsLayout *layout ) -> QgsLayoutItem * { - std::unique_ptr profileItem = std::make_unique( layout ); + auto profileItem = std::make_unique( layout ); //set default fonts from settings QgsSettings settings; diff --git a/src/gui/layout/qgslayoutmanualtablewidget.cpp b/src/gui/layout/qgslayoutmanualtablewidget.cpp index b5b0db23e95b..d1fba7481c46 100644 --- a/src/gui/layout/qgslayoutmanualtablewidget.cpp +++ b/src/gui/layout/qgslayoutmanualtablewidget.cpp @@ -126,7 +126,7 @@ QgsExpressionContext QgsLayoutManualTableWidget::createExpressionContext() const else if ( mTable ) context = mTable->createExpressionContext(); - std::unique_ptr cellScope = std::make_unique(); + auto cellScope = std::make_unique(); cellScope->setVariable( QStringLiteral( "row_number" ), 1, true ); cellScope->setVariable( QStringLiteral( "column_number" ), 1, true ); context.appendScope( cellScope.release() ); diff --git a/src/gui/pointcloud/qgspointcloudattributebyramprendererwidget.cpp b/src/gui/pointcloud/qgspointcloudattributebyramprendererwidget.cpp index f527d9854fe8..935db259da0f 100644 --- a/src/gui/pointcloud/qgspointcloudattributebyramprendererwidget.cpp +++ b/src/gui/pointcloud/qgspointcloudattributebyramprendererwidget.cpp @@ -64,7 +64,7 @@ QgsPointCloudRenderer *QgsPointCloudAttributeByRampRendererWidget::renderer() return nullptr; } - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setAttribute( mAttributeComboBox->currentAttribute() ); renderer->setMinimum( mMinSpin->value() ); diff --git a/src/gui/pointcloud/qgspointcloudclassifiedrendererwidget.cpp b/src/gui/pointcloud/qgspointcloudclassifiedrendererwidget.cpp index 3872092a1922..e03d76a97dc9 100644 --- a/src/gui/pointcloud/qgspointcloudclassifiedrendererwidget.cpp +++ b/src/gui/pointcloud/qgspointcloudclassifiedrendererwidget.cpp @@ -454,7 +454,7 @@ QgsPointCloudRenderer *QgsPointCloudClassifiedRendererWidget::renderer() return nullptr; } - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setAttribute( mAttributeComboBox->currentAttribute() ); renderer->setCategories( mModel->categories() ); diff --git a/src/gui/pointcloud/qgspointcloudextentrendererwidget.cpp b/src/gui/pointcloud/qgspointcloudextentrendererwidget.cpp index 9efa4ab7e123..d8a810408bea 100644 --- a/src/gui/pointcloud/qgspointcloudextentrendererwidget.cpp +++ b/src/gui/pointcloud/qgspointcloudextentrendererwidget.cpp @@ -56,7 +56,7 @@ QgsPointCloudRenderer *QgsPointCloudExtentRendererWidget::renderer() return nullptr; } - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setFillSymbol( mSymbolButton->clonedSymbol() ); return renderer.release(); } diff --git a/src/gui/pointcloud/qgspointcloudrgbrendererwidget.cpp b/src/gui/pointcloud/qgspointcloudrgbrendererwidget.cpp index 94ff6c243e7d..ae0f53a7a63f 100644 --- a/src/gui/pointcloud/qgspointcloudrgbrendererwidget.cpp +++ b/src/gui/pointcloud/qgspointcloudrgbrendererwidget.cpp @@ -84,7 +84,7 @@ QgsPointCloudRenderer *QgsPointCloudRgbRendererWidget::renderer() return nullptr; } - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setRedAttribute( mRedAttributeComboBox->currentAttribute() ); renderer->setGreenAttribute( mGreenAttributeComboBox->currentAttribute() ); renderer->setBlueAttribute( mBlueAttributeComboBox->currentAttribute() ); diff --git a/src/gui/processing/models/qgsmodeldesignerdialog.cpp b/src/gui/processing/models/qgsmodeldesignerdialog.cpp index f13c2b26d2d4..c8d3af7c223f 100644 --- a/src/gui/processing/models/qgsmodeldesignerdialog.cpp +++ b/src/gui/processing/models/qgsmodeldesignerdialog.cpp @@ -453,7 +453,7 @@ void QgsModelDesignerDialog::setModel( QgsProcessingModelAlgorithm *model ) void QgsModelDesignerDialog::loadModel( const QString &path ) { - std::unique_ptr alg = std::make_unique(); + auto alg = std::make_unique(); if ( alg->fromFile( path ) ) { alg->setProvider( QgsApplication::processingRegistry()->providerById( QStringLiteral( "model" ) ) ); @@ -515,7 +515,7 @@ void QgsModelDesignerDialog::updateVariablesGui() { mBlockUndoCommands++; - std::unique_ptr variablesScope = std::make_unique( tr( "Model Variables" ) ); + auto variablesScope = std::make_unique( tr( "Model Variables" ) ); const QVariantMap modelVars = mModel->variables(); for ( auto it = modelVars.constBegin(); it != modelVars.constEnd(); ++it ) { @@ -628,7 +628,7 @@ void QgsModelDesignerDialog::newModel() if ( !checkForUnsavedChanges() ) return; - std::unique_ptr alg = std::make_unique(); + auto alg = std::make_unique(); alg->setProvider( QgsApplication::processingRegistry()->providerById( QStringLiteral( "model" ) ) ); setModel( alg.release() ); } @@ -1048,7 +1048,7 @@ void QgsModelDesignerDialog::run( const QSet &childAlgorithmSubset ) if ( !childAlgorithmSubset.empty() ) { // start from previous state - std::unique_ptr modelConfig = std::make_unique(); + auto modelConfig = std::make_unique(); modelConfig->setChildAlgorithmSubset( childAlgorithmSubset ); modelConfig->setPreviouslyExecutedChildAlgorithms( mLastResult.executedChildIds() ); modelConfig->setInitialChildInputs( mLastResult.rawChildInputs() ); @@ -1057,7 +1057,7 @@ void QgsModelDesignerDialog::run( const QSet &childAlgorithmSubset ) // add copies of layers from previous runs to context's layer store, so that they can be used // when running the subset const QMap previousOutputLayers = mLayerStore.temporaryLayerStore()->mapLayers(); - std::unique_ptr previousResultStore = std::make_unique(); + auto previousResultStore = std::make_unique(); for ( auto it = previousOutputLayers.constBegin(); it != previousOutputLayers.constEnd(); ++it ) { std::unique_ptr clone( it.value()->clone() ); @@ -1247,7 +1247,7 @@ bool QgsModelDesignerDialog::isDirty() const void QgsModelDesignerDialog::fillInputsTree() { const QIcon icon = QgsApplication::getThemeIcon( QStringLiteral( "mIconModelInput.svg" ) ); - std::unique_ptr parametersItem = std::make_unique(); + auto parametersItem = std::make_unique(); parametersItem->setText( 0, tr( "Parameters" ) ); QList available = QgsApplication::processingRegistry()->parameterTypes(); std::sort( available.begin(), available.end(), []( const QgsProcessingParameterType *a, const QgsProcessingParameterType *b ) -> bool { @@ -1258,7 +1258,7 @@ void QgsModelDesignerDialog::fillInputsTree() { if ( param->flags() & Qgis::ProcessingParameterTypeFlag::ExposeToModeler ) { - std::unique_ptr paramItem = std::make_unique(); + auto paramItem = std::make_unique(); paramItem->setText( 0, param->name() ); paramItem->setData( 0, Qt::UserRole, param->id() ); paramItem->setIcon( 0, icon ); diff --git a/src/gui/processing/models/qgsmodeldesignerinputstreewidget.cpp b/src/gui/processing/models/qgsmodeldesignerinputstreewidget.cpp index cd02a4e44f7a..b9569750f941 100644 --- a/src/gui/processing/models/qgsmodeldesignerinputstreewidget.cpp +++ b/src/gui/processing/models/qgsmodeldesignerinputstreewidget.cpp @@ -34,7 +34,7 @@ QMimeData *QgsModelDesignerInputsTreeWidget::mimeData( const QList res = std::make_unique(); + auto res = std::make_unique(); const QString text = items.value( 0 )->data( 0, Qt::UserRole ).toString(); res->setText( text ); return res.release(); diff --git a/src/gui/processing/models/qgsmodelgraphicsscene.cpp b/src/gui/processing/models/qgsmodelgraphicsscene.cpp index fad189d60ab6..a2c458b9ce05 100644 --- a/src/gui/processing/models/qgsmodelgraphicsscene.cpp +++ b/src/gui/processing/models/qgsmodelgraphicsscene.cpp @@ -125,7 +125,7 @@ void QgsModelGraphicsScene::createItems( QgsProcessingModelAlgorithm *model, Qgs { if ( mParameterItems.contains( it.key() ) && mParameterItems.contains( otherName ) ) { - std::unique_ptr arrow = std::make_unique( mParameterItems.value( otherName ), QgsModelArrowItem::Marker::Circle, mParameterItems.value( it.key() ), QgsModelArrowItem::Marker::ArrowHead ); + auto arrow = std::make_unique( mParameterItems.value( otherName ), QgsModelArrowItem::Marker::Circle, mParameterItems.value( it.key() ), QgsModelArrowItem::Marker::ArrowHead ); arrow->setPenStyle( Qt::DotLine ); addItem( arrow.release() ); } @@ -477,7 +477,7 @@ void QgsModelGraphicsScene::addCommentItemForComponent( QgsProcessingModelAlgori connect( commentItem, &QgsModelComponentGraphicItem::changed, this, &QgsModelGraphicsScene::componentChanged ); connect( commentItem, &QgsModelComponentGraphicItem::aboutToChange, this, &QgsModelGraphicsScene::componentAboutToChange ); - std::unique_ptr arrow = std::make_unique( parentItem, QgsModelArrowItem::Circle, commentItem, QgsModelArrowItem::Circle ); + auto arrow = std::make_unique( parentItem, QgsModelArrowItem::Circle, commentItem, QgsModelArrowItem::Circle ); arrow->setPenStyle( Qt::DotLine ); addItem( arrow.release() ); } diff --git a/src/gui/processing/qgsprocessingmeshdatasetwidget.cpp b/src/gui/processing/qgsprocessingmeshdatasetwidget.cpp index 22171f12f46c..5c6c68a479d4 100644 --- a/src/gui/processing/qgsprocessingmeshdatasetwidget.cpp +++ b/src/gui/processing/qgsprocessingmeshdatasetwidget.cpp @@ -792,7 +792,7 @@ QgsProcessingParameterDefinition *QgsProcessingMeshDatasetGroupsParameterDefinit supportedDataType.insert( QgsMeshDatasetGroupMetadata::DataOnVertices ); supportedDataType.insert( QgsMeshDatasetGroupMetadata::DataOnFaces ); supportedDataType.insert( QgsMeshDatasetGroupMetadata::DataOnVolumes ); - std::unique_ptr param = std::make_unique( name, description, mParentLayerComboBox->currentData().toString(), supportedDataType ); + auto param = std::make_unique( name, description, mParentLayerComboBox->currentData().toString(), supportedDataType ); param->setFlags( flags ); return param.release(); } @@ -864,7 +864,7 @@ QgsProcessingMeshDatasetTimeParameterDefinitionWidget::QgsProcessingMeshDatasetT QgsProcessingParameterDefinition *QgsProcessingMeshDatasetTimeParameterDefinitionWidget::createParameter( const QString &name, const QString &description, Qgis::ProcessingParameterFlags flags ) const { - std::unique_ptr param = std::make_unique( + auto param = std::make_unique( name, description, mMeshLayerParameterName, mParentDatasetComboBox->currentData().toString() ); diff --git a/src/gui/processing/qgsprocessingmultipleselectiondialog.cpp b/src/gui/processing/qgsprocessingmultipleselectiondialog.cpp index ab51eb3f6553..128992518da3 100644 --- a/src/gui/processing/qgsprocessingmultipleselectiondialog.cpp +++ b/src/gui/processing/qgsprocessingmultipleselectiondialog.cpp @@ -269,7 +269,7 @@ void QgsProcessingMultipleSelectionPanelWidget::addOption( const QVariant &value } } - std::unique_ptr item = std::make_unique( title ); + auto item = std::make_unique( title ); item->setData( value, Qt::UserRole ); item->setCheckState( selected ? Qt::Checked : Qt::Unchecked ); item->setCheckable( true ); diff --git a/src/gui/processing/qgsprocessingoutputdestinationwidget.cpp b/src/gui/processing/qgsprocessingoutputdestinationwidget.cpp index 8c72eaa40f1a..420aff686f5a 100644 --- a/src/gui/processing/qgsprocessingoutputdestinationwidget.cpp +++ b/src/gui/processing/qgsprocessingoutputdestinationwidget.cpp @@ -548,7 +548,7 @@ void QgsProcessingLayerOutputDestinationWidget::appendToLayer() else { // get fields for destination - std::unique_ptr dest = std::make_unique( widget->uri().uri, QString(), widget->uri().providerKey ); + auto dest = std::make_unique( widget->uri().uri, QString(), widget->uri().providerKey ); if ( widget->uri().providerKey == QLatin1String( "ogr" ) ) setAppendDestination( widget->uri().uri, dest->fields() ); else diff --git a/src/gui/processing/qgsprocessingtoolboxmodel.cpp b/src/gui/processing/qgsprocessingtoolboxmodel.cpp index f71e347c8e68..d1ea6e45ea5e 100644 --- a/src/gui/processing/qgsprocessingtoolboxmodel.cpp +++ b/src/gui/processing/qgsprocessingtoolboxmodel.cpp @@ -146,7 +146,7 @@ void QgsProcessingToolboxModel::rebuild() if ( mRecentLog ) { - std::unique_ptr recentNode = std::make_unique(); + auto recentNode = std::make_unique(); // cppcheck-suppress danglingLifetime mRecentNode = recentNode.get(); mRootNode->addChildNode( recentNode.release() ); @@ -155,7 +155,7 @@ void QgsProcessingToolboxModel::rebuild() if ( mFavoriteManager ) { - std::unique_ptr favoriteNode = std::make_unique(); + auto favoriteNode = std::make_unique(); // cppcheck-suppress danglingLifetime mFavoriteNode = favoriteNode.get(); mRootNode->addChildNode( favoriteNode.release() ); @@ -218,7 +218,7 @@ void QgsProcessingToolboxModel::repopulateRecentAlgorithms( bool resetting ) for ( const QgsProcessingAlgorithm *algorithm : std::as_const( recentAlgorithms ) ) { - std::unique_ptr algorithmNode = std::make_unique( algorithm ); + auto algorithmNode = std::make_unique( algorithm ); mRecentNode->addChildNode( algorithmNode.release() ); } @@ -278,7 +278,7 @@ void QgsProcessingToolboxModel::repopulateFavoriteAlgorithms( bool resetting ) for ( const QgsProcessingAlgorithm *algorithm : std::as_const( favoriteAlgorithms ) ) { - std::unique_ptr algorithmNode = std::make_unique( algorithm ); + auto algorithmNode = std::make_unique( algorithm ); mFavoriteNode->addChildNode( algorithmNode.release() ); } @@ -353,7 +353,7 @@ void QgsProcessingToolboxModel::addProvider( QgsProcessingProvider *provider ) QgsProcessingToolboxModelNode *parentNode = nullptr; if ( !isTopLevelProvider( provider->id() ) ) { - std::unique_ptr node = std::make_unique( provider ); + auto node = std::make_unique( provider ); parentNode = node.get(); mRootNode->addChildNode( node.release() ); } @@ -365,7 +365,7 @@ void QgsProcessingToolboxModel::addProvider( QgsProcessingProvider *provider ) const QList algorithms = provider->algorithms(); for ( const QgsProcessingAlgorithm *algorithm : algorithms ) { - std::unique_ptr algorithmNode = std::make_unique( algorithm ); + auto algorithmNode = std::make_unique( algorithm ); const QString groupId = algorithm->groupId(); if ( !groupId.isEmpty() ) @@ -666,7 +666,7 @@ QMimeData *QgsProcessingToolboxModel::mimeData( const QModelIndexList &indexes ) QByteArray encodedData; QDataStream stream( &encodedData, QIODevice::WriteOnly | QIODevice::Truncate ); - std::unique_ptr mimeData = std::make_unique(); + auto mimeData = std::make_unique(); const QgsProcessingAlgorithm *algorithm = algorithmForIndex( indexes.at( 0 ) ); if ( algorithm ) { diff --git a/src/gui/processing/qgsprocessingwidgetwrapper.cpp b/src/gui/processing/qgsprocessingwidgetwrapper.cpp index 9839db771196..8de38ec5627c 100644 --- a/src/gui/processing/qgsprocessingwidgetwrapper.cpp +++ b/src/gui/processing/qgsprocessingwidgetwrapper.cpp @@ -234,7 +234,7 @@ QLabel *QgsAbstractProcessingParameterWidgetWrapper::createLabel() QString description = mParameterDefinition->description(); if ( parameterDefinition()->flags() & Qgis::ProcessingParameterFlag::Optional ) description = QObject::tr( "%1 [optional]" ).arg( description ); - std::unique_ptr label = std::make_unique( description ); + auto label = std::make_unique( description ); label->setToolTip( mParameterDefinition->toolTip() ); label->setWordWrap( true ); return label.release(); @@ -287,7 +287,7 @@ QgsExpressionContext QgsAbstractProcessingParameterWidgetWrapper::createExpressi QgsExpressionContext context = QgsProcessingGuiUtils::createExpressionContext( mProcessingContextGenerator, mWidgetContext, mParameterDefinition ? mParameterDefinition->algorithm() : nullptr, linkedVectorLayer() ); if ( mParameterDefinition && !mParameterDefinition->additionalExpressionContextVariables().isEmpty() ) { - std::unique_ptr paramScope = std::make_unique(); + auto paramScope = std::make_unique(); const QStringList additional = mParameterDefinition->additionalExpressionContextVariables(); for ( const QString &var : additional ) { @@ -365,7 +365,7 @@ void QgsAbstractProcessingParameterWidgetWrapper::setDynamicParentLayerParameter QgsProcessingModelerParameterWidget *QgsProcessingParameterWidgetFactoryInterface::createModelerWidgetWrapper( QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context ) { - std::unique_ptr widget = std::make_unique( model, childId, parameter, context ); + auto widget = std::make_unique( model, childId, parameter, context ); widget->populateSources( compatibleParameterTypes(), compatibleOutputTypes(), compatibleDataTypes( parameter ) ); widget->setExpressionHelpText( modelerExpressionFormatString() ); diff --git a/src/gui/proj/qgscoordinateoperationwidget.cpp b/src/gui/proj/qgscoordinateoperationwidget.cpp index f8afa0564ea3..dddeec268212 100644 --- a/src/gui/proj/qgscoordinateoperationwidget.cpp +++ b/src/gui/proj/qgscoordinateoperationwidget.cpp @@ -134,7 +134,7 @@ void QgsCoordinateOperationWidget::loadAvailableOperations() for ( const QgsDatumTransform::TransformDetails &transform : std::as_const( mDatumTransforms ) ) { - std::unique_ptr item = std::make_unique(); + auto item = std::make_unique(); item->setData( ProjRole, transform.proj ); item->setData( AvailableRole, transform.isAvailable ); item->setFlags( item->flags() & ~Qt::ItemIsEditable ); diff --git a/src/gui/proj/qgscoordinatereferencesystemmodel.cpp b/src/gui/proj/qgscoordinatereferencesystemmodel.cpp index daf8fba5b3b1..bfb876ecd5a0 100644 --- a/src/gui/proj/qgscoordinatereferencesystemmodel.cpp +++ b/src/gui/proj/qgscoordinatereferencesystemmodel.cpp @@ -286,7 +286,7 @@ void QgsCoordinateReferenceSystemModel::userCrsAdded( const QString &id ) QgsCoordinateReferenceSystemModelGroupNode *group = mRootNode->getChildGroupNode( QStringLiteral( "USER" ) ); if ( !group ) { - std::unique_ptr newGroup = std::make_unique( + auto newGroup = std::make_unique( tr( "User-defined" ), QgsApplication::getThemeIcon( QStringLiteral( "/user.svg" ) ), QStringLiteral( "USER" ) ); @@ -358,7 +358,7 @@ void QgsCoordinateReferenceSystemModel::userCrsChanged( const QString &id ) QgsCoordinateReferenceSystemModelCrsNode *QgsCoordinateReferenceSystemModel::addRecord( const QgsCrsDbRecord &record ) { QgsCoordinateReferenceSystemModelGroupNode *parentNode = mRootNode.get(); - std::unique_ptr crsNode = std::make_unique( record ); + auto crsNode = std::make_unique( record ); QString groupName; QString groupId; @@ -438,7 +438,7 @@ QgsCoordinateReferenceSystemModelCrsNode *QgsCoordinateReferenceSystemModel::add } else { - std::unique_ptr newGroup = std::make_unique( groupName, groupIcon, groupId ); + auto newGroup = std::make_unique( groupName, groupIcon, groupId ); parentNode->addChildNode( newGroup.get() ); parentNode = newGroup.release(); } @@ -457,7 +457,7 @@ QgsCoordinateReferenceSystemModelCrsNode *QgsCoordinateReferenceSystemModel::add } else { - std::unique_ptr newGroup = std::make_unique( projectionName, QIcon(), record.projectionAcronym ); + auto newGroup = std::make_unique( projectionName, QIcon(), record.projectionAcronym ); parentNode->addChildNode( newGroup.get() ); parentNode = newGroup.release(); } @@ -477,7 +477,7 @@ QModelIndex QgsCoordinateReferenceSystemModel::addCustomCrs( const QgsCoordinate QgsCoordinateReferenceSystemModelGroupNode *group = mRootNode->getChildGroupNode( QStringLiteral( "CUSTOM" ) ); if ( !group ) { - std::unique_ptr newGroup = std::make_unique( + auto newGroup = std::make_unique( tr( "Custom" ), QgsApplication::getThemeIcon( QStringLiteral( "/user.svg" ) ), QStringLiteral( "CUSTOM" ) ); diff --git a/src/gui/proj/qgscrsdefinitionwidget.cpp b/src/gui/proj/qgscrsdefinitionwidget.cpp index b4ec7c850419..79c45401f809 100644 --- a/src/gui/proj/qgscrsdefinitionwidget.cpp +++ b/src/gui/proj/qgscrsdefinitionwidget.cpp @@ -101,7 +101,7 @@ void QgsCrsDefinitionWidget::setDefinitionString( const QString &definition ) void QgsCrsDefinitionWidget::pbnCopyCRS_clicked() { - std::unique_ptr selector = std::make_unique( this ); + auto selector = std::make_unique( this ); if ( selector->exec() ) { const QgsCoordinateReferenceSystem srs = selector->crs(); diff --git a/src/gui/providers/ogr/qgsogrdbsourceselect.cpp b/src/gui/providers/ogr/qgsogrdbsourceselect.cpp index d68a57bc7788..e04ddfa353cd 100644 --- a/src/gui/providers/ogr/qgsogrdbsourceselect.cpp +++ b/src/gui/providers/ogr/qgsogrdbsourceselect.cpp @@ -313,7 +313,7 @@ void QgsOgrDbSourceSelect::setSql( const QModelIndex &index ) QString tableName = mTableModel->itemFromIndex( index.sibling( index.row(), 0 ) )->text(); QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformContext() }; - std::unique_ptr vlayer = std::make_unique( layerURI( index ), tableName, QStringLiteral( "ogr" ), options ); + auto vlayer = std::make_unique( layerURI( index ), tableName, QStringLiteral( "ogr" ), options ); if ( !vlayer->isValid() ) { diff --git a/src/gui/qgsattributeform.cpp b/src/gui/qgsattributeform.cpp index a005c176871b..2f9a45afd2e9 100644 --- a/src/gui/qgsattributeform.cpp +++ b/src/gui/qgsattributeform.cpp @@ -460,7 +460,7 @@ bool QgsAttributeForm::saveEdits( QString *error ) n++; } - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsExpressionContext expressionContext = createExpressionContext( updatedFeature ); context->setExpressionContext( &expressionContext ); success = mLayer->changeAttributeValues( mFeature.id(), newValues, oldValues, false, context.get() ); diff --git a/src/gui/qgsfieldmappingmodel.cpp b/src/gui/qgsfieldmappingmodel.cpp index ba5aa76ab9be..4c094ac47679 100644 --- a/src/gui/qgsfieldmappingmodel.cpp +++ b/src/gui/qgsfieldmappingmodel.cpp @@ -563,7 +563,7 @@ QgsExpressionContext QgsFieldMappingModel::ExpressionContextGenerator::createExp if ( mBaseGenerator ) { QgsExpressionContext ctx = mBaseGenerator->createExpressionContext(); - std::unique_ptr fieldMappingScope = std::make_unique( tr( "Field Mapping" ) ); + auto fieldMappingScope = std::make_unique( tr( "Field Mapping" ) ); fieldMappingScope->setFields( mSourceFields ); ctx.appendScope( fieldMappingScope.release() ); return ctx; diff --git a/src/gui/qgslayermetadataresultsmodel.cpp b/src/gui/qgslayermetadataresultsmodel.cpp index e32368e561da..3a550a6c4a9d 100644 --- a/src/gui/qgslayermetadataresultsmodel.cpp +++ b/src/gui/qgslayermetadataresultsmodel.cpp @@ -169,8 +169,8 @@ void QgsLayerMetadataResultsModel::reloadAsync() const QList providers { QgsApplication::instance()->layerMetadataProviderRegistry()->layerMetadataProviders() }; for ( QgsAbstractLayerMetadataProvider *mdProvider : std::as_const( providers ) ) { - std::unique_ptr fetcher = std::make_unique( mdProvider, mSearchContext, mFeedback.get() ); - std::unique_ptr thread = std::make_unique(); + auto fetcher = std::make_unique( mdProvider, mSearchContext, mFeedback.get() ); + auto thread = std::make_unique(); fetcher->moveToThread( thread.get() ); // Forward signals to the model connect( fetcher.get(), &QgsMetadataResultsFetcher::resultsReady, this, [=]( const QgsLayerMetadataSearchResults &results ) { diff --git a/src/gui/qgsmasksourceselectionwidget.cpp b/src/gui/qgsmasksourceselectionwidget.cpp index 03113ea741cd..6efd7af9ff49 100644 --- a/src/gui/qgsmasksourceselectionwidget.cpp +++ b/src/gui/qgsmasksourceselectionwidget.cpp @@ -229,7 +229,7 @@ void QgsMaskSourceSelectionWidget::update() if ( !vl->renderer() ) continue; - std::unique_ptr layerItem = std::make_unique( mTree, QStringList() << layer->name() ); + auto layerItem = std::make_unique( mTree, QStringList() << layer->name() ); layerItem->setData( 0, Qt::UserRole, QVariant::fromValue( vl ) ); if ( vl->labeling() ) diff --git a/src/gui/qgsnewgeopackagelayerdialog.cpp b/src/gui/qgsnewgeopackagelayerdialog.cpp index 4cf264bdf456..6b0f85c43667 100644 --- a/src/gui/qgsnewgeopackagelayerdialog.cpp +++ b/src/gui/qgsnewgeopackagelayerdialog.cpp @@ -566,7 +566,7 @@ bool QgsNewGeoPackageLayerDialog::apply() const QString uri( QStringLiteral( "%1|layername=%2" ).arg( fileName, tableName ) ); const QString userVisiblelayerName( layerIdentifier.isEmpty() ? tableName : layerIdentifier ); const QgsVectorLayer::LayerOptions layerOptions { QgsProject::instance()->transformContext() }; - std::unique_ptr layer = std::make_unique( uri, userVisiblelayerName, QStringLiteral( "ogr" ), layerOptions ); + auto layer = std::make_unique( uri, userVisiblelayerName, QStringLiteral( "ogr" ), layerOptions ); if ( layer->isValid() ) { if ( mAddToProject ) diff --git a/src/gui/qgsvaliditycheckresultswidget.cpp b/src/gui/qgsvaliditycheckresultswidget.cpp index 0e09651591b9..1defa57c0484 100644 --- a/src/gui/qgsvaliditycheckresultswidget.cpp +++ b/src/gui/qgsvaliditycheckresultswidget.cpp @@ -128,8 +128,8 @@ void QgsValidityCheckResultsWidget::setDescription( const QString &description ) bool QgsValidityCheckResultsWidget::runChecks( int type, const QgsValidityCheckContext *context, const QString &title, const QString &description, QWidget *parent ) { - std::unique_ptr feedback = std::make_unique(); - std::unique_ptr progressDialog = std::make_unique( tr( "Running Checks…" ), tr( "Abort" ), 0, 100, parent ); + auto feedback = std::make_unique(); + auto progressDialog = std::make_unique( tr( "Running Checks…" ), tr( "Abort" ), 0, 100, parent ); progressDialog->setWindowTitle( title ); QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Running Checks" ) ); diff --git a/src/gui/raster/qgsloadrasterattributetabledialog.cpp b/src/gui/raster/qgsloadrasterattributetabledialog.cpp index 46d0eabba475..758379428adf 100644 --- a/src/gui/raster/qgsloadrasterattributetabledialog.cpp +++ b/src/gui/raster/qgsloadrasterattributetabledialog.cpp @@ -82,7 +82,7 @@ void QgsLoadRasterAttributeTableDialog::accept() } else { - std::unique_ptr rat = std::make_unique(); + auto rat = std::make_unique(); QString errorMessage; success = rat->readFromFile( filePath(), &errorMessage ); diff --git a/src/gui/raster/qgsrasterlabelingwidget.cpp b/src/gui/raster/qgsrasterlabelingwidget.cpp index ac94f9aea1ba..a87645c15fd3 100644 --- a/src/gui/raster/qgsrasterlabelingwidget.cpp +++ b/src/gui/raster/qgsrasterlabelingwidget.cpp @@ -104,7 +104,7 @@ void QgsRasterLabelingWidget::writeSettingsToLayer() const QString mode = mLabelModeComboBox->currentData().toString(); if ( mode == QLatin1String( "simple" ) ) { - std::unique_ptr labeling = std::make_unique(); + auto labeling = std::make_unique(); if ( QgsRasterLabelSettingsWidget *settingsWidget = qobject_cast( mWidget ) ) { settingsWidget->updateLabeling( labeling.get() ); @@ -154,7 +154,7 @@ void QgsRasterLabelingWidget::labelModeChanged( int index ) mWidget = settingsWidget; if ( !dynamic_cast( mLayer->labeling() ) ) { - std::unique_ptr labeling = std::make_unique(); + auto labeling = std::make_unique(); settingsWidget->setLabeling( labeling.get() ); mLayer->setLabeling( labeling.release() ); } diff --git a/src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp b/src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp index 71e887fbcd6a..df461a52d892 100644 --- a/src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp +++ b/src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp @@ -1031,7 +1031,7 @@ void QgsCategorizedSymbolRendererWidget::addCategories() */ // recreate renderer - std::unique_ptr r = std::make_unique( attrName, cats ); + auto r = std::make_unique( attrName, cats ); r->setSourceSymbol( mCategorizedSymbol->clone() ); std::unique_ptr ramp( btnColorRamp->colorRamp() ); if ( ramp ) diff --git a/src/gui/symbology/qgslayerpropertieswidget.cpp b/src/gui/symbology/qgslayerpropertieswidget.cpp index 952c7c695d7a..1fbcd11d85c8 100644 --- a/src/gui/symbology/qgslayerpropertieswidget.cpp +++ b/src/gui/symbology/qgslayerpropertieswidget.cpp @@ -350,21 +350,21 @@ void QgsLayerPropertiesWidget::layerTypeChanged() { case Qgis::SymbolType::Marker: { - std::unique_ptr markerSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); + auto markerSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); generator->setSymbolType( Qgis::SymbolType::Marker ); generator->setSubSymbol( markerSymbol.release() ); break; } case Qgis::SymbolType::Line: { - std::unique_ptr lineSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); + auto lineSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); generator->setSymbolType( Qgis::SymbolType::Line ); generator->setSubSymbol( lineSymbol.release() ); break; } case Qgis::SymbolType::Fill: { - std::unique_ptr fillSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); + auto fillSymbol = std::make_unique( QgsSymbolLayerList( { layer->clone() } ) ); generator->setSymbolType( Qgis::SymbolType::Fill ); generator->setSubSymbol( fillSymbol.release() ); break; diff --git a/src/gui/tiledscene/qgstiledscenetexturerendererwidget.cpp b/src/gui/tiledscene/qgstiledscenetexturerendererwidget.cpp index cb46a7b1a8ab..834c0a5308d1 100644 --- a/src/gui/tiledscene/qgstiledscenetexturerendererwidget.cpp +++ b/src/gui/tiledscene/qgstiledscenetexturerendererwidget.cpp @@ -46,7 +46,7 @@ QgsTiledSceneRendererWidget *QgsTiledSceneTextureRendererWidget::create( QgsTile QgsTiledSceneRenderer *QgsTiledSceneTextureRendererWidget::renderer() { - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setFillSymbol( mFillSymbolButton->clonedSymbol() ); return renderer.release(); diff --git a/src/gui/tiledscene/qgstiledscenewireframerendererwidget.cpp b/src/gui/tiledscene/qgstiledscenewireframerendererwidget.cpp index 7032cf0a1b32..079070272c25 100644 --- a/src/gui/tiledscene/qgstiledscenewireframerendererwidget.cpp +++ b/src/gui/tiledscene/qgstiledscenewireframerendererwidget.cpp @@ -51,7 +51,7 @@ QgsTiledSceneRendererWidget *QgsTiledSceneWireframeRendererWidget::create( QgsTi QgsTiledSceneRenderer *QgsTiledSceneWireframeRendererWidget::renderer() { - std::unique_ptr renderer = std::make_unique(); + auto renderer = std::make_unique(); renderer->setFillSymbol( mFillSymbolButton->clonedSymbol() ); renderer->setLineSymbol( mLineSymbolButton->clonedSymbol() ); renderer->setUseTextureColors( mCheckUseTextureColors->isChecked() ); diff --git a/src/gui/vector/qgsdiagramproperties.cpp b/src/gui/vector/qgsdiagramproperties.cpp index 0c17a96f0ac1..0a56895b4f12 100644 --- a/src/gui/vector/qgsdiagramproperties.cpp +++ b/src/gui/vector/qgsdiagramproperties.cpp @@ -874,7 +874,7 @@ std::unique_ptr QgsDiagramProperties::createDiagramObject() std::unique_ptr QgsDiagramProperties::createDiagramSettings() { - std::unique_ptr ds = std::make_unique(); + auto ds = std::make_unique(); ds->enabled = isDiagramEnabled(); ds->font = mDiagramFontButton->currentFont(); ds->opacity = mOpacityWidget->opacity(); @@ -950,13 +950,13 @@ std::unique_ptr QgsDiagramProperties::createRenderer() std::unique_ptr renderer; if ( mFixedSizeRadio->isChecked() ) { - std::unique_ptr dr = std::make_unique(); + auto dr = std::make_unique(); dr->setDiagramSettings( *ds ); renderer = std::move( dr ); } else { - std::unique_ptr dr = std::make_unique(); + auto dr = std::make_unique(); dr->setLowerValue( 0.0 ); dr->setLowerSize( QSizeF( 0.0, 0.0 ) ); dr->setUpperValue( mMaxValueSpinBox->value() ); diff --git a/src/gui/vector/qgsfieldcalculator.cpp b/src/gui/vector/qgsfieldcalculator.cpp index e2ce21935bc8..7875e101bc87 100644 --- a/src/gui/vector/qgsfieldcalculator.cpp +++ b/src/gui/vector/qgsfieldcalculator.cpp @@ -308,7 +308,7 @@ void QgsFieldCalculator::calculate() } QgsFeatureIterator fit = mVectorLayer->getFeatures( req ); - std::unique_ptr task = std::make_unique( tr( "Calculating field" ) ); + auto task = std::make_unique( tr( "Calculating field" ) ); const long long count = mOnlyUpdateSelectedCheckBox->isChecked() ? mVectorLayer->selectedFeatureCount() : mVectorLayer->featureCount(); long long i = 0; while ( fit.nextFeature( feature ) ) diff --git a/src/gui/vector/qgsstackeddiagramproperties.cpp b/src/gui/vector/qgsstackeddiagramproperties.cpp index 149a1ff001be..fbd1cc3e2ba4 100644 --- a/src/gui/vector/qgsstackeddiagramproperties.cpp +++ b/src/gui/vector/qgsstackeddiagramproperties.cpp @@ -73,7 +73,7 @@ void QgsStackedDiagramProperties::addSubDiagramRenderer() { // Create a single category renderer by default std::unique_ptr renderer; - std::unique_ptr dr = std::make_unique(); + auto dr = std::make_unique(); renderer = std::move( dr ); QItemSelectionModel *sel = mSubDiagramsView->selectionModel(); @@ -201,7 +201,7 @@ void QgsStackedDiagramProperties::syncToLayer() void QgsStackedDiagramProperties::apply() { - std::unique_ptr ds = std::make_unique(); + auto ds = std::make_unique(); ds->stackedDiagramMode = static_cast( mStackedDiagramModeComboBox->currentData().toInt() ); ds->setStackedDiagramSpacingUnit( mStackedDiagramSpacingUnitComboBox->unit() ); ds->setStackedDiagramSpacing( mStackedDiagramSpacingSpinBox->value() ); diff --git a/src/providers/arcgisrest/qgsarcgisrestdataitemguiprovider.cpp b/src/providers/arcgisrest/qgsarcgisrestdataitemguiprovider.cpp index 16b991da4fb4..fef574b5b541 100644 --- a/src/providers/arcgisrest/qgsarcgisrestdataitemguiprovider.cpp +++ b/src/providers/arcgisrest/qgsarcgisrestdataitemguiprovider.cpp @@ -240,7 +240,7 @@ void QgsArcGisRestDataItemGuiProvider::addFilteredLayer( const QgsMimeDataUtils: const QString sql = w->expressionText(); ds.setSql( sql ); - std::unique_ptr layer = std::make_unique( ds.uri( false ), uri.name, QStringLiteral( "arcgisfeatureserver" ) ); + auto layer = std::make_unique( ds.uri( false ), uri.name, QStringLiteral( "arcgisfeatureserver" ) ); QgsProject::instance()->addMapLayer( layer.release() ); } } diff --git a/src/providers/arcgisrest/qgsarcgisrestdataitems.cpp b/src/providers/arcgisrest/qgsarcgisrestdataitems.cpp index b96cd587d92b..8840e2013400 100644 --- a/src/providers/arcgisrest/qgsarcgisrestdataitems.cpp +++ b/src/providers/arcgisrest/qgsarcgisrestdataitems.cpp @@ -76,7 +76,7 @@ void QgsArcGisRestRootItem::onConnectionsChanged() void addFolderItems( QVector &items, const QVariantMap &serviceData, const QString &baseUrl, const QString &authcfg, const QgsHttpHeaders &headers, const QString &urlPrefix, QgsDataItem *parent, const QString &supportedFormats ) { QgsArcGisRestQueryUtils::visitFolderItems( [parent, &baseUrl, &items, headers, urlPrefix, authcfg, supportedFormats]( const QString &name, const QString &url ) { - std::unique_ptr folderItem = std::make_unique( parent, name, url, baseUrl, authcfg, headers, urlPrefix ); + auto folderItem = std::make_unique( parent, name, url, baseUrl, authcfg, headers, urlPrefix ); folderItem->setSupportedFormats( supportedFormats ); items.append( folderItem.release() ); }, @@ -92,14 +92,14 @@ void addServiceItems( QVector &items, const QVariantMap &serviceD case Qgis::ArcGisRestServiceType::MapServer: case Qgis::ArcGisRestServiceType::ImageServer: { - std::unique_ptr serviceItem = std::make_unique( parent, name, url, url, authcfg, headers, urlPrefix, serviceType ); + auto serviceItem = std::make_unique( parent, name, url, url, authcfg, headers, urlPrefix, serviceType ); items.append( serviceItem.release() ); break; } case Qgis::ArcGisRestServiceType::FeatureServer: { - std::unique_ptr serviceItem = std::make_unique( parent, name, url, url, authcfg, headers, urlPrefix ); + auto serviceItem = std::make_unique( parent, name, url, url, authcfg, headers, urlPrefix ); serviceItem->setSupportedFormats( supportedFormats ); items.append( serviceItem.release() ); break; @@ -131,7 +131,7 @@ void addLayerItems( QVector &items, const QVariantMap &serviceDat { if ( !layerItems.value( id ) ) { - std::unique_ptr layerItem = std::make_unique( parent, name, url, authcfg, headers, urlPrefix ); + auto layerItem = std::make_unique( parent, name, url, authcfg, headers, urlPrefix ); layerItems.insert( id, layerItem.release() ); } } @@ -212,7 +212,7 @@ QVector QgsArcGisRestConnectionItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -269,7 +269,7 @@ QVector QgsArcGisPortalGroupsItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -322,7 +322,7 @@ QVector QgsArcGisPortalGroupItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -378,7 +378,7 @@ QVector QgsArcGisRestServicesItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -431,7 +431,7 @@ QVector QgsArcGisRestFolderItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -482,7 +482,7 @@ QVector QgsArcGisFeatureServiceItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); @@ -531,7 +531,7 @@ QVector QgsArcGisMapServiceItem::createChildren() { if ( !errorMessage.isEmpty() ) { - std::unique_ptr error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); + auto error = std::make_unique( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" ); error->setToolTip( errorMessage ); items.append( error.release() ); QgsDebugError( "Connection failed - " + errorMessage ); diff --git a/src/providers/mssql/qgsmssqlfeatureiterator.cpp b/src/providers/mssql/qgsmssqlfeatureiterator.cpp index 4b5cb9890264..9e11e5f2bb43 100644 --- a/src/providers/mssql/qgsmssqlfeatureiterator.cpp +++ b/src/providers/mssql/qgsmssqlfeatureiterator.cpp @@ -605,7 +605,7 @@ bool QgsMssqlFeatureIterator::rewind() mQuery->setForwardOnly( true ); QString sql { mOrderByClause.isEmpty() ? mStatement : mStatement + mOrderByClause }; - std::unique_ptr logWrapper = std::make_unique( sql, mSource->connInfo(), QStringLiteral( "mssql" ), QStringLiteral( "QgsMssqlFeatureIterator" ), QGS_QUERY_LOG_ORIGIN ); + auto logWrapper = std::make_unique( sql, mSource->connInfo(), QStringLiteral( "mssql" ), QStringLiteral( "QgsMssqlFeatureIterator" ), QGS_QUERY_LOG_ORIGIN ); bool result = mQuery->exec( sql ); if ( !result ) diff --git a/src/providers/mssql/qgsmssqlgeometryparser.cpp b/src/providers/mssql/qgsmssqlgeometryparser.cpp index 1c5ea670fbcc..0ee38ac48e9d 100644 --- a/src/providers/mssql/qgsmssqlgeometryparser.cpp +++ b/src/providers/mssql/qgsmssqlgeometryparser.cpp @@ -352,7 +352,7 @@ std::unique_ptr QgsMssqlGeometryParser::readPoint( int iFigure ) std::unique_ptr QgsMssqlGeometryParser::readMultiPoint( int iShape ) { - std::unique_ptr poMultiPoint = std::make_unique(); + auto poMultiPoint = std::make_unique(); poMultiPoint->reserve( mNumShapes ); for ( int i = iShape + 1; i < mNumShapes; i++ ) { @@ -393,7 +393,7 @@ std::unique_ptr QgsMssqlGeometryParser::readLineString( int iFigu std::unique_ptr QgsMssqlGeometryParser::readCircularString( int iPoint, int iNextPoint ) { - std::unique_ptr poCircularString = std::make_unique(); + auto poCircularString = std::make_unique(); poCircularString->setPoints( readPointSequence( iPoint, iNextPoint ) ); return poCircularString; } @@ -405,7 +405,7 @@ std::unique_ptr QgsMssqlGeometryParser::readCircularString( i std::unique_ptr QgsMssqlGeometryParser::readMultiLineString( int iShape ) { - std::unique_ptr poMultiLineString = std::make_unique(); + auto poMultiLineString = std::make_unique(); poMultiLineString->reserve( mNumShapes ); for ( int i = iShape + 1; i < mNumShapes; i++ ) { @@ -425,7 +425,7 @@ std::unique_ptr QgsMssqlGeometryParser::readPolygon( int iShape ) int iRingCount = 0; const int iNextFigure = NextFigureOffset( iShape ); - std::unique_ptr poPoly = std::make_unique(); + auto poPoly = std::make_unique(); for ( iFigure = FigureOffset( iShape ); iFigure < iNextFigure; iFigure++ ) { if ( iRingCount == 0 ) @@ -440,7 +440,7 @@ std::unique_ptr QgsMssqlGeometryParser::readPolygon( int iShape ) std::unique_ptr QgsMssqlGeometryParser::readMultiPolygon( int iShape ) { - std::unique_ptr poMultiPolygon = std::make_unique(); + auto poMultiPolygon = std::make_unique(); poMultiPolygon->reserve( mNumShapes ); for ( int i = iShape + 1; i < mNumShapes; i++ ) { @@ -457,7 +457,7 @@ std::unique_ptr QgsMssqlGeometryParser::readMultiPolygon( int i std::unique_ptr QgsMssqlGeometryParser::readCompoundCurve( int iFigure ) { int iPoint, iNextPoint, nPointsPrepared; - std::unique_ptr poCompoundCurve = std::make_unique(); + auto poCompoundCurve = std::make_unique(); iPoint = PointOffset( iFigure ); iNextPoint = NextPointOffset( iFigure ) - 1; @@ -523,7 +523,7 @@ std::unique_ptr QgsMssqlGeometryParser::readCurvePolygon( int i int iRingCount = 0; const int iNextFigure = NextFigureOffset( iShape ); - std::unique_ptr poPoly = std::make_unique(); + auto poPoly = std::make_unique(); for ( iFigure = FigureOffset( iShape ); iFigure < iNextFigure; iFigure++ ) { switch ( FigureAttribute( iFigure ) ) @@ -554,7 +554,7 @@ std::unique_ptr QgsMssqlGeometryParser::readCurvePolygon( int i std::unique_ptr QgsMssqlGeometryParser::readGeometryCollection( int iShape ) { - std::unique_ptr poGeomColl = std::make_unique(); + auto poGeomColl = std::make_unique(); poGeomColl->reserve( mNumShapes ); for ( int i = iShape + 1; i < mNumShapes; i++ ) { diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp index 8ef32e680dd2..5396c7bec5a2 100644 --- a/src/providers/mssql/qgsmssqlprovider.cpp +++ b/src/providers/mssql/qgsmssqlprovider.cpp @@ -2257,7 +2257,7 @@ Qgis::VectorExportResult QgsMssqlProvider::createEmptyLayer( const QString &uri, "CREATE TABLE spatial_ref_sys (srid integer not null " "PRIMARY KEY, auth_name varchar(256), auth_srid integer, srtext varchar(2048), proj4text varchar(2048))" ); - std::unique_ptr logWrapper = std::make_unique( sql, uri, QStringLiteral( "mssql" ), QStringLiteral( "QgsMssqlProvider" ), QGS_QUERY_LOG_ORIGIN ); + auto logWrapper = std::make_unique( sql, uri, QStringLiteral( "mssql" ), QStringLiteral( "QgsMssqlProvider" ), QGS_QUERY_LOG_ORIGIN ); if ( !q.exec( sql ) ) { diff --git a/src/providers/mssql/qgsmssqlproviderconnection.cpp b/src/providers/mssql/qgsmssqlproviderconnection.cpp index ebf164fd4469..5f2594ccfebb 100644 --- a/src/providers/mssql/qgsmssqlproviderconnection.cpp +++ b/src/providers/mssql/qgsmssqlproviderconnection.cpp @@ -246,7 +246,7 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsMssqlProviderConnection::e //qDebug() << "MSSQL QUERY:" << sql; - std::unique_ptr q = std::make_unique( db ); + auto q = std::make_unique( db ); q->setForwardOnly( true ); QgsDatabaseQueryLogWrapper logWrapper { sql, uri(), providerKey(), QStringLiteral( "QgsMssqlProviderConnection" ), QGS_QUERY_LOG_ORIGIN }; diff --git a/src/providers/mssql/qgsmssqlsourceselect.cpp b/src/providers/mssql/qgsmssqlsourceselect.cpp index fbc7cb584f4d..c1a977d32a9b 100644 --- a/src/providers/mssql/qgsmssqlsourceselect.cpp +++ b/src/providers/mssql/qgsmssqlsourceselect.cpp @@ -547,7 +547,7 @@ void QgsMssqlSourceSelect::setSql( const QModelIndex &index ) const QString tableName = mTableModel->itemFromIndex( index.sibling( index.row(), QgsMssqlTableModel::DbtmTable ) )->text(); const bool disableInvalidGeometryHandling = QgsMssqlConnection::isInvalidGeometryHandlingDisabled( cmbConnections->currentText() ); const QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformContext() }; - std::unique_ptr vlayer = std::make_unique( mTableModel->layerURI( index, mConnInfo, mUseEstimatedMetadata, disableInvalidGeometryHandling ), tableName, QStringLiteral( "mssql" ), options ); + auto vlayer = std::make_unique( mTableModel->layerURI( index, mConnInfo, mUseEstimatedMetadata, disableInvalidGeometryHandling ), tableName, QStringLiteral( "mssql" ), options ); if ( !vlayer->isValid() ) { diff --git a/src/providers/oracle/qgsoracleproviderconnection.cpp b/src/providers/oracle/qgsoracleproviderconnection.cpp index c935c8e12aa9..d5f13c965bfb 100644 --- a/src/providers/oracle/qgsoracleproviderconnection.cpp +++ b/src/providers/oracle/qgsoracleproviderconnection.cpp @@ -201,7 +201,7 @@ QgsVectorLayer *QgsOracleProviderConnection::createSqlVectorLayer( const QgsAbst tUri.setGeometryColumn( options.geometryColumn ); } - std::unique_ptr vl = std::make_unique( tUri.uri( false ), options.layerName.isEmpty() ? QStringLiteral( "QueryLayer" ) : options.layerName, providerKey() ); + auto vl = std::make_unique( tUri.uri( false ), options.layerName.isEmpty() ? QStringLiteral( "QueryLayer" ) : options.layerName, providerKey() ); // Try to guess the geometry and srid if ( !vl->isValid() ) @@ -1360,7 +1360,7 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsOracleProviderConnection:: if ( feedback && feedback->isCanceled() ) return QgsAbstractDatabaseProviderConnection::QueryResult(); - std::unique_ptr qry = std::make_unique( pconn ); + auto qry = std::make_unique( pconn ); std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); QgsDatabaseQueryLogWrapper logWrapper { sql, uri(), providerKey(), QStringLiteral( "QgsAbstractDatabaseProviderConnection" ), QGS_QUERY_LOG_ORIGIN }; diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp index 89445b9ff544..f0fe9ed7d5f8 100644 --- a/src/providers/postgres/qgspostgresconn.cpp +++ b/src/providers/postgres/qgspostgresconn.cpp @@ -344,7 +344,7 @@ QgsPostgresConn::QgsPostgresConn( const QString &conninfo, bool readOnly, bool s }; addDefaultTimeoutAndClientEncoding( expandedConnectionInfo ); - std::unique_ptr logWrapper = std::make_unique( QStringLiteral( "libpq::PQconnectdb()" ), expandedConnectionInfo.toUtf8(), QStringLiteral( "postgres" ), QStringLiteral( "QgsPostgresConn" ), QGS_QUERY_LOG_ORIGIN_PG_CON ); + auto logWrapper = std::make_unique( QStringLiteral( "libpq::PQconnectdb()" ), expandedConnectionInfo.toUtf8(), QStringLiteral( "postgres" ), QStringLiteral( "QgsPostgresConn" ), QGS_QUERY_LOG_ORIGIN_PG_CON ); mConn = PQconnectdb( expandedConnectionInfo.toUtf8() ); // remove temporary cert/key/CA if they exist @@ -1541,7 +1541,7 @@ PGresult *QgsPostgresConn::PQexec( const QString &query, bool logError, bool ret QgsDebugMsgLevel( QStringLiteral( "Executing SQL: %1" ).arg( query ), 3 ); - std::unique_ptr logWrapper = std::make_unique( query, mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); + auto logWrapper = std::make_unique( query, mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); PGresult *res = ::PQexec( mConn, query.toUtf8() ); @@ -1734,7 +1734,7 @@ PGresult *QgsPostgresConn::PQprepare( const QString &stmtName, const QString &qu { QMutexLocker locker( &mLock ); - std::unique_ptr logWrapper = std::make_unique( QStringLiteral( "PQprepare(%1): %2 " ).arg( stmtName, query ), mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); + auto logWrapper = std::make_unique( QStringLiteral( "PQprepare(%1): %2 " ).arg( stmtName, query ), mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); PGresult *res { ::PQprepare( mConn, stmtName.toUtf8(), query.toUtf8(), nParams, paramTypes ) }; @@ -1766,7 +1766,7 @@ PGresult *QgsPostgresConn::PQexecPrepared( const QString &stmtName, const QStrin param[i] = qparam[i]; } - std::unique_ptr logWrapper = std::make_unique( QStringLiteral( "PQexecPrepared(%1)" ).arg( stmtName ), mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); + auto logWrapper = std::make_unique( QStringLiteral( "PQexecPrepared(%1)" ).arg( stmtName ), mConnInfo, QStringLiteral( "postgres" ), originatorClass, queryOrigin ); PGresult *res { ::PQexecPrepared( mConn, stmtName.toUtf8(), params.size(), param, nullptr, nullptr, 0 ) }; diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index 68d2f6ac9ebd..9971e91cba45 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -4595,7 +4595,7 @@ Qgis::VectorExportResult QgsPostgresProvider::createEmptyLayer( const QString &u QgsDataProvider::ProviderOptions providerOptions; Qgis::DataProviderReadFlags flags; - std::unique_ptr provider = std::make_unique( dsUri.uri( false ), providerOptions, flags ); + auto provider = std::make_unique( dsUri.uri( false ), providerOptions, flags ); if ( !provider->isValid() ) { if ( errorMessage ) diff --git a/src/providers/postgres/qgspostgresproviderconnection.cpp b/src/providers/postgres/qgspostgresproviderconnection.cpp index 67074fc47d53..c90674d7914d 100644 --- a/src/providers/postgres/qgspostgresproviderconnection.cpp +++ b/src/providers/postgres/qgspostgresproviderconnection.cpp @@ -441,7 +441,7 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsPostgresProviderConnection } std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); - std::unique_ptr res = std::make_unique( conn->LoggedPQexec( "QgsPostgresProviderConnection", sql ) ); + auto res = std::make_unique( conn->LoggedPQexec( "QgsPostgresProviderConnection", sql ) ); std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); results.setQueryExecutionTime( std::chrono::duration_cast( end - begin ).count() ); diff --git a/src/providers/postgres/raster/qgspostgresrastershareddata.cpp b/src/providers/postgres/raster/qgspostgresrastershareddata.cpp index 4822a8fb9be1..bb4bddaabc79 100644 --- a/src/providers/postgres/raster/qgspostgresrastershareddata.cpp +++ b/src/providers/postgres/raster/qgspostgresrastershareddata.cpp @@ -253,7 +253,7 @@ bool QgsPostgresRasterSharedData::fetchTilesIndex( const QgsGeometry &requestPol overallExtent.combineExtentWith( extent ); - std::unique_ptr tile = std::make_unique( + auto tile = std::make_unique( tileId, srid, extent, @@ -332,7 +332,7 @@ QgsPostgresRasterSharedData::TilesResponse QgsPostgresRasterSharedData::fetchTil } const QgsRectangle extent( upperleftx, minY, upperleftx + tileWidth * scalex, maxY ); - std::unique_ptr tile = std::make_unique( + auto tile = std::make_unique( tileId, srid, extent, diff --git a/src/providers/spatialite/qgsspatialiteproviderconnection.cpp b/src/providers/spatialite/qgsspatialiteproviderconnection.cpp index 153dde6b3ec4..09a5aa9ebc45 100644 --- a/src/providers/spatialite/qgsspatialiteproviderconnection.cpp +++ b/src/providers/spatialite/qgsspatialiteproviderconnection.cpp @@ -354,7 +354,7 @@ QList QgsSpatiaLiteProviderConne property.setTableName( tableName ); // Create a layer and get information from it // Use OGR because it's way faster - std::unique_ptr vl = std::make_unique( dsUri.database() + "|layername=" + dsUri.table(), QString(), QLatin1String( "ogr" ), QgsVectorLayer::LayerOptions( false, true ) ); + auto vl = std::make_unique( dsUri.database() + "|layername=" + dsUri.table(), QString(), QLatin1String( "ogr" ), QgsVectorLayer::LayerOptions( false, true ) ); if ( vl->isValid() ) { if ( vl->isSpatial() ) diff --git a/src/providers/virtualraster/qgsvirtualrasterprovider.cpp b/src/providers/virtualraster/qgsvirtualrasterprovider.cpp index 61989668b6ed..499947f1a94e 100644 --- a/src/providers/virtualraster/qgsvirtualrasterprovider.cpp +++ b/src/providers/virtualraster/qgsvirtualrasterprovider.cpp @@ -147,7 +147,7 @@ QgsVirtualRasterProvider::~QgsVirtualRasterProvider() QgsRasterBlock *QgsVirtualRasterProvider::block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback ) { Q_UNUSED( bandNo ); - std::unique_ptr tblock = std::make_unique( Qgis::DataType::Float64, width, height ); + auto tblock = std::make_unique( Qgis::DataType::Float64, width, height ); double *outputData = ( double * ) ( tblock->bits() ); diff --git a/src/providers/wfs/oapif/qgsoapifprovider.cpp b/src/providers/wfs/oapif/qgsoapifprovider.cpp index d4296159054d..7fe240564687 100644 --- a/src/providers/wfs/oapif/qgsoapifprovider.cpp +++ b/src/providers/wfs/oapif/qgsoapifprovider.cpp @@ -151,7 +151,7 @@ bool QgsOapifProvider::init() } mShared->mCollectionUrl = landingPageRequest.collectionsUrl() + QStringLiteral( "/" ) + mShared->mURI.typeName(); - std::unique_ptr collectionRequest = std::make_unique( mShared->mURI.uri(), mShared->appendExtraQueryParameters( mShared->mCollectionUrl ) ); + auto collectionRequest = std::make_unique( mShared->mURI.uri(), mShared->appendExtraQueryParameters( mShared->mCollectionUrl ) ); if ( !collectionRequest->request( synchronous, forceRefresh ) || collectionRequest->errorCode() != QgsBaseNetworkRequest::NoError ) { // Retry with a trailing slash. Works around a bug with diff --git a/src/providers/wfs/qgsbasenetworkrequest.cpp b/src/providers/wfs/qgsbasenetworkrequest.cpp index 126c6e0225ec..446b6a998ffd 100644 --- a/src/providers/wfs/qgsbasenetworkrequest.cpp +++ b/src/providers/wfs/qgsbasenetworkrequest.cpp @@ -334,7 +334,7 @@ bool QgsBaseNetworkRequest::issueRequest( QNetworkRequest &request, const QByteA if ( synchronous && QThread::currentThread() == QApplication::instance()->thread() ) { - std::unique_ptr<_DownloaderThread> downloaderThread = std::make_unique<_DownloaderThread>( downloaderFunction ); + auto downloaderThread = std::make_unique<_DownloaderThread>( downloaderFunction ); downloaderThread->start(); while ( true ) diff --git a/src/providers/wfs/qgswfsprovider.cpp b/src/providers/wfs/qgswfsprovider.cpp index 065a6548783a..1e7401348886 100644 --- a/src/providers/wfs/qgswfsprovider.cpp +++ b/src/providers/wfs/qgswfsprovider.cpp @@ -1732,7 +1732,7 @@ bool QgsWFSProvider::readAttributesFromSchemaWithGMLAS( const QByteArray &respon CSLDestroy( papszOpenOptions ); }; - std::unique_ptr<_DownloaderThread> downloaderThread = std::make_unique<_DownloaderThread>( downloaderLambda ); + auto downloaderThread = std::make_unique<_DownloaderThread>( downloaderLambda ); downloaderThread->start(); QTimer timerForHits; diff --git a/src/providers/wfs/qgswfsprovidermetadata.cpp b/src/providers/wfs/qgswfsprovidermetadata.cpp index 0fff636863f8..4b22b9dde05f 100644 --- a/src/providers/wfs/qgswfsprovidermetadata.cpp +++ b/src/providers/wfs/qgswfsprovidermetadata.cpp @@ -345,7 +345,7 @@ QList QgsWfsProviderMetadata::querySublayers( const } }; - std::unique_ptr<_DownloaderThread> downloaderThread = std::make_unique<_DownloaderThread>( downloaderLambda ); + auto downloaderThread = std::make_unique<_DownloaderThread>( downloaderLambda ); downloaderThread->start(); downloaderThread->wait(); diff --git a/src/server/services/wms/qgsdxfwriter.cpp b/src/server/services/wms/qgsdxfwriter.cpp index ed42e1ffef88..ce40cf2b4a11 100644 --- a/src/server/services/wms/qgsdxfwriter.cpp +++ b/src/server/services/wms/qgsdxfwriter.cpp @@ -37,7 +37,7 @@ namespace QgsWms QgsRenderer renderer( context ); //Layer settings need to be kept until QgsDxfExport::writeToFile has finished - std::unique_ptr restorer = std::make_unique( context ); + auto restorer = std::make_unique( context ); restorer.reset( new QgsWmsRestorer( context ) ); std::unique_ptr dxf = renderer.getDxf(); diff --git a/src/server/services/wms/qgswmsrenderer.cpp b/src/server/services/wms/qgswmsrenderer.cpp index 185df933ad5b..4001387f4248 100644 --- a/src/server/services/wms/qgswmsrenderer.cpp +++ b/src/server/services/wms/qgswmsrenderer.cpp @@ -1171,7 +1171,7 @@ namespace QgsWms // add layers to dxf - std::unique_ptr dxf = std::make_unique(); + auto dxf = std::make_unique(); dxf->setExtent( mapExtent ); dxf->setDestinationCrs( outputCRS ); dxf->addLayers( dxfLayers ); @@ -1219,7 +1219,7 @@ namespace QgsWms } pdfExportDetails.useIso32000ExtensionFormatGeoreferencing = mWmsParameters.pdfUseIso32000ExtensionFormatGeoreferencing(); const bool geospatialPdf = mWmsParameters.pdfAppendGeoreference(); - std::unique_ptr pdf = std::make_unique( ms, tmpFileName, QStringLiteral( "PDF" ), false, QgsTask::Hidden, geospatialPdf, pdfExportDetails ); + auto pdf = std::make_unique( ms, tmpFileName, QStringLiteral( "PDF" ), false, QgsTask::Hidden, geospatialPdf, pdfExportDetails ); if ( mWmsParameters.pdfAppendGeoreference() ) { pdf->setSaveWorldFile( true ); @@ -3304,7 +3304,7 @@ namespace QgsWms // create vector layer const QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformContext() }; - std::unique_ptr layer = std::make_unique( url, param.mName, QLatin1String( "memory" ), options ); + auto layer = std::make_unique( url, param.mName, QLatin1String( "memory" ), options ); if ( !layer->isValid() ) { continue; diff --git a/tests/src/3d/testqgs3drendering.cpp b/tests/src/3d/testqgs3drendering.cpp index f129886a477f..8a34801bad74 100644 --- a/tests/src/3d/testqgs3drendering.cpp +++ b/tests/src/3d/testqgs3drendering.cpp @@ -260,7 +260,7 @@ void TestQgs3DRendering::testLights() map.setLightSources( { dsLight } ); QCOMPARE( lightSourceChangedSpy.size(), 2 ); // different light type - std::unique_ptr pointLight = std::make_unique(); + auto pointLight = std::make_unique(); pointLight->setColor( QColor( 255, 0, 0 ) ); map.setLightSources( { pointLight->clone() } ); QCOMPARE( lightSourceChangedSpy.size(), 3 ); @@ -492,7 +492,7 @@ void TestQgs3DRendering::testPhongShading() { const QgsRectangle fullExtent = mLayerDtm->extent(); - std::unique_ptr buildings = std::make_unique( testDataPath( "/3d/buildings.shp" ), "buildings", "ogr" ); + auto buildings = std::make_unique( testDataPath( "/3d/buildings.shp" ), "buildings", "ogr" ); QVERIFY( buildings->isValid() ); QgsPhongMaterialSettings materialSettings; @@ -875,7 +875,7 @@ void TestQgs3DRendering::testExtrudedPolygonsMetalRoughShading() { const QgsRectangle fullExtent = mLayerDtm->extent(); - std::unique_ptr buildings = std::make_unique( testDataPath( "/3d/buildings.shp" ), "buildings", "ogr" ); + auto buildings = std::make_unique( testDataPath( "/3d/buildings.shp" ), "buildings", "ogr" ); QVERIFY( buildings->isValid() ); QgsMetalRoughMaterialSettings materialSettings; @@ -937,8 +937,8 @@ void TestQgs3DRendering::testPolygonsEdges() std::unique_ptr layer( mLayerBuildings->clone() ); - std::unique_ptr simpleFill = std::make_unique( QColor( 0, 0, 0 ), Qt::SolidPattern, QColor( 0, 0, 0 ), Qt::NoPen ); - std::unique_ptr fillSymbol = std::make_unique( QgsSymbolLayerList() << simpleFill.release() ); + auto simpleFill = std::make_unique( QColor( 0, 0, 0 ), Qt::SolidPattern, QColor( 0, 0, 0 ), Qt::NoPen ); + auto fillSymbol = std::make_unique( QgsSymbolLayerList() << simpleFill.release() ); layer->setRenderer( new QgsSingleSymbolRenderer( fillSymbol.release() ) ); QgsVectorLayer3DRenderer *renderer3d = new QgsVectorLayer3DRenderer( symbol3d ); @@ -1099,7 +1099,7 @@ void TestQgs3DRendering::testLineRenderingCurved() QVector pts; pts << QgsPoint( 0, 0, 10 ) << QgsPoint( 0, 1000, 10 ) << QgsPoint( 1000, 1000, 10 ) << QgsPoint( 1000, 0, 10 ); - std::unique_ptr curve = std::make_unique(); + auto curve = std::make_unique(); curve->addCurve( new QgsLineString( pts ) ); pts.clear(); pts << QgsPoint( 1000, 0, 10 ) << QgsPoint( 1000, 0, 500 ) << QgsPoint( 1000, 1000, 500 ) << QgsPoint( 0, 1000, 500 ) << QgsPoint( 0, 0, 500 ); diff --git a/tests/src/analysis/testqgsgeometrysnapper.cpp b/tests/src/analysis/testqgsgeometrysnapper.cpp index a83b9e435b83..2e7e54c74f07 100644 --- a/tests/src/analysis/testqgsgeometrysnapper.cpp +++ b/tests/src/analysis/testqgsgeometrysnapper.cpp @@ -80,7 +80,7 @@ void TestQgsGeometrySnapper::cleanup() void TestQgsGeometrySnapper::snapPolygonToPolygon() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Polygon((0 0, 10 0, 10 10, 0 10, 0 0))" ) ); ff.setGeometry( refGeom ); @@ -110,7 +110,7 @@ void TestQgsGeometrySnapper::snapPolygonToPolygon() void TestQgsGeometrySnapper::snapLineToLine() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); // closed linestrings @@ -162,7 +162,7 @@ void TestQgsGeometrySnapper::snapLineToLine() void TestQgsGeometrySnapper::snapLineToPolygon() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); // closed linestrings @@ -214,7 +214,7 @@ void TestQgsGeometrySnapper::snapLineToPolygon() void TestQgsGeometrySnapper::snapLineToPoint() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Point(0 0)" ) ); QgsFeature ff( 0 ); @@ -243,7 +243,7 @@ void TestQgsGeometrySnapper::snapLineToPoint() void TestQgsGeometrySnapper::snapPolygonToLine() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); // closed linestring const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "LineString(0 0, 10 0, 10 10, 0 10, 0 0)" ) ); @@ -301,7 +301,7 @@ void TestQgsGeometrySnapper::snapPolygonToLine() void TestQgsGeometrySnapper::snapPolygonToPoint() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Point(0 0)" ) ); QgsFeature ff( 0 ); @@ -330,7 +330,7 @@ void TestQgsGeometrySnapper::snapPolygonToPoint() void TestQgsGeometrySnapper::snapPointToPoint() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Point(0 0)" ) ); QgsFeature ff( 0 ); @@ -354,7 +354,7 @@ void TestQgsGeometrySnapper::snapPointToPoint() void TestQgsGeometrySnapper::snapPointToLine() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); // closed linestring const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "LineString(0 0, 10 0, 10 10, 0 10, 0 0)" ) ); @@ -384,7 +384,7 @@ void TestQgsGeometrySnapper::snapPointToLine() void TestQgsGeometrySnapper::snapPointToLinePreferNearest() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); // closed linestring const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "LineString(0 0, 10 0, 10 10, 0 10, 0 0)" ) ); @@ -402,7 +402,7 @@ void TestQgsGeometrySnapper::snapPointToLinePreferNearest() void TestQgsGeometrySnapper::snapPointToPolygon() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); // closed linestring const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Polygon((0 0, 10 0, 10 10, 0 10, 0 0))" ) ); @@ -424,7 +424,7 @@ void TestQgsGeometrySnapper::snapPointToPolygon() void TestQgsGeometrySnapper::endPointSnap() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "LineString(0 0, 100 0, 100 100, 0 100)" ) ); @@ -449,7 +449,7 @@ void TestQgsGeometrySnapper::endPointSnap() void TestQgsGeometrySnapper::endPointToEndPoint() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Linestring" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); // closed linestrings @@ -620,7 +620,7 @@ void TestQgsGeometrySnapper::duplicateNodes() void TestQgsGeometrySnapper::snapMultiPolygonToPolygon() { - std::unique_ptr rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto rl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "Polygon((0 0, 10 0, 10 10, 0 10, 0 0))" ) ); ff.setGeometry( refGeom ); diff --git a/tests/src/analysis/testqgsinterpolator.cpp b/tests/src/analysis/testqgsinterpolator.cpp index 861fbad1d4b5..b165c817d76b 100644 --- a/tests/src/analysis/testqgsinterpolator.cpp +++ b/tests/src/analysis/testqgsinterpolator.cpp @@ -291,7 +291,7 @@ void TestQgsInterpolator::dualEdge() void TestQgsInterpolator::TIN_IDW_Interpolator_with_Z() { - std::unique_ptr mLayerPoint = std::make_unique( QStringLiteral( "PointZ" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); + auto mLayerPoint = std::make_unique( QStringLiteral( "PointZ" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); const QString wkt1 = "PointZ (0.0 0.0 1.0)"; const QString wkt2 = "PointZ (2.0 0.0 2.0)"; @@ -360,7 +360,7 @@ void TestQgsInterpolator::TIN_IDW_Interpolator_with_Z() void TestQgsInterpolator::TIN_IDW_Interpolator_with_attribute() { - std::unique_ptr mLayerPoint = std::make_unique( QStringLiteral( "Point?field=ZValue:real" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); + auto mLayerPoint = std::make_unique( QStringLiteral( "Point?field=ZValue:real" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); QVERIFY( mLayerPoint->fields().field( "ZValue" ).type() == QMetaType::Type::Double ); diff --git a/tests/src/analysis/testqgsnetworkanalysis.cpp b/tests/src/analysis/testqgsnetworkanalysis.cpp index 01f6dfb92baf..b3115b3015f4 100644 --- a/tests/src/analysis/testqgsnetworkanalysis.cpp +++ b/tests/src/analysis/testqgsnetworkanalysis.cpp @@ -131,7 +131,7 @@ void TestQgsNetworkAnalysis::testGraph() std::unique_ptr TestQgsNetworkAnalysis::buildNetwork() { - std::unique_ptr l = std::make_unique( QStringLiteral( "LineString?crs=epsg:4326&field=cost:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto l = std::make_unique( QStringLiteral( "LineString?crs=epsg:4326&field=cost:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsFeature ff( 0 ); const QgsGeometry refGeom = QgsGeometry::fromWkt( QStringLiteral( "LineString(0 0, 10 0, 10 10)" ) ); @@ -148,10 +148,10 @@ std::unique_ptr TestQgsNetworkAnalysis::buildNetwork() void TestQgsNetworkAnalysis::testBuild() { std::unique_ptr network = buildNetwork(); - std::unique_ptr director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); - std::unique_ptr strategy = std::make_unique(); + auto director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); + auto strategy = std::make_unique(); director->addStrategy( strategy.release() ); - std::unique_ptr builder = std::make_unique( network->sourceCrs(), true, 0 ); + auto builder = std::make_unique( network->sourceCrs(), true, 0 ); QVector snapped; director->makeGraph( builder.get(), QVector() << QgsPointXY( 0, 0 ) << QgsPointXY( 10, 10 ), snapped ); @@ -206,10 +206,10 @@ void TestQgsNetworkAnalysis::testBuildTolerance() flist << ff; network->dataProvider()->addFeatures( flist ); - std::unique_ptr director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); - std::unique_ptr strategy = std::make_unique(); + auto director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); + auto strategy = std::make_unique(); director->addStrategy( strategy.release() ); - std::unique_ptr builder = std::make_unique( network->sourceCrs(), true, 0 ); + auto builder = std::make_unique( network->sourceCrs(), true, 0 ); QVector snapped; director->makeGraph( builder.get(), QVector(), snapped ); @@ -319,10 +319,10 @@ void TestQgsNetworkAnalysis::dijkkjkjkskkjsktra() */ // build graph - std::unique_ptr director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); + auto director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); std::unique_ptr strategy = std::make_unique(); director->addStrategy( strategy.release() ); - std::unique_ptr builder = std::make_unique( network->sourceCrs(), true, 0 ); + auto builder = std::make_unique( network->sourceCrs(), true, 0 ); QVector snapped; director->makeGraph( builder.get(), QVector(), snapped ); @@ -458,7 +458,7 @@ void TestQgsNetworkAnalysis::dijkkjkjkskkjsktra() void TestQgsNetworkAnalysis::testRouteFail() { - std::unique_ptr network = std::make_unique( QStringLiteral( "LineString?crs=epsg:28355&field=cost:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto network = std::make_unique( QStringLiteral( "LineString?crs=epsg:28355&field=cost:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); const QStringList lines = QStringList() << QStringLiteral( "LineString (302081.71116495534079149 5753475.15082756895571947, 302140.54234686412382871 5753417.70564490929245949, 302143.24717211339157075 5753412.57312887348234653, 302143.17789465241366997 5753406.77192200440913439, 302140.35127420048229396 5753401.70546196680516005, 302078.46200818457873538 5753338.31098813004791737, 302038.17299743194598705 5753309.50200006738305092)" ) << QStringLiteral( "LineString (302081.70763194985920563 5753475.1403581602498889, 301978.24500802176771685 5753368.03299263771623373)" ) @@ -475,10 +475,10 @@ void TestQgsNetworkAnalysis::testRouteFail() network->dataProvider()->addFeatures( flist ); // build graph - std::unique_ptr director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); + auto director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); std::unique_ptr strategy = std::make_unique(); director->addStrategy( strategy.release() ); - std::unique_ptr builder = std::make_unique( network->sourceCrs(), true, 1 ); + auto builder = std::make_unique( network->sourceCrs(), true, 1 ); const QgsPointXY start( 302131.1053754404, 5753392.757948928 ); const QgsPointXY end( 302148.1636281528, 5753541.408436851 ); @@ -511,7 +511,7 @@ void TestQgsNetworkAnalysis::testRouteFail() void TestQgsNetworkAnalysis::testRouteFail2() { - std::unique_ptr network = std::make_unique( QStringLiteral( "LineString?crs=epsg:4326&field=cost:double" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto network = std::make_unique( QStringLiteral( "LineString?crs=epsg:4326&field=cost:double" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); const QStringList lines = QStringList() << QStringLiteral( "LineString (11.25044997999680874 48.42605439713970128, 11.25044693759680925 48.42603339773970106, 11.25044760759680962 48.42591690773969759, 11.25052289759680946 48.42589190773969676)" ) << QStringLiteral( "LineString (11.25052289759680946 48.42589190773969676, 11.25050350759680917 48.42586202773969717, 11.25047190759680937 48.42581754773969749, 11.2504146475968092 48.42573849773970096, 11.25038716759680923 48.42569834773969717, 11.2502920175968093 48.42557470773969897, 11.25019984759680902 48.42560406773969817, 11.25020393759680992 48.42571203773970012, 11.2502482875968095 48.42577478773969801, 11.25021922759680848 48.42578442773969982)" ) @@ -531,10 +531,10 @@ void TestQgsNetworkAnalysis::testRouteFail2() network->dataProvider()->addFeatures( flist ); // build graph - std::unique_ptr director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); + auto director = std::make_unique( network.get(), -1, QString(), QString(), QString(), QgsVectorLayerDirector::DirectionBoth ); std::unique_ptr strategy = std::make_unique(); director->addStrategy( strategy.release() ); - std::unique_ptr builder = std::make_unique( network->sourceCrs(), true, 0 ); + auto builder = std::make_unique( network->sourceCrs(), true, 0 ); const QgsPointXY start( 11.250443581846053, 48.42605665308498 ); const QgsPointXY end( 11.250525546822013, 48.42561343506683 ); diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 39839d721f92..ea2041deddaf 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -2176,9 +2176,9 @@ void TestQgsProcessing::generateTemporaryDestination() void TestQgsProcessing::removePointerValuesFromMap() { - std::unique_ptr vl = std::make_unique( "Point?crs=epsg:3111", "v1", "memory" ); + auto vl = std::make_unique( "Point?crs=epsg:3111", "v1", "memory" ); const QString raster1 = QStringLiteral( TEST_DATA_DIR ) + '/' + "landsat_4326.tif"; - std::unique_ptr rl = std::make_unique( raster1, "R1" ); + auto rl = std::make_unique( raster1, "R1" ); QPointer rl1Pointer( rl.get() ); const QVariantMap source { { QStringLiteral( "k1" ), 5 }, { QStringLiteral( "k2" ), QStringLiteral( "aa" ) }, { QStringLiteral( "k3" ), QVariantList() << QStringLiteral( "aa" ) << 3 << QVariant::fromValue( vl.get() ) }, { QStringLiteral( "k4" ), QVariantMap { { QStringLiteral( "kk1" ), 5 }, { QStringLiteral( "kk2" ), QVariant::fromValue( rl1Pointer ) } } } }; @@ -2815,13 +2815,13 @@ void TestQgsProcessing::parameters() // setting layer name to match... context2.layersToLoadOnCompletion().values().at( 0 ).setOutputLayerName( nullptr ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point" ), QString(), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); context2.layersToLoadOnCompletion().values().at( 0 ).setOutputLayerName( vl.get() ); // temporary layer, must use output name as layer name QCOMPARE( vl->name(), QStringLiteral( "my_dest" ) ); // otherwise expect to use path - std::unique_ptr rl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/landsat.tif", QString() ); + auto rl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/landsat.tif", QString() ); context2.layersToLoadOnCompletion().values().at( 0 ).setOutputLayerName( rl.get() ); QCOMPARE( rl->name(), QStringLiteral( "landsat" ) ); // unless setting prohibits it... @@ -12051,7 +12051,7 @@ void TestQgsProcessing::checkParamValues() void TestQgsProcessing::runAlgorithm() { - std::unique_ptr a = std::make_unique( "asd" ); + auto a = std::make_unique( "asd" ); a->mRaiseProcessException = false; a->mPrepared = false; a->mProcessed = false; @@ -12456,7 +12456,7 @@ void TestQgsProcessing::tempUtils() QVERIFY( tempFile3.startsWith( tempFolder ) ); // change temp folder in the settings - std::unique_ptr dir = std::make_unique(); + auto dir = std::make_unique(); const QString tempDirPath = dir->path(); dir.reset(); @@ -12527,7 +12527,7 @@ void TestQgsProcessing::convertCompatible() QVERIFY( out.startsWith( QgsProcessingUtils::tempFolder() ) ); // make sure all features are copied - std::unique_ptr t = std::make_unique( out, "vl2" ); + auto t = std::make_unique( out, "vl2" ); QCOMPARE( layer->featureCount(), t->featureCount() ); QCOMPARE( layer->crs().authid(), QStringLiteral( "EPSG:4326" ) ); @@ -12618,7 +12618,7 @@ void TestQgsProcessing::convertCompatible() QCOMPARE( layerName, QString() ); // non-OGR source -- must be translated, regardless of extension. (e.g. delimited text provider handles CSV very different to OGR!) - std::unique_ptr memLayer = std::make_unique( "Point", "v1", "memory" ); + auto memLayer = std::make_unique( "Point", "v1", "memory" ); for ( int i = 1; i < 6; ++i ) { QgsFeature f( i ); @@ -12642,7 +12642,7 @@ void TestQgsProcessing::convertCompatible() //delimited text -- must be translated, regardless of extension. (delimited text provider handles CSV very different to OGR!) const QString csvPath = "file://" + testDataDir + "delimitedtext/testpt.csv?type=csv&useHeader=No&detectTypes=yes&xyDms=yes&geomType=none&subsetIndex=no&watchFile=no"; - std::unique_ptr csvLayer = std::make_unique( csvPath, "vl", "delimitedtext" ); + auto csvLayer = std::make_unique( csvPath, "vl", "delimitedtext" ); QVERIFY( csvLayer->isValid() ); out = QgsProcessingUtils::convertToCompatibleFormat( csvLayer.get(), false, QStringLiteral( "test" ), QStringList() << "csv", QString( "csv" ), context, &feedback ); QVERIFY( out != csvLayer->source() ); @@ -12661,7 +12661,7 @@ void TestQgsProcessing::convertCompatible() // geopackage with layer QString gpkgPath = testDataDir + "points_gpkg.gpkg|layername=points_gpkg"; - std::unique_ptr gpkgLayer = std::make_unique( gpkgPath, "vl" ); + auto gpkgLayer = std::make_unique( gpkgPath, "vl" ); QVERIFY( gpkgLayer->isValid() ); out = QgsProcessingUtils::convertToCompatibleFormat( gpkgLayer.get(), false, QStringLiteral( "test" ), QStringList() << "gpkg" << "shp", QString( "shp" ), context, &feedback ); // layer must be translated -- we do not know if external tool can handle picking the correct layer automatically diff --git a/tests/src/analysis/testqgsprocessingalgspt1.cpp b/tests/src/analysis/testqgsprocessingalgspt1.cpp index b66380f3cbc8..1e3b8e28120e 100644 --- a/tests/src/analysis/testqgsprocessingalgspt1.cpp +++ b/tests/src/analysis/testqgsprocessingalgspt1.cpp @@ -184,7 +184,7 @@ std::unique_ptr TestQgsProcessingAlgsPt1::fe QgsFeature TestQgsProcessingAlgsPt1::runForFeature( const std::unique_ptr &alg, QgsFeature feature, const QString &layerType, QVariantMap parameters ) { Q_ASSERT( alg.get() ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -286,7 +286,7 @@ QVariantMap pkgAlg( const QStringList &layers, const QString &outputGpkg, bool o { const QgsProcessingAlgorithm *package( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:package" ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -317,7 +317,7 @@ void TestQgsProcessingAlgsPt1::saveFeaturesAlg() parameters.insert( QStringLiteral( "OUTPUT" ), outputGeoJson ); const QgsProcessingAlgorithm *saveFeatures( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:savefeatures" ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -328,7 +328,7 @@ void TestQgsProcessingAlgsPt1::saveFeaturesAlg() QCOMPARE( outputs.value( QStringLiteral( "FILE_PATH" ) ).toString(), outputGeoJson ); QCOMPARE( outputs.value( QStringLiteral( "LAYER_NAME" ) ).toString(), layerName ); - std::unique_ptr savedLayer = std::make_unique( outputs.value( QStringLiteral( "OUTPUT" ) ).toString(), "points", "ogr" ); + auto savedLayer = std::make_unique( outputs.value( QStringLiteral( "OUTPUT" ) ).toString(), "points", "ogr" ); QVERIFY( savedLayer->isValid() ); QCOMPARE( savedLayer->getFeature( 1 ).geometry().asPoint().x(), -83.3 ); } @@ -386,18 +386,18 @@ void TestQgsProcessingAlgsPt1::packageAlg() QVERIFY( ok ); QVERIFY( !results.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr pointLayer = std::make_unique( outputGpkg + "|layername=points", "points", "ogr" ); + auto pointLayer = std::make_unique( outputGpkg + "|layername=points", "points", "ogr" ); QVERIFY( pointLayer->isValid() ); QCOMPARE( pointLayer->wkbType(), mPointsLayer->wkbType() ); QCOMPARE( pointLayer->featureCount(), mPointsLayer->featureCount() ); pointLayer.reset(); - std::unique_ptr polygonLayer = std::make_unique( outputGpkg + "|layername=polygons", "polygons", "ogr" ); + auto polygonLayer = std::make_unique( outputGpkg + "|layername=polygons", "polygons", "ogr" ); QVERIFY( polygonLayer->isValid() ); QCOMPARE( polygonLayer->wkbType(), mPolygonLayer->wkbType() ); QCOMPARE( polygonLayer->featureCount(), mPolygonLayer->featureCount() ); polygonLayer.reset(); - std::unique_ptr rectangles = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/rectangles.shp", QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto rectangles = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/rectangles.shp", QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QgsProject::instance()->addMapLayers( QList() << rectangles.get() ); QgsLayerMetadata metadata; metadata.setFees( QStringLiteral( "lots of dogecoin" ) ); @@ -408,7 +408,7 @@ void TestQgsProcessingAlgsPt1::packageAlg() QVERIFY( ok ); QVERIFY( !results2.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr rectanglesPackagedLayer = std::make_unique( outputGpkg + "|layername=rectangles", "points", "ogr" ); + auto rectanglesPackagedLayer = std::make_unique( outputGpkg + "|layername=rectangles", "points", "ogr" ); QVERIFY( rectanglesPackagedLayer->isValid() ); QCOMPARE( rectanglesPackagedLayer->wkbType(), rectanglesPackagedLayer->wkbType() ); QCOMPARE( rectanglesPackagedLayer->featureCount(), rectangles->featureCount() ); @@ -449,7 +449,7 @@ void TestQgsProcessingAlgsPt1::packageAlg() QVERIFY( ok ); QVERIFY( !results4.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr selectedPolygonsPackagedLayer = std::make_unique( outputGpkg + "|layername=polygons", "polygons", "ogr" ); + auto selectedPolygonsPackagedLayer = std::make_unique( outputGpkg + "|layername=polygons", "polygons", "ogr" ); QVERIFY( selectedPolygonsPackagedLayer->isValid() ); QCOMPARE( selectedPolygonsPackagedLayer->wkbType(), mPolygonLayer->wkbType() ); QCOMPARE( selectedPolygonsPackagedLayer->featureCount(), 3 ); @@ -472,7 +472,7 @@ void TestQgsProcessingAlgsPt1::rasterLayerProperties() const QString myDataPath( TEST_DATA_DIR ); //defined in CMakeLists.txt - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap parameters; @@ -550,7 +550,7 @@ void TestQgsProcessingAlgsPt1::exportToSpreadsheetOptions() const QgsProcessingAlgorithm *alg( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:exporttospreadsheet" ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -563,7 +563,7 @@ void TestQgsProcessingAlgsPt1::exportToSpreadsheetOptions() QVERIFY( ok ); QVERIFY( !results.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr pointLayer = std::make_unique( outputPath + "|layername=points", "points", "ogr" ); + auto pointLayer = std::make_unique( outputPath + "|layername=points", "points", "ogr" ); QCOMPARE( pointLayer->fields().at( 0 ).name(), QStringLiteral( "Class" ) ); QCOMPARE( pointLayer->fields().at( 1 ).name(), QStringLiteral( "Heading" ) ); QCOMPARE( pointLayer->fields().at( 2 ).name(), QStringLiteral( "Importance" ) ); @@ -631,7 +631,7 @@ void TestQgsProcessingAlgsPt1::exportToSpreadsheet( const QString &outputPath ) const QgsProcessingAlgorithm *alg( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:exporttospreadsheet" ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -643,16 +643,16 @@ void TestQgsProcessingAlgsPt1::exportToSpreadsheet( const QString &outputPath ) QVERIFY( ok ); QVERIFY( !results.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr pointLayer = std::make_unique( outputPath + "|layername=points", "points", "ogr" ); + auto pointLayer = std::make_unique( outputPath + "|layername=points", "points", "ogr" ); QVERIFY( pointLayer->isValid() ); QCOMPARE( pointLayer->featureCount(), mPointsLayer->featureCount() ); pointLayer.reset(); - std::unique_ptr polygonLayer = std::make_unique( outputPath + "|layername=polygons", "polygons", "ogr" ); + auto polygonLayer = std::make_unique( outputPath + "|layername=polygons", "polygons", "ogr" ); QVERIFY( polygonLayer->isValid() ); QCOMPARE( polygonLayer->featureCount(), mPolygonLayer->featureCount() ); polygonLayer.reset(); - std::unique_ptr rectangles = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/rectangles.shp", QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto rectangles = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/rectangles.shp", QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QgsProject::instance()->addMapLayers( QList() << rectangles.get() ); // Test adding an additional layer (overwrite disabled) @@ -661,7 +661,7 @@ void TestQgsProcessingAlgsPt1::exportToSpreadsheet( const QString &outputPath ) QVERIFY( ok ); QVERIFY( !results2.value( QStringLiteral( "OUTPUT" ) ).toString().isEmpty() ); - std::unique_ptr rectanglesPackagedLayer = std::make_unique( outputPath + "|layername=rectangles", "points", "ogr" ); + auto rectanglesPackagedLayer = std::make_unique( outputPath + "|layername=rectangles", "points", "ogr" ); QVERIFY( rectanglesPackagedLayer->isValid() ); QCOMPARE( rectanglesPackagedLayer->featureCount(), rectangles->featureCount() ); rectanglesPackagedLayer.reset(); @@ -690,7 +690,7 @@ void TestQgsProcessingAlgsPt1::renameLayerAlg() const QgsProcessingAlgorithm *package( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:renamelayer" ) ) ); QVERIFY( package ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsVectorLayer *layer = new QgsVectorLayer( QStringLiteral( "Point?field=col1:real" ), QStringLiteral( "layer" ), QStringLiteral( "memory" ) ); @@ -742,7 +742,7 @@ void TestQgsProcessingAlgsPt1::loadLayerAlg() const QgsProcessingAlgorithm *package( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:loadlayer" ) ) ); QVERIFY( package ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -975,7 +975,7 @@ void TestQgsProcessingAlgsPt1::transformAlg() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:reprojectlayer" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -1062,7 +1062,7 @@ void TestQgsProcessingAlgsPt1::categorizeByStyle() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:categorizeusingstyle" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -1190,7 +1190,7 @@ void TestQgsProcessingAlgsPt1::extractBinary() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:extractbinary" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -1240,7 +1240,7 @@ void TestQgsProcessingAlgsPt1::createDirectory() parameters.insert( QStringLiteral( "PATH" ), outputPath ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1272,7 +1272,7 @@ void TestQgsProcessingAlgsPt1::flattenRelations() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:flattenrelationships" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -1820,7 +1820,7 @@ void TestQgsProcessingAlgsPt1::createConstantRaster() p.setCrs( QgsCoordinateReferenceSystem( crs ), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -1845,7 +1845,7 @@ void TestQgsProcessingAlgsPt1::createConstantRaster() else { //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_constantRaster" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_constantRaster" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -1855,7 +1855,7 @@ void TestQgsProcessingAlgsPt1::createConstantRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputRaster->width(), expectedRasterLayer->width() ); @@ -2037,13 +2037,13 @@ void TestQgsProcessingAlgsPt1::fillNoData() const QString myDataPath( TEST_DATA_DIR ); //defined in CmakeLists.txt - std::unique_ptr inputRasterLayer = std::make_unique( myDataPath + inputRaster, "inputDataset", "gdal" ); + auto inputRasterLayer = std::make_unique( myDataPath + inputRaster, "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -2054,7 +2054,7 @@ void TestQgsProcessingAlgsPt1::fillNoData() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/fillNoData/" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/fillNoData/" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -2069,7 +2069,7 @@ void TestQgsProcessingAlgsPt1::fillNoData() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputRaster->width(), expectedRasterLayer->width() ); @@ -2162,7 +2162,7 @@ void TestQgsProcessingAlgsPt1::lineDensity() p.setCrs( layer->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -2174,7 +2174,7 @@ void TestQgsProcessingAlgsPt1::lineDensity() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRaster = std::make_unique( myDataPath + "/control_images/expected_raster_linedensity" + expectedDataset, "expectedDataset", "gdal" ); + auto expectedRaster = std::make_unique( myDataPath + "/control_images/expected_raster_linedensity" + expectedDataset, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRaster->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRaster->width(), expectedRaster->height(), expectedInterface->extent() ); @@ -2189,7 +2189,7 @@ void TestQgsProcessingAlgsPt1::lineDensity() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputRaster->width(), expectedRaster->width() ); @@ -2377,7 +2377,7 @@ void TestQgsProcessingAlgsPt1::rasterLogicOp() // create a GeoTIFF - this will create data provider in editable mode const QString filename = tmpFile.fileName(); - std::unique_ptr writer = std::make_unique( filename ); + auto writer = std::make_unique( filename ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); writer->setOutputFormat( QStringLiteral( "GTiff" ) ); std::unique_ptr dp( writer->createOneBandRaster( Qgis::DataType::Float32, nCols, nRows, input[ii].empty() ? badExtent : extent, crs ) ); @@ -2730,13 +2730,13 @@ void TestQgsProcessingAlgsPt1::cellStatistics() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -2748,7 +2748,7 @@ void TestQgsProcessingAlgsPt1::cellStatistics() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStatistics/" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStatistics/" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -2763,7 +2763,7 @@ void TestQgsProcessingAlgsPt1::cellStatistics() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -2984,13 +2984,13 @@ void TestQgsProcessingAlgsPt1::percentileRaster() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -3003,7 +3003,7 @@ void TestQgsProcessingAlgsPt1::percentileRaster() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentile/" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentile/" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -3017,7 +3017,7 @@ void TestQgsProcessingAlgsPt1::percentileRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -3223,13 +3223,13 @@ void TestQgsProcessingAlgsPt1::percentrankByRaster() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -3244,7 +3244,7 @@ void TestQgsProcessingAlgsPt1::percentrankByRaster() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentrankFromRaster/" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentrankFromRaster/" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -3258,7 +3258,7 @@ void TestQgsProcessingAlgsPt1::percentrankByRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -3396,13 +3396,13 @@ void TestQgsProcessingAlgsPt1::percentrankByValue() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -3416,7 +3416,7 @@ void TestQgsProcessingAlgsPt1::percentrankByValue() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentrankFromValue/" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images/expected_cellStackPercentrankFromValue/" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -3430,7 +3430,7 @@ void TestQgsProcessingAlgsPt1::percentrankByValue() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -3640,13 +3640,13 @@ void TestQgsProcessingAlgsPt1::rasterFrequencyByComparisonOperator() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -3658,7 +3658,7 @@ void TestQgsProcessingAlgsPt1::rasterFrequencyByComparisonOperator() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -3673,7 +3673,7 @@ void TestQgsProcessingAlgsPt1::rasterFrequencyByComparisonOperator() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -3784,13 +3784,13 @@ void TestQgsProcessingAlgsPt1::rasterLocalPosition() inputDatasetPaths << myDataPath + raster; } - std::unique_ptr inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); + auto inputRasterLayer1 = std::make_unique( myDataPath + inputRasters[0], "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer1->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -3801,7 +3801,7 @@ void TestQgsProcessingAlgsPt1::rasterLocalPosition() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( myDataPath + "/control_images" + expectedRaster, "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( myDataPath + "/control_images" + expectedRaster, "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -3815,7 +3815,7 @@ void TestQgsProcessingAlgsPt1::rasterLocalPosition() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputRaster->width(), expectedRasterLayer->width() ); @@ -4004,13 +4004,13 @@ void TestQgsProcessingAlgsPt1::roundRasterValues() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:roundrastervalues" ) ) ); const QString rasterSource = copyTestData( inputRaster ); - std::unique_ptr inputRasterLayer = std::make_unique( rasterSource, "inputDataset", "gdal" ); + auto inputRasterLayer = std::make_unique( rasterSource, "inputDataset", "gdal" ); //set project crs and ellipsoid from input layer p.setCrs( inputRasterLayer->crs(), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -4023,7 +4023,7 @@ void TestQgsProcessingAlgsPt1::roundRasterValues() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); //prepare expectedRaster - std::unique_ptr expectedRasterLayer = std::make_unique( testDataPath( "/control_images/roundRasterValues/" + expectedRaster ), "expectedDataset", "gdal" ); + auto expectedRasterLayer = std::make_unique( testDataPath( "/control_images/roundRasterValues/" + expectedRaster ), "expectedDataset", "gdal" ); std::unique_ptr expectedInterface( expectedRasterLayer->dataProvider()->clone() ); QgsRasterIterator expectedIter( expectedInterface.get() ); expectedIter.startRasterRead( 1, expectedRasterLayer->width(), expectedRasterLayer->height(), expectedInterface->extent() ); @@ -4038,7 +4038,7 @@ void TestQgsProcessingAlgsPt1::roundRasterValues() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputRaster->width(), expectedRasterLayer->width() ); @@ -4077,7 +4077,7 @@ void TestQgsProcessingAlgsPt1::layoutMapExtent() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:printlayoutmapextenttolayer" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -4263,7 +4263,7 @@ void TestQgsProcessingAlgsPt1::styleFromProject() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:stylefromproject" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -4353,7 +4353,7 @@ void TestQgsProcessingAlgsPt1::combineStyles() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:combinestyles" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap parameters; parameters.insert( QStringLiteral( "INPUT" ), QStringList() << tmpFile.fileName() << tmpFile2.fileName() ); @@ -4412,7 +4412,7 @@ void TestQgsProcessingAlgsPt1::bookmarksToLayer() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:bookmarkstolayer" ) ) ); QVERIFY( alg != nullptr ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -4497,7 +4497,7 @@ void TestQgsProcessingAlgsPt1::layerToBookmarks() QVERIFY( alg != nullptr ); QgsProject p; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -4555,7 +4555,7 @@ void TestQgsProcessingAlgsPt1::repairShapefile() QFile::copy( dataDir + "/points.shp", tmpPath.filePath( QStringLiteral( "points.dbf" ) ) ); // no shx!! - std::unique_ptr layer = std::make_unique( tmpPath.filePath( QStringLiteral( "points.shp" ) ) ); + auto layer = std::make_unique( tmpPath.filePath( QStringLiteral( "points.shp" ) ) ); QVERIFY( !layer->isValid() ); std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:repairshapefile" ) ) ); @@ -4566,7 +4566,7 @@ void TestQgsProcessingAlgsPt1::repairShapefile() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4599,7 +4599,7 @@ void TestQgsProcessingAlgsPt1::renameField() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4648,7 +4648,7 @@ void TestQgsProcessingAlgsPt1::compareDatasets() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4819,7 +4819,7 @@ void TestQgsProcessingAlgsPt1::shapefileEncoding() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4863,7 +4863,7 @@ void TestQgsProcessingAlgsPt1::setLayerEncoding() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap results; @@ -4910,7 +4910,7 @@ void TestQgsProcessingAlgsPt1::raiseException() parameters.insert( QStringLiteral( "MESSAGE" ), QStringLiteral( "you done screwed up boy" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4944,7 +4944,7 @@ void TestQgsProcessingAlgsPt1::raiseWarning() parameters.insert( QStringLiteral( "MESSAGE" ), QStringLiteral( "you mighta screwed up boy, but i aint so sure" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -4978,7 +4978,7 @@ void TestQgsProcessingAlgsPt1::raiseMessage() parameters.insert( QStringLiteral( "MESSAGE" ), QStringLiteral( "nothing screwed up boy, congrats" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -5055,7 +5055,7 @@ void TestQgsProcessingAlgsPt1::randomFloatingPointDistributionRaster() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( algname ) ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -5083,7 +5083,7 @@ void TestQgsProcessingAlgsPt1::randomFloatingPointDistributionRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -5180,7 +5180,7 @@ void TestQgsProcessingAlgsPt1::randomIntegerDistributionRaster() std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( algname ) ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -5208,7 +5208,7 @@ void TestQgsProcessingAlgsPt1::randomIntegerDistributionRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -5464,7 +5464,7 @@ void TestQgsProcessingAlgsPt1::randomRaster() p.setCrs( QgsCoordinateReferenceSystem( crs ), true ); //set project after layer has been added so that transform context/ellipsoid from crs is also set - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QVariantMap parameters; @@ -5494,7 +5494,7 @@ void TestQgsProcessingAlgsPt1::randomRaster() QVERIFY( ok ); //...and check results with expected datasets - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); std::unique_ptr outputInterface( outputRaster->dataProvider()->clone() ); QCOMPARE( outputInterface->dataType( 1 ), expectedDataType ); @@ -5543,7 +5543,7 @@ void TestQgsProcessingAlgsPt1::filterByLayerType() parameters.insert( QStringLiteral( "INPUT" ), QStringLiteral( "vl" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -5587,7 +5587,7 @@ void TestQgsProcessingAlgsPt1::conditionalBranch() parameters.insert( QStringLiteral( "INPUT" ), QStringLiteral( "vl" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok, config ); @@ -5605,7 +5605,7 @@ void TestQgsProcessingAlgsPt1::saveLog() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; feedback.reportError( QStringLiteral( "test" ) ); QVariantMap results; @@ -5636,7 +5636,7 @@ void TestQgsProcessingAlgsPt1::setProjectVariable() parameters.insert( QStringLiteral( "VALUE" ), 11 ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); QgsProcessingFeedback feedback; diff --git a/tests/src/analysis/testqgsprocessingalgspt2.cpp b/tests/src/analysis/testqgsprocessingalgspt2.cpp index 26514b47392c..a53e0a9b40d5 100644 --- a/tests/src/analysis/testqgsprocessingalgspt2.cpp +++ b/tests/src/analysis/testqgsprocessingalgspt2.cpp @@ -125,7 +125,7 @@ std::unique_ptr TestQgsProcessingAlgsPt2::fe QgsFeature TestQgsProcessingAlgsPt2::runForFeature( const std::unique_ptr &alg, QgsFeature feature, const QString &layerType, QVariantMap parameters ) { Q_ASSERT( alg.get() ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProject p; context->setProject( &p ); @@ -219,7 +219,7 @@ QVariantMap pkgAlg( const QStringList &layers, const QString &outputGpkg, bool o { const QgsProcessingAlgorithm *package( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "native:package" ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -253,7 +253,7 @@ void TestQgsProcessingAlgsPt2::exportLayoutPdf() parameters.insert( QStringLiteral( "OUTPUT" ), outputPdf ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -297,7 +297,7 @@ void TestQgsProcessingAlgsPt2::exportLayoutPng() parameters.insert( QStringLiteral( "OUTPUT" ), outputPng ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -357,7 +357,7 @@ void TestQgsProcessingAlgsPt2::exportAtlasLayoutPdf() parameters.insert( QStringLiteral( "DPI" ), 96 ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -402,7 +402,7 @@ void TestQgsProcessingAlgsPt2::exportAtlasLayoutPdfMultiple() parameters.insert( QStringLiteral( "DPI" ), 96 ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -453,7 +453,7 @@ void TestQgsProcessingAlgsPt2::exportAtlasLayoutPng() parameters.insert( QStringLiteral( "DPI" ), 96 ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -503,7 +503,7 @@ void TestQgsProcessingAlgsPt2::tinMeshCreation() parameters.insert( QStringLiteral( "OUTPUT_MESH" ), QString( QDir::tempPath() + "/meshLayer.2dm" ) ); parameters.insert( QStringLiteral( "MESH_FORMAT" ), 0 ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -545,7 +545,7 @@ void TestQgsProcessingAlgsPt2::exportMeshVertices() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); parameters.insert( QStringLiteral( "VECTOR_OPTION" ), 2 ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -627,7 +627,7 @@ void TestQgsProcessingAlgsPt2::exportMeshFaces() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); parameters.insert( QStringLiteral( "VECTOR_OPTION" ), 2 ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -688,7 +688,7 @@ void TestQgsProcessingAlgsPt2::exportMeshEdges() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); parameters.insert( QStringLiteral( "VECTOR_OPTION" ), 2 ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -763,7 +763,7 @@ void TestQgsProcessingAlgsPt2::exportMeshOnGrid() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); parameters.insert( QStringLiteral( "VECTOR_OPTION" ), 2 ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -823,7 +823,7 @@ void TestQgsProcessingAlgsPt2::rasterizeMesh() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -831,7 +831,7 @@ void TestQgsProcessingAlgsPt2::rasterizeMesh() results = alg->run( parameters, *context, &feedback, &ok ); QVERIFY( ok ); - std::unique_ptr outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); + auto outputRaster = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "output", "gdal" ); QVERIFY( outputRaster ); QVERIFY( outputRaster->isValid() ); QgsRasterDataProvider *outputProvider = outputRaster->dataProvider(); @@ -846,7 +846,7 @@ void TestQgsProcessingAlgsPt2::rasterizeMesh() // load expected result const QString dataDir = QString( TEST_DATA_DIR ); //defined in CmakeLists.txt - std::unique_ptr expectedRaster = std::make_unique( dataDir + "/mesh/rasterized_mesh.tif", "expected", "gdal" ); + auto expectedRaster = std::make_unique( dataDir + "/mesh/rasterized_mesh.tif", "expected", "gdal" ); QVERIFY( expectedRaster ); QVERIFY( expectedRaster->isValid() ); QgsRasterDataProvider *expectedProvider = outputRaster->dataProvider(); @@ -890,7 +890,7 @@ void TestQgsProcessingAlgsPt2::exportMeshContours() parameters.insert( QStringLiteral( "OUTPUT_LINES" ), QgsProcessing::TEMPORARY_OUTPUT ); parameters.insert( QStringLiteral( "OUTPUT_POLYGONS" ), QgsProcessing::TEMPORARY_OUTPUT ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -1049,7 +1049,7 @@ void TestQgsProcessingAlgsPt2::exportMeshCrossSection() QgsVectorLayer *layerLine = new QgsVectorLayer( QStringLiteral( "LineString" ), QStringLiteral( "lines_for_xs" ), QStringLiteral( "memory" ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -1135,7 +1135,7 @@ void TestQgsProcessingAlgsPt2::fileDownloader() parameters.insert( QStringLiteral( "URL" ), QStringLiteral( "https://version.qgis.org/version.txt" ) ); parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; bool ok = false; @@ -1175,7 +1175,7 @@ void TestQgsProcessingAlgsPt2::rasterize() QVERIFY( nodePolygons ); nodePolygons->setItemVisibilityChecked( false ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &project ); QgsProcessingFeedback feedback; QVariantMap results; @@ -1255,7 +1255,7 @@ void TestQgsProcessingAlgsPt2::convertGpsData() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1319,7 +1319,7 @@ void TestQgsProcessingAlgsPt2::downloadGpsData() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1353,7 +1353,7 @@ void TestQgsProcessingAlgsPt2::uploadGpsData() parameters.insert( QStringLiteral( "INPUT" ), QStringLiteral( "%1/layers.gpx" ).arg( TEST_DATA_DIR ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1381,7 +1381,7 @@ void TestQgsProcessingAlgsPt2::transferMainAnnotationLayer() QgsProject p; p.mainAnnotationLayer()->addItem( new QgsAnnotationMarkerItem( QgsPoint( 1, 2 ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &p ); QgsProcessingFeedback feedback; QVariantMap results; @@ -1429,7 +1429,7 @@ void TestQgsProcessingAlgsPt2::exportMeshTimeSeries() QgsVectorLayer *layerPoints = new QgsVectorLayer( QStringLiteral( "Point" ), QStringLiteral( "points_for_ts" ), QStringLiteral( "memory" ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; QVariantMap results; @@ -1554,7 +1554,7 @@ void TestQgsProcessingAlgsPt2::extractLabels() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &project ); QgsProcessingFeedback feedback; @@ -1601,7 +1601,7 @@ void TestQgsProcessingAlgsPt2::dxfExport() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( &project ); TestProcessingFeedback feedback; @@ -1609,7 +1609,7 @@ void TestQgsProcessingAlgsPt2::dxfExport() results = alg->run( parameters, *context, &feedback, &ok ); QVERIFY( ok ); - std::unique_ptr resultLayer = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "dxf" ); + auto resultLayer = std::make_unique( results.value( QStringLiteral( "OUTPUT" ) ).toString(), "dxf" ); QVERIFY( resultLayer->isValid() ); QCOMPARE( resultLayer->featureCount(), 1L ); QCOMPARE( resultLayer->wkbType(), Qgis::WkbType::LineString ); @@ -1617,7 +1617,7 @@ void TestQgsProcessingAlgsPt2::dxfExport() void TestQgsProcessingAlgsPt2::splitVectorLayer() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature f; @@ -1645,7 +1645,7 @@ void TestQgsProcessingAlgsPt2::splitVectorLayer() parameters.insert( QStringLiteral( "OUTPUT" ), outputDir.absolutePath() ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1659,7 +1659,7 @@ void TestQgsProcessingAlgsPt2::splitVectorLayer() void TestQgsProcessingAlgsPt2::buffer() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:buffer" ) ) ); @@ -1677,7 +1677,7 @@ void TestQgsProcessingAlgsPt2::buffer() parameters.insert( QStringLiteral( "OUTPUT" ), QStringLiteral( "memory:" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1706,25 +1706,25 @@ void TestQgsProcessingAlgsPt2::buffer() void TestQgsProcessingAlgsPt2::splitWithLines() { QgsFeature l1_1, l1_2, l2_1, l2_2, p1_1, p1_2, p2_1, p2_2; - std::unique_ptr lineLayer1 = std::make_unique( QStringLiteral( "MultiLineString?crs=epsg:4326" ), QStringLiteral( "l1" ), QStringLiteral( "memory" ) ); + auto lineLayer1 = std::make_unique( QStringLiteral( "MultiLineString?crs=epsg:4326" ), QStringLiteral( "l1" ), QStringLiteral( "memory" ) ); QVERIFY( lineLayer1->isValid() ); l1_1.setGeometry( QgsGeometry::fromWkt( "MultiLineString ((19 40, 26 40),(20 39, 25 39))" ) ); l1_2.setGeometry( QgsGeometry::fromWkt( "MultiLineString ((19 35, 26 35))" ) ); lineLayer1->dataProvider()->addFeature( l1_1 ); lineLayer1->dataProvider()->addFeature( l1_2 ); - std::unique_ptr lineLayer2 = std::make_unique( QStringLiteral( "MultiLineString?crs=epsg:4326" ), QStringLiteral( "l2" ), QStringLiteral( "memory" ) ); + auto lineLayer2 = std::make_unique( QStringLiteral( "MultiLineString?crs=epsg:4326" ), QStringLiteral( "l2" ), QStringLiteral( "memory" ) ); QVERIFY( lineLayer2->isValid() ); l2_1.setGeometry( QgsGeometry::fromWkt( "MultiLineString ((20 42, 20 34, 23 42))" ) ); l2_2.setGeometry( QgsGeometry::fromWkt( "MultiLineString ((21 42, 21 34),(23 42, 23 34, 25 42))" ) ); lineLayer2->dataProvider()->addFeature( l2_1 ); lineLayer2->dataProvider()->addFeature( l2_2 ); - std::unique_ptr polygonLayer1 = std::make_unique( QStringLiteral( "MultiPolygon?crs=epsg:4326" ), QStringLiteral( "p1" ), QStringLiteral( "memory" ) ); + auto polygonLayer1 = std::make_unique( QStringLiteral( "MultiPolygon?crs=epsg:4326" ), QStringLiteral( "p1" ), QStringLiteral( "memory" ) ); QVERIFY( polygonLayer1->isValid() ); p1_1.setGeometry( QgsGeometry::fromWkt( "MultiPolygon (((25 41, 25 38, 18 38, 18 41, 25 41),(19 39, 24 39, 24 40, 19 40, 19 39)))" ) ); p1_2.setGeometry( QgsGeometry::fromWkt( "MultiPolygon (((18 37, 21 37, 21 35, 18 35, 18 37),(19.5 36.5, 19.5 35.5, 20.5 35.5, 20.5 36.5, 19.5 36.5)),((22 37, 25 37, 25 35, 22 35, 22 37),(24 36, 24 35.5, 24.5 35.5, 24.5 36, 24 36),(23.5 35.5, 23.5 36.5, 22.5 36.5, 22.5 35.5, 23.5 35.5)))" ) ); polygonLayer1->dataProvider()->addFeature( p1_1 ); polygonLayer1->dataProvider()->addFeature( p1_2 ); - std::unique_ptr polygonLayer2 = std::make_unique( QStringLiteral( "MultiPolygon?crs=epsg:4326" ), QStringLiteral( "p2" ), QStringLiteral( "memory" ) ); + auto polygonLayer2 = std::make_unique( QStringLiteral( "MultiPolygon?crs=epsg:4326" ), QStringLiteral( "p2" ), QStringLiteral( "memory" ) ); QVERIFY( polygonLayer2->isValid() ); p2_1.setGeometry( QgsGeometry::fromWkt( "MultiPolygon (((23 42, 20 34, 20 42, 23 42),(20.5 38.5, 21 38.5, 21.5 40.5, 20.5 40.5, 20.5 38.5)))" ) ); p2_2.setGeometry( QgsGeometry::fromWkt( "MultiPolygon (((23 34, 23 42, 25 42, 23 34),(24 40.5, 23.5 40.5, 23.5 39.5, 24 40.5)),((19.5 34.5, 17.5 34.5, 17.5 42, 18.5 42, 19.5 34.5),(18.5 37.5, 18 37.5, 18.5 36.5, 18.5 37.5)))" ) ); @@ -1741,7 +1741,7 @@ void TestQgsProcessingAlgsPt2::splitWithLines() parameters.insert( QStringLiteral( "OUTPUT" ), QStringLiteral( "memory:" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1831,7 +1831,7 @@ void TestQgsProcessingAlgsPt2::randomPointsInPolygonsFromField() QVERIFY( alg != nullptr ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1845,7 +1845,7 @@ void TestQgsProcessingAlgsPt2::randomPointsInPolygonsFromField() void TestQgsProcessingAlgsPt2::generateElevationProfileImage() { - std::unique_ptr lineLayer = std::make_unique( QStringLiteral( "LineStringZ?crs=epsg:3857" ), QStringLiteral( "lines" ), QStringLiteral( "memory" ) ); + auto lineLayer = std::make_unique( QStringLiteral( "LineStringZ?crs=epsg:3857" ), QStringLiteral( "lines" ), QStringLiteral( "memory" ) ); QVERIFY( lineLayer->isValid() ); QgsFeature feature; feature.setGeometry( QgsGeometry::fromWkt( "LineStringZ (0 0 0, 10 10 10)" ) ); @@ -1874,7 +1874,7 @@ void TestQgsProcessingAlgsPt2::generateElevationProfileImage() parameters.insert( QStringLiteral( "OUTPUT" ), outputImage ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1885,10 +1885,10 @@ void TestQgsProcessingAlgsPt2::generateElevationProfileImage() void TestQgsProcessingAlgsPt2::copyMetadata() { - std::unique_ptr sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( sourceLayer->isValid() ); - std::unique_ptr targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); + auto targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); QVERIFY( targetLayer->isValid() ); QgsLayerMetadata md; @@ -1904,7 +1904,7 @@ void TestQgsProcessingAlgsPt2::copyMetadata() parameters.insert( QStringLiteral( "TARGET" ), QVariant::fromValue( targetLayer.get() ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1919,7 +1919,7 @@ void TestQgsProcessingAlgsPt2::copyMetadata() void TestQgsProcessingAlgsPt2::applyMetadata() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:setlayermetadata" ) ) ); @@ -1933,7 +1933,7 @@ void TestQgsProcessingAlgsPt2::applyMetadata() parameters.insert( QStringLiteral( "METADATA" ), metadataFileName ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1948,7 +1948,7 @@ void TestQgsProcessingAlgsPt2::applyMetadata() void TestQgsProcessingAlgsPt2::exportMetadata() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsLayerMetadata md; @@ -1964,7 +1964,7 @@ void TestQgsProcessingAlgsPt2::exportMetadata() parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -1993,7 +1993,7 @@ void TestQgsProcessingAlgsPt2::exportMetadata() void TestQgsProcessingAlgsPt2::addHistoryMetadata() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsLayerMetadata md; @@ -2009,7 +2009,7 @@ void TestQgsProcessingAlgsPt2::addHistoryMetadata() parameters.insert( QStringLiteral( "HISTORY" ), QStringLiteral( "do something" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -2037,10 +2037,10 @@ void TestQgsProcessingAlgsPt2::addHistoryMetadata() void TestQgsProcessingAlgsPt2::updateMetadata() { - std::unique_ptr sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( sourceLayer->isValid() ); - std::unique_ptr targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); + auto targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); QVERIFY( targetLayer->isValid() ); QgsLayerMetadata mdInput; @@ -2063,7 +2063,7 @@ void TestQgsProcessingAlgsPt2::updateMetadata() parameters.insert( QStringLiteral( "TARGET" ), QVariant::fromValue( targetLayer.get() ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -2080,7 +2080,7 @@ void TestQgsProcessingAlgsPt2::updateMetadata() void TestQgsProcessingAlgsPt2::setMetadataFields() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:setmetadatafields" ) ) ); @@ -2091,7 +2091,7 @@ void TestQgsProcessingAlgsPt2::setMetadataFields() parameters.insert( QStringLiteral( "TITLE" ), QStringLiteral( "Title" ) ); bool ok = false; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QgsProcessingFeedback feedback; QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); diff --git a/tests/src/analysis/testqgsprocessingfixgeometry.cpp b/tests/src/analysis/testqgsprocessingfixgeometry.cpp index 08df893cc12f..934136af4ffe 100644 --- a/tests/src/analysis/testqgsprocessingfixgeometry.cpp +++ b/tests/src/analysis/testqgsprocessingfixgeometry.cpp @@ -140,7 +140,7 @@ void TestQgsProcessingFixGeometry::fixAngleAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -248,7 +248,7 @@ void TestQgsProcessingFixGeometry::fixAreaAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -293,7 +293,7 @@ void TestQgsProcessingFixGeometry::fixHoleAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); @@ -343,7 +343,7 @@ void TestQgsProcessingFixGeometry::fixMissingVertexAlg() bool ok = false; QgsProcessingFeedback feedback; - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); QVariantMap results; results = alg->run( parameters, *context, &feedback, &ok ); diff --git a/tests/src/analysis/testqgsprocessingmodelalgorithm.cpp b/tests/src/analysis/testqgsprocessingmodelalgorithm.cpp index 133ef2c70c2f..cacb5f58d5b1 100644 --- a/tests/src/analysis/testqgsprocessingmodelalgorithm.cpp +++ b/tests/src/analysis/testqgsprocessingmodelalgorithm.cpp @@ -2458,7 +2458,7 @@ void TestQgsProcessingModelAlgorithm::modelExecuteWithPreviousState() context.modelResult().clear(); // start with an initial state - std::unique_ptr modelConfig = std::make_unique(); + auto modelConfig = std::make_unique(); modelConfig->setPreviouslyExecutedChildAlgorithms( { QStringLiteral( "calculate" ) } ); modelConfig->setInitialChildInputs( QVariantMap { { QStringLiteral( "calculate" ), QVariantMap { { QStringLiteral( "INPUT" ), QStringLiteral( "a different string" ) } } } } ); modelConfig->setInitialChildOutputs( QVariantMap { { QStringLiteral( "calculate" ), QVariantMap { { QStringLiteral( "OUTPUT" ), QStringLiteral( "a different string" ) } } } } ); @@ -2502,7 +2502,7 @@ void TestQgsProcessingModelAlgorithm::modelExecuteWithPreviousState() // test handling of temporary layers generated during earlier runs modelConfig = std::make_unique(); - std::unique_ptr previousStore = std::make_unique(); + auto previousStore = std::make_unique(); QgsVectorLayer *layer = new QgsVectorLayer( "Point?crs=epsg:3111", "v1", "memory" ); previousStore->addMapLayer( layer ); previousStore->moveToThread( nullptr ); diff --git a/tests/src/analysis/testqgsprocessingpdalalgs.cpp b/tests/src/analysis/testqgsprocessingpdalalgs.cpp index ddbdb4567da6..a6565c9ba5a3 100644 --- a/tests/src/analysis/testqgsprocessingpdalalgs.cpp +++ b/tests/src/analysis/testqgsprocessingpdalalgs.cpp @@ -114,7 +114,7 @@ void TestQgsProcessingPdalAlgs::info() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:info" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); QgsProcessingFeedback feedback; @@ -133,7 +133,7 @@ void TestQgsProcessingPdalAlgs::convertFormat() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:convertformat" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -158,7 +158,7 @@ void TestQgsProcessingPdalAlgs::reproject() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:reproject" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -184,7 +184,7 @@ void TestQgsProcessingPdalAlgs::assignProjection() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:assignprojection" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -210,7 +210,7 @@ void TestQgsProcessingPdalAlgs::thinByDecimate() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:thinbydecimate" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -250,7 +250,7 @@ void TestQgsProcessingPdalAlgs::thinByRadius() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:thinbyradius" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -290,7 +290,7 @@ void TestQgsProcessingPdalAlgs::boundary() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:boundary" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -334,7 +334,7 @@ void TestQgsProcessingPdalAlgs::density() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:density" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -395,7 +395,7 @@ void TestQgsProcessingPdalAlgs::exportRasterTin() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:exportrastertin" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -456,7 +456,7 @@ void TestQgsProcessingPdalAlgs::tile() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:tile" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -504,7 +504,7 @@ void TestQgsProcessingPdalAlgs::exportRaster() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:exportraster" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -570,7 +570,7 @@ void TestQgsProcessingPdalAlgs::exportVector() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:exportvector" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -611,7 +611,7 @@ void TestQgsProcessingPdalAlgs::merge() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:merge" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -651,7 +651,7 @@ void TestQgsProcessingPdalAlgs::buildVpc() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:virtualpointcloud" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -697,7 +697,7 @@ void TestQgsProcessingPdalAlgs::clip() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:clip" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); @@ -734,7 +734,7 @@ void TestQgsProcessingPdalAlgs::filter() { QgsPdalAlgorithmBase *alg = const_cast( static_cast( QgsApplication::processingRegistry()->algorithmById( QStringLiteral( "pdal:filter" ) ) ) ); - std::unique_ptr context = std::make_unique(); + auto context = std::make_unique(); context->setProject( QgsProject::instance() ); context->setMaximumThreads( 0 ); diff --git a/tests/src/analysis/testqgsrastercalculator.cpp b/tests/src/analysis/testqgsrastercalculator.cpp index 784a6252d2f4..e6961e5f57ae 100644 --- a/tests/src/analysis/testqgsrastercalculator.cpp +++ b/tests/src/analysis/testqgsrastercalculator.cpp @@ -658,7 +658,7 @@ void TestQgsRasterCalculator::calcWithDataType() } // Load 16 bit usigned raster - std::unique_ptr demRasterLayer = std::make_unique( tempInputFilePath, QStringLiteral( "dem" ) ); + auto demRasterLayer = std::make_unique( tempInputFilePath, QStringLiteral( "dem" ) ); QgsRasterCalculatorEntry entry1; entry1.bandNumber = 1; @@ -670,7 +670,7 @@ void TestQgsRasterCalculator::calcWithDataType() QgsRasterCalculator rc( QStringLiteral( "\"dem@1\" * 2" ), tempResultFilePath, QStringLiteral( "GTiff" ), extent, crs, 2, 2, entries, QgsProject::instance()->transformContext() ); QCOMPARE( static_cast( rc.processCalculation() ), 0 ); - std::unique_ptr result = std::make_unique( tempResultFilePath, QStringLiteral( "result" ) ); + auto result = std::make_unique( tempResultFilePath, QStringLiteral( "result" ) ); QCOMPARE( result->width(), 2 ); QCOMPARE( result->height(), 2 ); std::unique_ptr block; @@ -1051,7 +1051,7 @@ void TestQgsRasterCalculator::testFunctionTypeWithLayer() QCOMPARE( static_cast( rc.processCalculation() ), 0 ); //open output file and check results - std::unique_ptr result = std::make_unique( tmpName, QStringLiteral( "result" ) ); + auto result = std::make_unique( tmpName, QStringLiteral( "result" ) ); QCOMPARE( result->width(), 2 ); QCOMPARE( result->height(), 3 ); std::unique_ptr block( result->dataProvider()->block( 1, extent, 2, 3 ) ); diff --git a/tests/src/analysis/testqgsreclassifyutils.cpp b/tests/src/analysis/testqgsreclassifyutils.cpp index 5967bc0286f2..c4d127a7627d 100644 --- a/tests/src/analysis/testqgsreclassifyutils.cpp +++ b/tests/src/analysis/testqgsreclassifyutils.cpp @@ -199,7 +199,7 @@ void TestQgsReclassifyUtils::testReclassify() // create a GeoTIFF - this will create data provider in editable mode QString filename = dirPath + QStringLiteral( "/test.tif" ); - std::unique_ptr writer = std::make_unique( filename ); + auto writer = std::make_unique( filename ); writer->setOutputProviderKey( QStringLiteral( "gdal" ) ); writer->setOutputFormat( QStringLiteral( "GTiff" ) ); std::unique_ptr dp( writer->createOneBandRaster( Qgis::DataType::Float32, nCols, nRows, extent, crs ) ); diff --git a/tests/src/analysis/testqgstriangulation.cpp b/tests/src/analysis/testqgstriangulation.cpp index 24b712f02e52..8d28a6f179c0 100644 --- a/tests/src/analysis/testqgstriangulation.cpp +++ b/tests/src/analysis/testqgstriangulation.cpp @@ -188,7 +188,7 @@ void TestQgsTriangulation::meshTriangulation() meshTri.setCrs( QgsCoordinateReferenceSystem( "EPSG:32620" ) ); - std::unique_ptr mLayerPointZ = std::make_unique( QStringLiteral( "PointZ?crs=EPSG:32620" ), QStringLiteral( "point Z" ), QStringLiteral( "memory" ) ); + auto mLayerPointZ = std::make_unique( QStringLiteral( "PointZ?crs=EPSG:32620" ), QStringLiteral( "point Z" ), QStringLiteral( "memory" ) ); const QString wkt1 = "PointZ (684486.0 1761297.0 1)"; const QString wkt2 = "PointZ (684276.0 1761309.0 2)"; @@ -228,7 +228,7 @@ void TestQgsTriangulation::meshTriangulation() const QString wkt5 = "LineStringZ (684098.0 1761401.0 3,684210.24 1761347.92 7,684343.8 1761373.4 8,684486.0 1761297.0 1)"; - std::unique_ptr mLayerBreakLine = std::make_unique( QStringLiteral( "LineStringZ?crs=EPSG:32620" ), QStringLiteral( "line" ), QStringLiteral( "memory" ) ); + auto mLayerBreakLine = std::make_unique( QStringLiteral( "LineStringZ?crs=EPSG:32620" ), QStringLiteral( "line" ), QStringLiteral( "memory" ) ); QgsFeature f5; f5.setGeometry( QgsGeometry::fromWkt( wkt5 ) ); @@ -255,7 +255,7 @@ void TestQgsTriangulation::meshTriangulationWithOnlyBreakLine() { QgsMeshTriangulation meshTri; - std::unique_ptr mLayerLineZ = std::make_unique( QStringLiteral( "LineStringZ" ), QStringLiteral( "break line Z" ), QStringLiteral( "memory" ) ); + auto mLayerLineZ = std::make_unique( QStringLiteral( "LineStringZ" ), QStringLiteral( "break line Z" ), QStringLiteral( "memory" ) ); QStringList wktLines; @@ -303,7 +303,7 @@ void TestQgsTriangulation::meshTriangulationPointAndBreakLineBreakLine() { QgsMeshTriangulation meshTri; - std::unique_ptr mLayerPointsZ = std::make_unique( QStringLiteral( "PointZ" ), QStringLiteral( "points Z" ), QStringLiteral( "memory" ) ); + auto mLayerPointsZ = std::make_unique( QStringLiteral( "PointZ" ), QStringLiteral( "points Z" ), QStringLiteral( "memory" ) ); for ( int i = 0; i < 4; ++i ) { @@ -326,7 +326,7 @@ void TestQgsTriangulation::meshTriangulationPointAndBreakLineBreakLine() QCOMPARE( mesh.vertexCount(), 40 ); QCOMPARE( mesh.faceCount(), 54 ); - std::unique_ptr mLayerLineZ = std::make_unique( QStringLiteral( "LineStringZ" ), QStringLiteral( "break line Z" ), QStringLiteral( "memory" ) ); + auto mLayerLineZ = std::make_unique( QStringLiteral( "LineStringZ" ), QStringLiteral( "break line Z" ), QStringLiteral( "memory" ) ); QgsFeature feat; diff --git a/tests/src/analysis/testqgszonalstatistics.cpp b/tests/src/analysis/testqgszonalstatistics.cpp index d372f9b47546..cbbb3da50993 100644 --- a/tests/src/analysis/testqgszonalstatistics.cpp +++ b/tests/src/analysis/testqgszonalstatistics.cpp @@ -263,8 +263,8 @@ void TestQgsZonalStatistics::testNoData() const QString myTestDataPath = myDataPath + "/zonalstatistics/"; // test that zonal stats respects no data and user set no data values - std::unique_ptr rasterLayer = std::make_unique( myTestDataPath + "raster.tif", QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); - std::unique_ptr vectorLayer = std::make_unique( mTempPath + "polys2.shp", QStringLiteral( "poly" ), QStringLiteral( "ogr" ) ); + auto rasterLayer = std::make_unique( myTestDataPath + "raster.tif", QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); + auto vectorLayer = std::make_unique( mTempPath + "polys2.shp", QStringLiteral( "poly" ), QStringLiteral( "ogr" ) ); QgsZonalStatistics zs( vectorLayer.get(), rasterLayer.get(), QStringLiteral( "n" ), 1, Qgis::ZonalStatistic::All ); zs.calculateStatistics( nullptr ); @@ -317,7 +317,7 @@ void TestQgsZonalStatistics::testSmallPolygons() // test that zonal stats works ok with polygons much smaller than pixel size const std::unique_ptr rasterLayer = std::make_unique( myTestDataPath + "raster.tif", QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); - std::unique_ptr vectorLayer = std::make_unique( mTempPath + "small_polys.shp", QStringLiteral( "poly" ), QStringLiteral( "ogr" ) ); + auto vectorLayer = std::make_unique( mTempPath + "small_polys.shp", QStringLiteral( "poly" ), QStringLiteral( "ogr" ) ); QgsZonalStatistics zs( vectorLayer.get(), rasterLayer.get(), QStringLiteral( "n" ), 1, Qgis::ZonalStatistic::All ); zs.calculateStatistics( nullptr ); diff --git a/tests/src/app/testqgisappclipboard.cpp b/tests/src/app/testqgisappclipboard.cpp index 0385e5c5f148..9f63f09d7f80 100644 --- a/tests/src/app/testqgisappclipboard.cpp +++ b/tests/src/app/testqgisappclipboard.cpp @@ -558,7 +558,7 @@ void TestQgisAppClipboard::testVectorTileLayer() ds.setParam( "type", "xyz" ); ds.setParam( "url", QString( "file://%1/{z}-{x}-{y}.pbf" ).arg( dataDir ) ); ds.setParam( "zmax", "1" ); - std::unique_ptr layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); + auto layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); QVERIFY( layer->isValid() ); QgsGeometry selectionGeometry = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((13934091.75684908032417297 -1102962.40819426625967026, 11360512.80439674854278564 -2500048.12523981928825378, 12316413.55816475301980972 -5661873.69539554417133331, 16948855.67257896065711975 -6617774.44916355609893799, 18125348.90798573195934296 -2058863.16196227818727493, 15257646.64668171107769012 -735308.27212964743375778, 13934091.75684908032417297 -1102962.40819426625967026))" ) ); diff --git a/tests/src/app/testqgsattributetable.cpp b/tests/src/app/testqgsattributetable.cpp index 236896c53d0d..b2fe48e02b96 100644 --- a/tests/src/app/testqgsattributetable.cpp +++ b/tests/src/app/testqgsattributetable.cpp @@ -492,7 +492,7 @@ void TestQgsAttributeTable::testSortNumbers() void TestQgsAttributeTable::testStartMultiEditNoChanges() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature ft1( layer->dataProvider()->fields() ); @@ -539,7 +539,7 @@ void TestQgsAttributeTable::testStartMultiEditNoChanges() void TestQgsAttributeTable::testMultiEditMakeUncommittedChanges() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature ft1( layer->dataProvider()->fields() ); @@ -849,7 +849,7 @@ void TestQgsAttributeTable::testInvalidView() void TestQgsAttributeTable::testEnsureEditSelection() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=col0:integer&field=col1:integer" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature ft1( layer->dataProvider()->fields(), 1 ); @@ -912,7 +912,7 @@ void TestQgsAttributeTable::testEnsureEditSelection() void TestQgsAttributeTable::testFetchAllAttributes() { QString pointFileName = TEST_DATA_DIR + QStringLiteral( "/points.shp" ); - std::unique_ptr layer = std::make_unique( pointFileName ); + auto layer = std::make_unique( pointFileName ); QVERIFY( layer->isValid() ); QgsAttributeTableConfig config { layer->attributeTableConfig() }; diff --git a/tests/src/app/testqgsidentify.cpp b/tests/src/app/testqgsidentify.cpp index 3133da33b080..cf7062981494 100644 --- a/tests/src/app/testqgsidentify.cpp +++ b/tests/src/app/testqgsidentify.cpp @@ -669,7 +669,7 @@ void TestQgsIdentify::identifyRasterTemporal() { //create a temporary layer const QString raster = QStringLiteral( TEST_DATA_DIR ) + "/raster/test.asc"; - std::unique_ptr tempLayer = std::make_unique( raster ); + auto tempLayer = std::make_unique( raster ); QVERIFY( tempLayer->isValid() ); // activate temporal properties @@ -1059,7 +1059,7 @@ void TestQgsIdentify::testRelations() relationManager->addRelation( relation ); } - std::unique_ptr dialog = std::make_unique( canvas ); + auto dialog = std::make_unique( canvas ); dialog->addFeature( layerA, featureA, QMap() ); QCOMPARE( dialog->lstResults->topLevelItemCount(), 1 ); @@ -1271,7 +1271,7 @@ void TestQgsIdentify::testPolygonZ() void TestQgsIdentify::identifyPointCloud() { #ifdef HAVE_EPT - std::unique_ptr pointCloud = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/point_clouds/ept/rgb16/ept.json", QStringLiteral( "pointcloud" ), QStringLiteral( "ept" ) ); + auto pointCloud = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/point_clouds/ept/rgb16/ept.json", QStringLiteral( "pointcloud" ), QStringLiteral( "ept" ) ); QVERIFY( pointCloud->isValid() ); pointCloud->setCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4979" ) ) ); QCOMPARE( pointCloud->crs3D().horizontalCrs().authid(), QStringLiteral( "EPSG:4979" ) ); @@ -1301,7 +1301,7 @@ void TestQgsIdentify::identifyPointCloud() void TestQgsIdentify::identifyVirtualPointCloud() { #ifdef HAVE_COPC - std::unique_ptr pointCloud = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/point_clouds/virtual/sunshine-coast/combined-with-overview.vpc", QStringLiteral( "pointcloud" ), QStringLiteral( "vpc" ) ); + auto pointCloud = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/point_clouds/virtual/sunshine-coast/combined-with-overview.vpc", QStringLiteral( "pointcloud" ), QStringLiteral( "vpc" ) ); QVERIFY( pointCloud->isValid() ); pointCloud->setCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:28356" ) ) ); QCOMPARE( pointCloud->crs3D().horizontalCrs().authid(), QStringLiteral( "EPSG:28356" ) ); diff --git a/tests/src/app/testqgslayerpropertiesdialogs.cpp b/tests/src/app/testqgslayerpropertiesdialogs.cpp index 37bdd60e65ab..9797b95278ff 100644 --- a/tests/src/app/testqgslayerpropertiesdialogs.cpp +++ b/tests/src/app/testqgslayerpropertiesdialogs.cpp @@ -93,7 +93,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest // valid vector layer const QString pointFileName = mTestDataDir + "points.shp"; const QFileInfo pointFileInfo( pointFileName ); - std::unique_ptr vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); QVERIFY( vl->isValid() ); QgsMapCanvas canvas; @@ -108,7 +108,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest // invalid vector layer const QString pointFileName = mTestDataDir + "xxpoints.shp"; const QFileInfo pointFileInfo( pointFileName ); - std::unique_ptr vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "xxogr" ) ); + auto vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "xxogr" ) ); QVERIFY( !vl->isValid() ); QgsMapCanvas canvas; @@ -123,7 +123,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest // start with a point layer const QString pointFileName = mTestDataDir + "points.shp"; const QFileInfo pointFileInfo( pointFileName ); - std::unique_ptr vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); QVERIFY( vl->isValid() ); vl->setSubsetString( QStringLiteral( "\"class\"='Biplane'" ) ); QCOMPARE( vl->subsetString(), QStringLiteral( "\"class\"='Biplane'" ) ); @@ -180,7 +180,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest // start with a point layer const QString pointFileName = mTestDataDir + "points.shp"; const QFileInfo pointFileInfo( pointFileName ); - std::unique_ptr vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( pointFileInfo.filePath(), pointFileInfo.completeBaseName(), QStringLiteral( "ogr" ) ); QVERIFY( vl->isValid() ); // point layer should have a marker symbol vl->setRenderer( new QgsSingleSymbolRenderer( new QgsMarkerSymbol() ) ); @@ -222,7 +222,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest QTemporaryDir tmpDir; QFile::copy( mTestDataDir + "landsat_4326.tif", tmpDir.filePath( QStringLiteral( "landsat_4326.tif" ) ) ); const QString rasterFileName = tmpDir.filePath( QStringLiteral( "landsat_4326.tif" ) ); - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); QVERIFY( rl->isValid() ); QgsMapCanvas canvas; @@ -236,7 +236,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest { // invalid raster layer const QString rasterFileName = mTestDataDir + "xxlandsat_4326.tif"; - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "test" ), QStringLiteral( "xxgdal" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "test" ), QStringLiteral( "xxgdal" ) ); QVERIFY( !rl->isValid() ); QgsMapCanvas canvas; @@ -250,7 +250,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest { // valid mesh layer QString uri( mTestDataDir + "/mesh/quad_and_triangle.2dm" ); - std::unique_ptr ml = std::make_unique( uri, QStringLiteral( "test" ), QStringLiteral( "mdal" ) ); + auto ml = std::make_unique( uri, QStringLiteral( "test" ), QStringLiteral( "mdal" ) ); QVERIFY( ml->isValid() ); QgsMapCanvas canvas; @@ -264,7 +264,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest { // invalid mesh layer QString uri( mTestDataDir + "/mesh/xxquad_and_triangle.2dm" ); - std::unique_ptr ml = std::make_unique( uri, QStringLiteral( "test" ), QStringLiteral( "xmdal" ) ); + auto ml = std::make_unique( uri, QStringLiteral( "test" ), QStringLiteral( "xmdal" ) ); QVERIFY( !ml->isValid() ); QgsMapCanvas canvas; @@ -277,7 +277,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest void testValidPointCloudProperties() { // valid point cloud layer - std::unique_ptr layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/ept/sunshine-coast/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/ept/sunshine-coast/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QgsMapCanvas canvas; @@ -290,7 +290,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest void testInvalidPointCloudProperties() { // invalid point cloud layer - std::unique_ptr layer = std::make_unique( mTestDataDir + QStringLiteral( "xxpoint_clouds/ept/sunshine-coast/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "xxept" ) ); + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "xxpoint_clouds/ept/sunshine-coast/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "xxept" ) ); QVERIFY( !layer->isValid() ); QgsMapCanvas canvas; @@ -304,7 +304,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest { // valid vector tile layer const QString srcMbtiles = QStringLiteral( "type=mbtiles&url=%1/vector_tile/mbtiles_vt.mbtiles" ).arg( TEST_DATA_DIR ); - std::unique_ptr layer = std::make_unique( srcMbtiles ); + auto layer = std::make_unique( srcMbtiles ); QVERIFY( layer->isValid() ); QgsMapCanvas canvas; @@ -318,7 +318,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest { // invalid vector tile layer const QString srcMbtiles = QStringLiteral( "type=mbtiles&url=%1/vector_tile/xxmbtiles_vt.mbtiles" ).arg( TEST_DATA_DIR ); - std::unique_ptr layer = std::make_unique( srcMbtiles ); + auto layer = std::make_unique( srcMbtiles ); QVERIFY( !layer->isValid() ); QgsMapCanvas canvas; @@ -331,7 +331,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest void testInvalidTileSceneProperties() { // invalid tiled scene layer - std::unique_ptr layer = std::make_unique( QStringLiteral( "xxx" ), QStringLiteral( "test" ), QStringLiteral( "xxx" ) ); + auto layer = std::make_unique( QStringLiteral( "xxx" ), QStringLiteral( "test" ), QStringLiteral( "xxx" ) ); QVERIFY( !layer->isValid() ); QgsMapCanvas canvas; @@ -344,7 +344,7 @@ class TestQgsLayerPropertiesDialogs : public QgsTest void testValidAnnotationLayerProperties() { // valid annotation layer - std::unique_ptr layer = std::make_unique( QStringLiteral( "xxx" ), QgsAnnotationLayer::LayerOptions( QgsCoordinateTransformContext() ) ); + auto layer = std::make_unique( QStringLiteral( "xxx" ), QgsAnnotationLayer::LayerOptions( QgsCoordinateTransformContext() ) ); QVERIFY( layer->isValid() ); QgsMapCanvas canvas; diff --git a/tests/src/app/testqgsmaptooleditmesh.cpp b/tests/src/app/testqgsmaptooleditmesh.cpp index 7f1455c774e7..0aed72d40379 100644 --- a/tests/src/app/testqgsmaptooleditmesh.cpp +++ b/tests/src/app/testqgsmaptooleditmesh.cpp @@ -409,16 +409,16 @@ void TestQgsMapToolEditMesh::testAssignVertexZValueFromTerrainOnCreation() crs3857.createFromString( "EPSG:3857" ); QString uri = QString( mDataDir + "/quad_and_triangle_with_free_vertices.2dm" ); - std::unique_ptr layer = std::make_unique( uri, "quad and triangle", "mdal" ); + auto layer = std::make_unique( uri, "quad and triangle", "mdal" ); layer->setCrs( crs3857 ); QVERIFY( layer->isValid() ); QString rasterUri = QString( mDataDir + "/terrain_under_mesh.tif" ); - std::unique_ptr terrainLayer = std::make_unique( rasterUri, "terrain", "gdal" ); + auto terrainLayer = std::make_unique( rasterUri, "terrain", "gdal" ); terrainLayer->setCrs( crs3857 ); QVERIFY( terrainLayer->isValid() ); - std::unique_ptr terrain = std::make_unique(); + auto terrain = std::make_unique(); terrain->setLayer( terrainLayer.get() ); QgsProject::instance()->elevationProperties()->setTerrainProvider( terrain.release() ); @@ -628,16 +628,16 @@ void TestQgsMapToolEditMesh::testAssignVertexZValueFromTerrainOnButtonClick() crs3857.createFromString( "EPSG:3857" ); QString uri = QString( mDataDir + "/quad_and_triangle_with_free_vertices.2dm" ); - std::unique_ptr layer = std::make_unique( uri, "quad and triangle", "mdal" ); + auto layer = std::make_unique( uri, "quad and triangle", "mdal" ); layer->setCrs( crs3857 ); QVERIFY( layer->isValid() ); QString rasterUri = QString( mDataDir + "/terrain_under_mesh.tif" ); - std::unique_ptr terrainLayer = std::make_unique( rasterUri, "terrain", "gdal" ); + auto terrainLayer = std::make_unique( rasterUri, "terrain", "gdal" ); terrainLayer->setCrs( crs3857 ); QVERIFY( terrainLayer->isValid() ); - std::unique_ptr terrain = std::make_unique(); + auto terrain = std::make_unique(); terrain->setLayer( terrainLayer.get() ); QgsProject::instance()->elevationProperties()->setTerrainProvider( terrain.release() ); @@ -692,7 +692,7 @@ void TestQgsMapToolEditMesh::testAssignVertexZValueFromTerrainOnButtonClick() void TestQgsMapToolEditMesh::selectElements() { QString uri = QString( mDataDir + "/quad_and_triangle_with_free_vertices.2dm" ); - std::unique_ptr layer = std::make_unique( uri, "quad and triangle", "mdal" ); + auto layer = std::make_unique( uri, "quad and triangle", "mdal" ); QVERIFY( layer->isValid() ); const QgsCoordinateTransform transform; @@ -753,7 +753,7 @@ void TestQgsMapToolEditMesh::testDelaunayRefinement() const QString copyDataPath1 = copyTestData( originalDataPath ); // copy of data to be edited - std::unique_ptr layer = std::make_unique( copyDataPath1, "not delaunay", "mdal" ); + auto layer = std::make_unique( copyDataPath1, "not delaunay", "mdal" ); layer->setCrs( crs3857 ); QVERIFY( layer->isValid() ); diff --git a/tests/src/app/testqgsmaptoollabel.cpp b/tests/src/app/testqgsmaptoollabel.cpp index 676a1e9a0594..a9dc51780b41 100644 --- a/tests/src/app/testqgsmaptoollabel.cpp +++ b/tests/src/app/testqgsmaptoollabel.cpp @@ -53,7 +53,7 @@ class TestQgsMapToolLabel : public QObject void testSelectLabel() { - std::unique_ptr vl1 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=text:string" ), QStringLiteral( "vl1" ), QStringLiteral( "memory" ) ); + auto vl1 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=text:string" ), QStringLiteral( "vl1" ), QStringLiteral( "memory" ) ); QVERIFY( vl1->isValid() ); QgsFeature f1; f1.setAttributes( QgsAttributes() << QStringLiteral( "label" ) ); @@ -63,7 +63,7 @@ class TestQgsMapToolLabel : public QObject f1.setAttributes( QgsAttributes() << QStringLiteral( "l" ) ); QVERIFY( vl1->dataProvider()->addFeature( f1 ) ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=text:string" ), QStringLiteral( "vl1" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=text:string" ), QStringLiteral( "vl1" ), QStringLiteral( "memory" ) ); QVERIFY( vl2->isValid() ); f1.setGeometry( QgsGeometry::fromPointXY( QgsPointXY( 1, 1 ) ) ); f1.setAttributes( QgsAttributes() << QStringLiteral( "label" ) ); @@ -75,7 +75,7 @@ class TestQgsMapToolLabel : public QObject f1.setAttributes( QgsAttributes() << QStringLiteral( "label3" ) ); QVERIFY( vl2->dataProvider()->addFeature( f1 ) ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3946" ) ) ); canvas->setLayers( QList() << vl1.get() << vl2.get() ); const std::unique_ptr advancedDigitizingDockWidget = std::make_unique( canvas.get() ); @@ -241,7 +241,7 @@ class TestQgsMapToolLabel : public QObject f1.setAttributes( QgsAttributes() << QStringLiteral( "center" ) << QStringLiteral( "base" ) ); QVERIFY( vl1->dataProvider()->addFeature( f1 ) ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3946" ) ) ); canvas->setLayers( QList() << vl1 ); const std::unique_ptr advancedDigitizingDockWidget = std::make_unique( canvas.get() ); @@ -385,7 +385,7 @@ class TestQgsMapToolLabel : public QObject f1.setAttributes( QgsAttributes() << QStringLiteral( "center" ) << QStringLiteral( "base" ) ); QVERIFY( vl1->dataProvider()->addFeature( f1 ) ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3946" ) ) ); canvas->setLayers( QList() << vl1 ); const std::unique_ptr advancedDigitizingDockWidget = std::make_unique( canvas.get() ); @@ -480,7 +480,7 @@ class TestQgsMapToolLabel : public QObject QVERIFY( vl1->isValid() ); QgsProject::instance()->addMapLayer( vl1 ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3946" ) ) ); canvas->setLayers( QList() << vl1 ); const std::unique_ptr advancedDigitizingDockWidget = std::make_unique( canvas.get() ); diff --git a/tests/src/app/testqgsprojectproperties.cpp b/tests/src/app/testqgsprojectproperties.cpp index 1ffefe0ae99a..530276b4c44f 100644 --- a/tests/src/app/testqgsprojectproperties.cpp +++ b/tests/src/app/testqgsprojectproperties.cpp @@ -100,7 +100,7 @@ void TestQgsProjectProperties::testEllipsoidChange() QgsProject::instance()->setCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) ) ); QCOMPARE( QgsProject::instance()->ellipsoid(), QStringLiteral( "NONE" ) ); - std::unique_ptr pp = std::make_unique( mQgisApp->mapCanvas() ); + auto pp = std::make_unique( mQgisApp->mapCanvas() ); pp->apply(); pp.reset(); QCOMPARE( QgsProject::instance()->ellipsoid(), QStringLiteral( "NONE" ) ); @@ -146,7 +146,7 @@ void TestQgsProjectProperties::testEllipsoidCrsSync() QgsProject::instance()->setCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) ) ); QCOMPARE( QgsProject::instance()->ellipsoid(), QStringLiteral( "NONE" ) ); - std::unique_ptr pp = std::make_unique( mQgisApp->mapCanvas() ); + auto pp = std::make_unique( mQgisApp->mapCanvas() ); pp->setSelectedCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3111" ) ) ); pp->apply(); pp.reset(); @@ -203,11 +203,11 @@ void TestQgsProjectProperties::testEllipsoidCrsSync() void TestQgsProjectProperties::testBearingFormat() { QgsProject::instance()->clear(); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 9 ); QgsProject::instance()->displaySettings()->setBearingFormat( format.release() ); - std::unique_ptr pp = std::make_unique( mQgisApp->mapCanvas() ); + auto pp = std::make_unique( mQgisApp->mapCanvas() ); pp->apply(); QCOMPARE( QgsProject::instance()->displaySettings()->bearingFormat()->numberDecimalPlaces(), 9 ); } @@ -220,7 +220,7 @@ void TestQgsProjectProperties::testTimeSettings() QgsProject::instance()->timeSettings()->setTemporalRange( range ); const QgsDateTimeRange projectRange = QgsProject::instance()->timeSettings()->temporalRange(); - std::unique_ptr projectProperties = std::make_unique( mQgisApp->mapCanvas() ); + auto projectProperties = std::make_unique( mQgisApp->mapCanvas() ); QCOMPARE( projectRange, range ); @@ -258,7 +258,7 @@ void TestQgsProjectProperties::testColorSettings() QCOMPARE( QgsProject::instance()->styleSettings()->colorModel(), Qgis::ColorModel::Rgb ); QVERIFY( !QgsProject::instance()->styleSettings()->colorSpace().isValid() ); - std::unique_ptr pp = std::make_unique( mQgisApp->mapCanvas() ); + auto pp = std::make_unique( mQgisApp->mapCanvas() ); QCOMPARE( static_cast( pp->mColorModel->currentData().toInt() ), Qgis::ColorModel::Rgb ); QVERIFY( !pp->mColorSpace.isValid() ); #if QT_VERSION >= QT_VERSION_CHECK( 6, 8, 0 ) diff --git a/tests/src/core/geometry/testqgspolyhedralsurface.cpp b/tests/src/core/geometry/testqgspolyhedralsurface.cpp index 6a1e96c7bc2d..401cdf8ec6fe 100644 --- a/tests/src/core/geometry/testqgspolyhedralsurface.cpp +++ b/tests/src/core/geometry/testqgspolyhedralsurface.cpp @@ -85,7 +85,7 @@ void TestQgsPolyhedralSurface::testConstructor() QVERIFY( !polySurfaceEmpty.patchN( 0 ) ); - std::unique_ptr multiPolygon = std::make_unique(); + auto multiPolygon = std::make_unique(); QgsPolygon part; QgsLineString ring; ring.setPoints( QgsPointSequence() << QgsPoint( Qgis::WkbType::PointZM, 5, 50, 1, 4 ) << QgsPoint( Qgis::WkbType::PointZM, 6, 61, 3, 5 ) << QgsPoint( Qgis::WkbType::PointZM, 9, 71, 4, 15 ) << QgsPoint( Qgis::WkbType::PointZM, 5, 71, 4, 6 ) ); diff --git a/tests/src/core/testqgscallout.cpp b/tests/src/core/testqgscallout.cpp index fe0fcafdbd5f..ebef784b96cf 100644 --- a/tests/src/core/testqgscallout.cpp +++ b/tests/src/core/testqgscallout.cpp @@ -441,7 +441,7 @@ void TestQgsCallout::calloutsInLayout() { //test rendering callouts inside a layout (tests DPI scaling of callouts) QgsLayout l( QgsProject::instance() ); - std::unique_ptr page = std::make_unique( &l ); + auto page = std::make_unique( &l ); page->setPageSize( QgsLayoutSize( 50, 50 ) ); l.pageCollection()->addPage( page.release() ); @@ -4200,7 +4200,7 @@ void TestQgsCallout::balloonCalloutMarkerSymbol() void TestQgsCallout::blendMode() { - std::unique_ptr callout = std::make_unique(); + auto callout = std::make_unique(); QCOMPARE( callout->containsAdvancedEffects(), false ); callout->setBlendMode( QPainter::CompositionMode_Multiply ); diff --git a/tests/src/core/testqgsclipper.cpp b/tests/src/core/testqgsclipper.cpp index d09931bc92d3..48eaf9769fee 100644 --- a/tests/src/core/testqgsclipper.cpp +++ b/tests/src/core/testqgsclipper.cpp @@ -191,7 +191,7 @@ bool TestQgsClipper::checkBoundingBox( const QPolygonF &polygon, const QgsRectan void TestQgsClipper::epsg4978LineRendering() { - std::unique_ptr layerLines = std::make_unique( QString( TEST_DATA_DIR ) + "/3d/earth_size_sphere_4978.gpkg", "lines", "ogr" ); + auto layerLines = std::make_unique( QString( TEST_DATA_DIR ) + "/3d/earth_size_sphere_4978.gpkg", "lines", "ogr" ); QgsLineSymbol *fillSymbol = new QgsLineSymbol(); fillSymbol->setWidth( 0.5 ); diff --git a/tests/src/core/testqgscolorschemeregistry.cpp b/tests/src/core/testqgscolorschemeregistry.cpp index cb254599f172..90b3631c15c4 100644 --- a/tests/src/core/testqgscolorschemeregistry.cpp +++ b/tests/src/core/testqgscolorschemeregistry.cpp @@ -204,7 +204,7 @@ void TestQgsColorSchemeRegistry::matchingSchemes() void TestQgsColorSchemeRegistry::fetchRandomStyleColor() { - std::unique_ptr registry = std::make_unique(); + auto registry = std::make_unique(); // no randomStyleColorScheme set - test lots of colors to make sure their valid for ( int i = 0; i < 10000; ++i ) diff --git a/tests/src/core/testqgscompositionconverter.cpp b/tests/src/core/testqgscompositionconverter.cpp index 056b0f5e3255..4eb4d5c9521f 100644 --- a/tests/src/core/testqgscompositionconverter.cpp +++ b/tests/src/core/testqgscompositionconverter.cpp @@ -584,7 +584,7 @@ void TestQgsCompositionConverter::convertCompositionTemplate() //qDebug() << layoutDoc; QCOMPARE( layoutDoc.elementsByTagName( QStringLiteral( "Layout" ) ).count(), 1 ); - std::unique_ptr layout = std::make_unique( &project ); + auto layout = std::make_unique( &project ); QgsReadWriteContext context; context.setPathResolver( project.pathResolver() ); layout->readXml( layoutDoc.elementsByTagName( QStringLiteral( "Layout" ) ).at( 0 ).toElement(), layoutDoc, context ); diff --git a/tests/src/core/testqgsdataitem.cpp b/tests/src/core/testqgsdataitem.cpp index 696b6090e077..9baede4c7b79 100644 --- a/tests/src/core/testqgsdataitem.cpp +++ b/tests/src/core/testqgsdataitem.cpp @@ -119,7 +119,7 @@ void TestQgsDataItem::testValid() void TestQgsDataItem::testDirItem() { - std::unique_ptr dirItem = std::make_unique( nullptr, QStringLiteral( "Test" ), TEST_DATA_DIR ); + auto dirItem = std::make_unique( nullptr, QStringLiteral( "Test" ), TEST_DATA_DIR ); QCOMPARE( dirItem->dirPath(), QStringLiteral( TEST_DATA_DIR ) ); QCOMPARE( dirItem->name(), QStringLiteral( "Test" ) ); @@ -215,7 +215,7 @@ void TestQgsDataItem::testDirItemMonitoring() QVERIFY( QDir().mkpath( child1 ) ); QVERIFY( QDir().mkpath( child2 ) ); - std::unique_ptr dirItem = std::make_unique( nullptr, QStringLiteral( "parent name" ), parentDir, parentDir + '/' ); + auto dirItem = std::make_unique( nullptr, QStringLiteral( "parent name" ), parentDir, parentDir + '/' ); QCOMPARE( dirItem->path(), parentDir + '/' ); QCOMPARE( dirItem->dirPath(), parentDir ); @@ -383,7 +383,7 @@ void TestQgsDataItem::testDirItemMonitoringSlowDrive() QVERIFY( !QgsDirectoryItem::pathShouldByMonitoredByDefault( child2 ) ); QVERIFY( !QgsDirectoryItem::pathShouldByMonitoredByDefault( child2child ) ); - std::unique_ptr dirItem = std::make_unique( nullptr, QStringLiteral( "parent name" ), parentDir, QStringLiteral( "/" ) + parentDir ); + auto dirItem = std::make_unique( nullptr, QStringLiteral( "parent name" ), parentDir, QStringLiteral( "/" ) + parentDir ); // user has not explicitly set the path to be monitored or not, so Default should be returned here: QCOMPARE( dirItem->monitoring(), Qgis::BrowserDirectoryMonitoring::Default ); // but directory should NOT be monitored diff --git a/tests/src/core/testqgsdxfexport.cpp b/tests/src/core/testqgsdxfexport.cpp index eab2d4bf8819..fe8e80c1a5e7 100644 --- a/tests/src/core/testqgsdxfexport.cpp +++ b/tests/src/core/testqgsdxfexport.cpp @@ -224,7 +224,7 @@ void TestQgsDxfExport::testPoints() QVERIFY( !fileContainsText( file, QStringLiteral( "nan.0" ) ) ); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mPointLayer->featureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::Point ); @@ -311,7 +311,7 @@ void TestQgsDxfExport::testPointsOverriddenName() QVERIFY( !fileContainsText( file, mPointLayer->name() ) ); // "points" // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mPointLayer->featureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::Point ); @@ -342,7 +342,7 @@ void TestQgsDxfExport::testLines() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mLineLayer->featureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -370,7 +370,7 @@ void TestQgsDxfExport::testPolygons() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 12L ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -379,7 +379,7 @@ void TestQgsDxfExport::testPolygons() void TestQgsDxfExport::testMultiSurface() { QgsDxfExport d; - std::unique_ptr vl = std::make_unique( QStringLiteral( "MultiSurface" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "MultiSurface" ), QString(), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "MultiSurface (Polygon ((0 0, 0 1, 1 1, 0 0)))" ); QgsFeature f; f.setGeometry( g ); @@ -403,7 +403,7 @@ void TestQgsDxfExport::testMultiSurface() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 1L ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -414,13 +414,13 @@ void TestQgsDxfExport::testMultiSurface() void TestQgsDxfExport::testMapTheme() { - std::unique_ptr vl = std::make_unique( QStringLiteral( "LineString?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "LineString?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "LineString(2600000 1280000, 2680000 1280000, 2680000 1285000, 2600000 1285000, 2600000 1280000)" ); QgsFeature f; f.setGeometry( g ); vl->dataProvider()->addFeatures( QgsFeatureList() << f ); - std::unique_ptr symbolLayer = std::make_unique( QColor( 0, 255, 0 ) ); + auto symbolLayer = std::make_unique( QColor( 0, 255, 0 ) ); symbolLayer->setWidth( 0.11 ); QgsLineSymbol *symbol = new QgsLineSymbol(); symbol->changeSymbolLayer( 0, symbolLayer.release() ); @@ -709,7 +709,7 @@ void TestQgsDxfExport::testText() void TestQgsDxfExport::testTextAngle() { - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=ori:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=ori:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "Point(2684679.392 1292182.527)" ); const QgsGeometry g2 = QgsGeometry::fromWkt( "Point(2684692.322 1292192.534)" ); QgsFeature f( vl->fields() ); @@ -820,7 +820,7 @@ void TestQgsDxfExport::testTextAlign() format.setColor( QColor( 200, 0, 200 ) ); settings.setFormat( format ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=text:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=text:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "Point(2684679.392 1292182.527)" ); QgsFeature f( vl->fields() ); f.setGeometry( g ); @@ -964,7 +964,7 @@ void TestQgsDxfExport::testTextQuadrant() format.setColor( QColor( 200, 0, 200 ) ); settings.setFormat( format ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=text:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056&field=text:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "Point(2685025.687 1292145.297)" ); QgsFeature f( vl->fields() ); f.setGeometry( g ); @@ -1134,7 +1134,7 @@ void TestQgsDxfExport::testCurveExport() QFETCH( QString, dxfText ); QgsDxfExport d; - std::unique_ptr vl = std::make_unique( wktType, QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( wktType, QString(), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( wkt ); QgsFeature f; f.setGeometry( g ); @@ -1262,7 +1262,7 @@ void TestQgsDxfExport::testCurveExport_data() void TestQgsDxfExport::testDashedLine() { - std::unique_ptr symbolLayer = std::make_unique( QColor( 0, 0, 0 ) ); + auto symbolLayer = std::make_unique( QColor( 0, 0, 0 ) ); symbolLayer->setWidth( 0.11 ); symbolLayer->setCustomDashVector( { 0.5, 0.35 } ); symbolLayer->setCustomDashPatternUnit( Qgis::RenderUnit::MapUnits ); @@ -1271,7 +1271,7 @@ void TestQgsDxfExport::testDashedLine() QgsLineSymbol *symbol = new QgsLineSymbol(); symbol->changeSymbolLayer( 0, symbolLayer.release() ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "CompoundCurve?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "CompoundCurve?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); const QgsGeometry g = QgsGeometry::fromWkt( "CompoundCurve ((2689563.84200000017881393 1283531.23699999996460974, 2689563.42499999981373549 1283537.55499999993480742, 2689563.19900000002235174 1283540.52399999997578561, 2689562.99800000013783574 1283543.42999999993480742, 2689562.66900000022724271 1283548.56000000005587935, 2689562.43399999989196658 1283555.287999999942258))" ); QgsFeature f; f.setGeometry( g ); @@ -1384,7 +1384,7 @@ void TestQgsDxfExport::testDashedLine() void TestQgsDxfExport::testTransform() { - std::unique_ptr symbolLayer = std::make_unique( QColor( 0, 0, 0 ) ); + auto symbolLayer = std::make_unique( QColor( 0, 0, 0 ) ); symbolLayer->setWidth( 0.11 ); symbolLayer->setCustomDashVector( { 0.5, 0.35 } ); symbolLayer->setCustomDashPatternUnit( Qgis::RenderUnit::MapUnits ); @@ -1393,7 +1393,7 @@ void TestQgsDxfExport::testTransform() QgsLineSymbol *symbol = new QgsLineSymbol(); symbol->changeSymbolLayer( 0, symbolLayer.release() ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Linestring?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Linestring?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); QgsGeometry g = QgsGeometry::fromWkt( QStringLiteral( "LineString (2689564.82757076947018504 1283554.68540272791869938, 2689565.52996697928756475 1283531.49185784510336816)" ) ); QgsFeature f; f.setGeometry( g ); @@ -1424,7 +1424,7 @@ void TestQgsDxfExport::testTransform() QCOMPARE( d.writeToFile( &dxfFile, QStringLiteral( "CP1252" ) ), QgsDxfExport::ExportResult::Success ); dxfFile.close(); - std::unique_ptr result = std::make_unique( file, QStringLiteral( "res" ) ); + auto result = std::make_unique( file, QStringLiteral( "res" ) ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 2L ); QgsFeature f2; @@ -1451,7 +1451,7 @@ void TestQgsDxfExport::testTransform() void TestQgsDxfExport::testDataDefinedPoints() { - std::unique_ptr symbolLayer = std::make_unique( Qgis::MarkerShape::Circle, 2.0 ); + auto symbolLayer = std::make_unique( Qgis::MarkerShape::Circle, 2.0 ); QgsPropertyCollection properties; properties.setProperty( QgsSymbolLayer::Property::Size, QgsProperty::fromExpression( "200" ) ); symbolLayer->setDataDefinedProperties( properties ); @@ -1459,7 +1459,7 @@ void TestQgsDxfExport::testDataDefinedPoints() QgsMarkerSymbol *symbol = new QgsMarkerSymbol(); symbol->changeSymbolLayer( 0, symbolLayer.release() ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?crs=epsg:2056" ), QString(), QStringLiteral( "memory" ) ); const QgsGeometry g1 = QgsGeometry::fromWkt( "POINT (2000000 1000000)" ); QgsFeature f1; f1.setGeometry( g1 ); @@ -1543,7 +1543,7 @@ void TestQgsDxfExport::testExtent() dxfFile1.close(); // reload and compare - std::unique_ptr result = std::make_unique( file1, "dxf" ); + auto result = std::make_unique( file1, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 1L ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -1586,7 +1586,7 @@ void TestQgsDxfExport::testSelectedPoints() QVERIFY( !fileContainsText( file, QStringLiteral( "nan.0" ) ) ); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mPointLayer->selectedFeatureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::Point ); @@ -1637,7 +1637,7 @@ void TestQgsDxfExport::testSelectedLines() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mLineLayer->selectedFeatureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -1686,7 +1686,7 @@ void TestQgsDxfExport::testSelectedPolygons() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 8L ); QCOMPARE( result->wkbType(), Qgis::WkbType::LineString ); @@ -1743,7 +1743,7 @@ void TestQgsDxfExport::testMultipleLayersWithSelection() QVERIFY( !fileContainsText( file, QStringLiteral( "nan.0" ) ) ); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QStringList subLayers = result->dataProvider()->subLayers(); QCOMPARE( subLayers.count(), 2 ); @@ -1803,7 +1803,7 @@ void TestQgsDxfExport::testExtentWithSelection() dxfFile.close(); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), 3L ); // 4 in extent, 8 selected, 17 in total QCOMPARE( result->wkbType(), Qgis::WkbType::Point ); @@ -1851,7 +1851,7 @@ void TestQgsDxfExport::testOutputLayerNamePrecedence() QVERIFY( !fileContainsText( file, mPointLayer->name() ) ); // reload and compare - std::unique_ptr result = std::make_unique( file, "dxf" ); + auto result = std::make_unique( file, "dxf" ); QVERIFY( result->isValid() ); QCOMPARE( result->featureCount(), mPointLayer->featureCount() ); QCOMPARE( result->wkbType(), Qgis::WkbType::Point ); diff --git a/tests/src/core/testqgsexpression.cpp b/tests/src/core/testqgsexpression.cpp index 4b912f9e2747..5e54ee90ec10 100644 --- a/tests/src/core/testqgsexpression.cpp +++ b/tests/src/core/testqgsexpression.cpp @@ -5634,7 +5634,7 @@ class TestQgsExpression : public QObject // prepare the expression using static variables QgsExpressionContext context; - std::unique_ptr scope = std::make_unique(); + auto scope = std::make_unique(); scope->setVariable( QStringLiteral( "field_name_part_var" ), QStringLiteral( "field" ), true ); // this feature gets added as a static variable, to emulate eg the @atlas_feature variable diff --git a/tests/src/core/testqgsexpressioncontext.cpp b/tests/src/core/testqgsexpressioncontext.cpp index 6709fa22db3b..5837c5796c4e 100644 --- a/tests/src/core/testqgsexpressioncontext.cpp +++ b/tests/src/core/testqgsexpressioncontext.cpp @@ -1010,7 +1010,7 @@ void TestQgsExpressionContext::layerStores() QVERIFY( scope1->layerStores().isEmpty() ); QgsMapLayerStore store1; - std::unique_ptr store2 = std::make_unique(); + auto store2 = std::make_unique(); scope1->addLayerStore( &store1 ); scope1->addLayerStore( store2.get() ); QCOMPARE( scope1->layerStores(), QList( { &store1, store2.get() } ) ); diff --git a/tests/src/core/testqgsgdalprovider.cpp b/tests/src/core/testqgsgdalprovider.cpp index 140246e6645d..8c6321a0a764 100644 --- a/tests/src/core/testqgsgdalprovider.cpp +++ b/tests/src/core/testqgsgdalprovider.cpp @@ -962,7 +962,7 @@ void TestQgsGdalProvider::testVsiCredentialOptions() // if actual aws dataset proves flaky, use this instead: // std::unique_ptr< QgsRasterLayer > rl = std::make_unique< QgsRasterLayer >( QStringLiteral( "/vsis3/testbucket/test|credential:AWS_NO_SIGN_REQUEST=YES|credential:AWS_REGION=eu-central-1|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); - std::unique_ptr rl = std::make_unique( QStringLiteral( "/vsis3/cdn.proj.org/us_nga_egm96_15.tif|credential:AWS_NO_SIGN_REQUEST=YES" ), QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); + auto rl = std::make_unique( QStringLiteral( "/vsis3/cdn.proj.org/us_nga_egm96_15.tif|credential:AWS_NO_SIGN_REQUEST=YES" ), QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); // confirm that GDAL VSI configuration options are set QString noSign( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_NO_SIGN_REQUEST", nullptr ) ); @@ -979,7 +979,7 @@ void TestQgsGdalProvider::testVsiCredentialOptions() QCOMPARE( region, QString() ); // credentials should be bucket specific - std::unique_ptr rl2 = std::make_unique( QStringLiteral( "/vsis3/another/subfolder/subfolder2/test|credential:AWS_NO_SIGN_REQUEST=NO|credential:AWS_REGION=eu-central-2|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); + auto rl2 = std::make_unique( QStringLiteral( "/vsis3/another/subfolder/subfolder2/test|credential:AWS_NO_SIGN_REQUEST=NO|credential:AWS_REGION=eu-central-2|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "gdal" ) ); noSign = QString( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_NO_SIGN_REQUEST", nullptr ) ); QCOMPARE( noSign, QStringLiteral( "YES" ) ); region = QString( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_REGION", nullptr ) ); diff --git a/tests/src/core/testqgsgeopdfexport.cpp b/tests/src/core/testqgsgeopdfexport.cpp index e81dc03b9f3b..0b3be6bda25b 100644 --- a/tests/src/core/testqgsgeopdfexport.cpp +++ b/tests/src/core/testqgsgeopdfexport.cpp @@ -114,7 +114,7 @@ void TestQgsGeospatialPdfExport::testCollectingFeatures() QCOMPARE( component.mapLayerId, QStringLiteral( "layer1" ) ); QCOMPARE( component.name, QStringLiteral( "name layer1" ) ); // check that temporary layers were correctly written - std::unique_ptr layer = std::make_unique( QStringLiteral( "%1|layerName=%2" ).arg( component.sourceVectorPath, component.sourceVectorLayer ), QStringLiteral( "layer" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( QStringLiteral( "%1|layerName=%2" ).arg( component.sourceVectorPath, component.sourceVectorLayer ), QStringLiteral( "layer" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QCOMPARE( layer->featureCount(), 2L ); QCOMPARE( layer->wkbType(), Qgis::WkbType::Polygon ); diff --git a/tests/src/core/testqgsinvertedpolygonrenderer.cpp b/tests/src/core/testqgsinvertedpolygonrenderer.cpp index f20bb5aaa25b..9e7d3dafba34 100644 --- a/tests/src/core/testqgsinvertedpolygonrenderer.cpp +++ b/tests/src/core/testqgsinvertedpolygonrenderer.cpp @@ -141,7 +141,7 @@ void TestQgsInvertedPolygon::projectionTest() void TestQgsInvertedPolygon::projectionWithSimplificationTest() { - std::unique_ptr polyLayer = std::make_unique( testDataPath( "polys.shp" ), QStringLiteral( "polys" ) ); + auto polyLayer = std::make_unique( testDataPath( "polys.shp" ), QStringLiteral( "polys" ) ); QVERIFY( polyLayer->isValid() ); QgsMapSettings mapSettings; mapSettings.setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) ) ); diff --git a/tests/src/core/testqgslabelingengine.cpp b/tests/src/core/testqgslabelingengine.cpp index 5c629a987ca4..6f7b2134e4eb 100644 --- a/tests/src/core/testqgslabelingengine.cpp +++ b/tests/src/core/testqgslabelingengine.cpp @@ -6746,7 +6746,7 @@ void TestQgsLabelingEngine::testShowAllLabelsWhenALabelHasNoCandidates() void TestQgsLabelingEngine::testSymbologyScalingFactor() { // test rendering labels with a layer with a reference scale set (with callout) - std::unique_ptr vl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/points.shp", QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/points.shp", QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( vl->isValid() ); QgsMarkerSymbol *marker = static_cast( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ) ); marker->setColor( QColor( 255, 0, 0 ) ); @@ -6809,7 +6809,7 @@ void TestQgsLabelingEngine::testSymbologyScalingFactor() void TestQgsLabelingEngine::testSymbologyScalingFactor2() { // test rendering labels with a layer with a reference scale set (with label background) - std::unique_ptr vl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/points.shp", QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/points.shp", QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( vl->isValid() ); QgsMarkerSymbol *marker = static_cast( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ) ); marker->setColor( QColor( 255, 0, 0 ) ); diff --git a/tests/src/core/testqgslayertree.cpp b/tests/src/core/testqgslayertree.cpp index 48c4591f2389..a06606824232 100644 --- a/tests/src/core/testqgslayertree.cpp +++ b/tests/src/core/testqgslayertree.cpp @@ -963,7 +963,7 @@ void TestQgsLayerTree::testRasterSymbolNode() QgsLayerTreeNode *secondGroup = mRoot->children()[1]; QCOMPARE( secondGroup->depth(), 1 ); - std::unique_ptr rl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/tenbytenraster.asc", QStringLiteral( "rl" ), QStringLiteral( "gdal" ) ); + auto rl = std::make_unique( QStringLiteral( TEST_DATA_DIR ) + "/tenbytenraster.asc", QStringLiteral( "rl" ), QStringLiteral( "gdal" ) ); QVERIFY( rl->isValid() ); const std::unique_ptr n = std::make_unique( rl.get() ); diff --git a/tests/src/core/testqgslayoutgeopdfexport.cpp b/tests/src/core/testqgslayoutgeopdfexport.cpp index 92fdbdc695fe..4403ed1d5ec8 100644 --- a/tests/src/core/testqgslayoutgeopdfexport.cpp +++ b/tests/src/core/testqgslayoutgeopdfexport.cpp @@ -211,7 +211,7 @@ void TestQgsLayoutGeospatialPdfExport::testCollectingFeatures() } // read in as vector - std::unique_ptr layer1 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto layer1 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( layer1->isValid() ); QCOMPARE( layer1->featureCount(), 6L ); for ( const auto &it : geospatialPdfExporter.mVectorComponents ) @@ -219,7 +219,7 @@ void TestQgsLayoutGeospatialPdfExport::testCollectingFeatures() if ( it.mapLayerId == pointsLayer->id() ) vectorDetail = it; } - std::unique_ptr layer2 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto layer2 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( layer2->isValid() ); QCOMPARE( layer2->featureCount(), 32L ); for ( const auto &it : geospatialPdfExporter.mVectorComponents ) @@ -227,7 +227,7 @@ void TestQgsLayoutGeospatialPdfExport::testCollectingFeatures() if ( it.mapLayerId == polygonLayer->id() ) vectorDetail = it; } - std::unique_ptr layer3 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto layer3 = std::make_unique( QStringLiteral( "%1|layername=%2" ).arg( vectorDetail.sourceVectorPath, vectorDetail.sourceVectorLayer ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( layer3->isValid() ); QCOMPARE( layer3->featureCount(), 10L ); diff --git a/tests/src/core/testqgslayoutitem.cpp b/tests/src/core/testqgslayoutitem.cpp index 44f9961d52ca..0878c5108f67 100644 --- a/tests/src/core/testqgslayoutitem.cpp +++ b/tests/src/core/testqgslayoutitem.cpp @@ -1395,8 +1395,8 @@ void TestQgsLayoutItem::itemVariablesFunction() r = e4.evaluate( &c ); QCOMPARE( r.toString(), QString( "degrees" ) ); - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "A" ), QStringLiteral( "memory" ) ); - std::unique_ptr layer2 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "B" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "A" ), QStringLiteral( "memory" ) ); + auto layer2 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "B" ), QStringLiteral( "memory" ) ); map->setLayers( QList() << layer.get() << layer2.get() ); QgsExpression e5( QStringLiteral( "map_get( item_variables( 'Map_id' ), 'map_layer_ids' )" ) ); r = e5.evaluate( &c ); @@ -1410,7 +1410,7 @@ void TestQgsLayoutItem::variables() { QgsLayout l( QgsProject::instance() ); - std::unique_ptr map = std::make_unique( &l ); + auto map = std::make_unique( &l ); std::unique_ptr scope( QgsExpressionContextUtils::layoutItemScope( map.get() ) ); const int before = scope->variableCount(); @@ -1459,14 +1459,14 @@ void TestQgsLayoutItem::mapCreditsFunction() QCOMPARE( r.toString(), QString() ); // with layers - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "A" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "A" ), QStringLiteral( "memory" ) ); QgsLayerMetadata metadata; metadata.setRights( QStringList() << QStringLiteral( "CC BY SA" ) ); layer->setMetadata( metadata ); - std::unique_ptr layer2 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "B" ), QStringLiteral( "memory" ) ); + auto layer2 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "B" ), QStringLiteral( "memory" ) ); metadata.setRights( QStringList() << QStringLiteral( "CC NC" ) ); layer2->setMetadata( metadata ); - std::unique_ptr layer3 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "C" ), QStringLiteral( "memory" ) ); + auto layer3 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "C" ), QStringLiteral( "memory" ) ); metadata.setRights( QStringList() << QStringLiteral( "CC BY SA" ) ); layer3->setMetadata( metadata ); const std::unique_ptr layer4 = std::make_unique( QStringLiteral( "Point?field=id_a:integer" ), QStringLiteral( "C" ), QStringLiteral( "memory" ) ); @@ -2106,7 +2106,7 @@ std::unique_ptr TestQgsLayoutItem::createCopyViaXml( QgsLayout *l original->writeXml( rootNode, doc, QgsReadWriteContext() ); //create new item and restore settings from xml - std::unique_ptr copy = std::make_unique( layout ); + auto copy = std::make_unique( layout ); copy->readXml( rootNode.firstChildElement(), doc, QgsReadWriteContext() ); return std::move( copy ); diff --git a/tests/src/core/testqgslayoutmanualtable.cpp b/tests/src/core/testqgslayoutmanualtable.cpp index 221286603342..2fd25720b97f 100644 --- a/tests/src/core/testqgslayoutmanualtable.cpp +++ b/tests/src/core/testqgslayoutmanualtable.cpp @@ -355,7 +355,7 @@ void TestQgsLayoutManualTable::cellFormat() QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); diff --git a/tests/src/core/testqgslayoutmap.cpp b/tests/src/core/testqgslayoutmap.cpp index 6f9f3414a258..9314b4145327 100644 --- a/tests/src/core/testqgslayoutmap.cpp +++ b/tests/src/core/testqgslayoutmap.cpp @@ -1927,7 +1927,7 @@ void TestQgsLayoutMap::testLayeredExportLabelsByLayer() void TestQgsLayoutMap::testTemporal() { QgsLayout l( QgsProject::instance() ); - std::unique_ptr map = std::make_unique( &l ); + auto map = std::make_unique( &l ); const QDateTime begin( QDate( 2020, 01, 01 ), QTime( 10, 0, 0 ), Qt::UTC ); const QDateTime end = begin.addSecs( 3600 ); @@ -2049,7 +2049,7 @@ void TestQgsLayoutMap::testLabelResults() void TestQgsLayoutMap::testZRange() { QgsLayout l( QgsProject::instance() ); - std::unique_ptr map = std::make_unique( &l ); + auto map = std::make_unique( &l ); QgsMapSettings settings = map->mapSettings( map->extent(), QSize( 512, 512 ), 72, false ); QVERIFY( settings.zRange().isInfinite() ); diff --git a/tests/src/core/testqgslayoutpage.cpp b/tests/src/core/testqgslayoutpage.cpp index 2dcc19489be1..5b17ee306990 100644 --- a/tests/src/core/testqgslayoutpage.cpp +++ b/tests/src/core/testqgslayoutpage.cpp @@ -185,7 +185,7 @@ void TestQgsLayoutPage::borderedPaper() l.pageCollection()->addPage( page.release() ); QgsSimpleFillSymbolLayer *simpleFill = new QgsSimpleFillSymbolLayer(); - std::unique_ptr fillSymbol = std::make_unique(); + auto fillSymbol = std::make_unique(); fillSymbol->changeSymbolLayer( 0, simpleFill ); simpleFill->setColor( Qt::white ); simpleFill->setStrokeColor( Qt::black ); @@ -205,7 +205,7 @@ void TestQgsLayoutPage::markerLinePaper() QgsMarkerLineSymbolLayer *markerLine = new QgsMarkerLineSymbolLayer(); static_cast( markerLine->subSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black ); - std::unique_ptr markerLineSymbol = std::make_unique(); + auto markerLineSymbol = std::make_unique(); markerLineSymbol->changeSymbolLayer( 0, markerLine ); l.pageCollection()->setPageStyleSymbol( markerLineSymbol.get() ); @@ -221,7 +221,7 @@ void TestQgsLayoutPage::hiddenPages() l.pageCollection()->addPage( page.release() ); QgsSimpleFillSymbolLayer *simpleFill = new QgsSimpleFillSymbolLayer(); - std::unique_ptr fillSymbol = std::make_unique(); + auto fillSymbol = std::make_unique(); fillSymbol->changeSymbolLayer( 0, simpleFill ); simpleFill->setColor( Qt::blue ); simpleFill->setStrokeColor( Qt::transparent ); diff --git a/tests/src/core/testqgslayoutscalebar.cpp b/tests/src/core/testqgslayoutscalebar.cpp index 6f4a8b440f6a..25d619707a06 100644 --- a/tests/src/core/testqgslayoutscalebar.cpp +++ b/tests/src/core/testqgslayoutscalebar.cpp @@ -142,8 +142,8 @@ void TestQgsLayoutScaleBar::singleBoxLineSymbol() scalebar->setNumberOfSegments( 2 ); scalebar->setHeight( 20 ); - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -184,15 +184,15 @@ void TestQgsLayoutScaleBar::singleBoxFillSymbol() scalebar->setNumberOfSegments( 2 ); scalebar->setHeight( 20 ); - std::unique_ptr fillSymbol = std::make_unique(); - std::unique_ptr fillSymbolLayer = std::make_unique(); + auto fillSymbol = std::make_unique(); + auto fillSymbolLayer = std::make_unique(); fillSymbolLayer->setColor( QColor( 255, 0, 0 ) ); fillSymbolLayer->setColor2( QColor( 255, 255, 0 ) ); fillSymbol->changeSymbolLayer( 0, fillSymbolLayer.release() ); scalebar->setFillSymbol( fillSymbol.release() ); - std::unique_ptr fillSymbol2 = std::make_unique(); - std::unique_ptr fillSymbolLayer2 = std::make_unique(); + auto fillSymbol2 = std::make_unique(); + auto fillSymbolLayer2 = std::make_unique(); fillSymbolLayer2->setColor( QColor( 0, 255, 0 ) ); fillSymbolLayer2->setColor2( QColor( 255, 255, 255 ) ); fillSymbol2->changeSymbolLayer( 0, fillSymbolLayer2.release() ); @@ -330,8 +330,8 @@ void TestQgsLayoutScaleBar::doubleBoxLineSymbol() scalebar->setNumberOfSegments( 2 ); scalebar->setHeight( 20 ); - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -372,15 +372,15 @@ void TestQgsLayoutScaleBar::doubleBoxFillSymbol() scalebar->setNumberOfSegments( 2 ); scalebar->setHeight( 20 ); - std::unique_ptr fillSymbol = std::make_unique(); - std::unique_ptr fillSymbolLayer = std::make_unique(); + auto fillSymbol = std::make_unique(); + auto fillSymbolLayer = std::make_unique(); fillSymbolLayer->setColor( QColor( 255, 0, 0 ) ); fillSymbolLayer->setColor2( QColor( 255, 255, 0 ) ); fillSymbol->changeSymbolLayer( 0, fillSymbolLayer.release() ); scalebar->setFillSymbol( fillSymbol.release() ); - std::unique_ptr fillSymbol2 = std::make_unique(); - std::unique_ptr fillSymbolLayer2 = std::make_unique(); + auto fillSymbol2 = std::make_unique(); + auto fillSymbolLayer2 = std::make_unique(); fillSymbolLayer2->setColor( QColor( 0, 255, 0 ) ); fillSymbolLayer2->setColor2( QColor( 255, 255, 255 ) ); fillSymbol2->changeSymbolLayer( 0, fillSymbolLayer2.release() ); @@ -520,8 +520,8 @@ void TestQgsLayoutScaleBar::tickLineSymbol() scalebar->setNumberOfSegments( 2 ); scalebar->setHeight( 20 ); - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -569,8 +569,8 @@ void TestQgsLayoutScaleBar::dataDefined() scalebar->setMinimumBarWidth( 11 ); scalebar->setMaximumBarWidth( 13 ); - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 1 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 0, 0, 0 ) ); @@ -730,8 +730,8 @@ void TestQgsLayoutScaleBar::steppedLine() scalebar->setHeight( 20 ); scalebar->setSubdivisionsHeight( 25 ); //ensure subdivisionsHeight is non used in non tick-style scalebars - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -773,8 +773,8 @@ void TestQgsLayoutScaleBar::hollow() scalebar->setHeight( 20 ); scalebar->setSubdivisionsHeight( 25 ); //ensure subdivisionsHeight is non used in non tick-style scalebars - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -788,15 +788,15 @@ void TestQgsLayoutScaleBar::hollow() scalebar->setLineSymbol( lineSymbol.release() ); - std::unique_ptr fillSymbol = std::make_unique(); - std::unique_ptr fillSymbolLayer = std::make_unique(); + auto fillSymbol = std::make_unique(); + auto fillSymbolLayer = std::make_unique(); fillSymbolLayer->setColor( QColor( 255, 0, 0 ) ); fillSymbolLayer->setColor2( QColor( 255, 255, 0 ) ); fillSymbol->changeSymbolLayer( 0, fillSymbolLayer.release() ); scalebar->setFillSymbol( fillSymbol.release() ); - std::unique_ptr fillSymbol2 = std::make_unique(); - std::unique_ptr fillSymbolLayer2 = std::make_unique(); + auto fillSymbol2 = std::make_unique(); + auto fillSymbolLayer2 = std::make_unique(); fillSymbolLayer2->setColor( QColor( 0, 255, 0 ) ); fillSymbolLayer2->setColor2( QColor( 255, 255, 255 ) ); fillSymbol2->changeSymbolLayer( 0, fillSymbolLayer2.release() ); @@ -812,11 +812,11 @@ void TestQgsLayoutScaleBar::hollowDefaults() { QgsLayout l( QgsProject::instance() ); - std::unique_ptr scalebar = std::make_unique( &l ); + auto scalebar = std::make_unique( &l ); // apply random symbols - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); @@ -830,15 +830,15 @@ void TestQgsLayoutScaleBar::hollowDefaults() scalebar->setLineSymbol( lineSymbol.release() ); - std::unique_ptr fillSymbol = std::make_unique(); - std::unique_ptr fillSymbolLayer = std::make_unique(); + auto fillSymbol = std::make_unique(); + auto fillSymbolLayer = std::make_unique(); fillSymbolLayer->setColor( QColor( 255, 0, 0 ) ); fillSymbolLayer->setColor2( QColor( 255, 255, 0 ) ); fillSymbol->changeSymbolLayer( 0, fillSymbolLayer.release() ); scalebar->setFillSymbol( fillSymbol.release() ); - std::unique_ptr fillSymbol2 = std::make_unique(); - std::unique_ptr fillSymbolLayer2 = std::make_unique(); + auto fillSymbol2 = std::make_unique(); + auto fillSymbolLayer2 = std::make_unique(); fillSymbolLayer2->setColor( QColor( 0, 255, 0 ) ); fillSymbolLayer2->setColor2( QColor( 255, 255, 255 ) ); fillSymbol2->changeSymbolLayer( 0, fillSymbolLayer2.release() ); @@ -878,8 +878,8 @@ void TestQgsLayoutScaleBar::tickSubdivisions() scalebar->setSubdivisionsHeight( 3 ); - std::unique_ptr lineSymbol = std::make_unique(); - std::unique_ptr lineSymbolLayer = std::make_unique(); + auto lineSymbol = std::make_unique(); + auto lineSymbolLayer = std::make_unique(); lineSymbolLayer->setWidth( 4 ); lineSymbolLayer->setWidthUnit( Qgis::RenderUnit::Millimeters ); lineSymbolLayer->setColor( QColor( 255, 0, 0 ) ); diff --git a/tests/src/core/testqgslayoutshapes.cpp b/tests/src/core/testqgslayoutshapes.cpp index 32ef916cc12a..35ec1e6e004e 100644 --- a/tests/src/core/testqgslayoutshapes.cpp +++ b/tests/src/core/testqgslayoutshapes.cpp @@ -189,7 +189,7 @@ void TestQgsLayoutShapes::readWriteXml() { QgsProject p; QgsLayout l( &p ); - std::unique_ptr shape = std::make_unique( &l ); + auto shape = std::make_unique( &l ); shape->setShapeType( QgsLayoutItemShape::Triangle ); QgsSimpleFillSymbolLayer *simpleFill = new QgsSimpleFillSymbolLayer(); QgsFillSymbol *fillSymbol = new QgsFillSymbol(); @@ -211,7 +211,7 @@ void TestQgsLayoutShapes::readWriteXml() shape->writeXml( rootNode, doc, QgsReadWriteContext() ); //create new item and restore settings from xml - std::unique_ptr copy = std::make_unique( &l ); + auto copy = std::make_unique( &l ); QVERIFY( copy->readXml( rootNode.firstChildElement(), doc, QgsReadWriteContext() ) ); QCOMPARE( copy->shapeType(), QgsLayoutItemShape::Triangle ); QCOMPARE( copy->symbol()->symbolLayer( 0 )->color().name(), QStringLiteral( "#00ff00" ) ); @@ -222,7 +222,7 @@ void TestQgsLayoutShapes::bounds() { QgsProject p; QgsLayout l( &p ); - std::unique_ptr shape = std::make_unique( &l ); + auto shape = std::make_unique( &l ); shape->attemptMove( QgsLayoutPoint( 20, 20 ) ); shape->attemptResize( QgsLayoutSize( 150, 100 ) ); diff --git a/tests/src/core/testqgslayouttable.cpp b/tests/src/core/testqgslayouttable.cpp index 446c12acb228..055a6cc19d1d 100644 --- a/tests/src/core/testqgslayouttable.cpp +++ b/tests/src/core/testqgslayouttable.cpp @@ -448,7 +448,7 @@ void TestQgsLayoutTable::attributeTableInsideAtlasOnly() compareTable( table, expectedRows, false ); //setup atlas - std::unique_ptr atlasLayer = std::make_unique( QStringLiteral( "Polygon?crs=EPSG:3857" ), QStringLiteral( "atlas" ), QStringLiteral( "memory" ) ); + auto atlasLayer = std::make_unique( QStringLiteral( "Polygon?crs=EPSG:3857" ), QStringLiteral( "atlas" ), QStringLiteral( "memory" ) ); QVERIFY( atlasLayer->isValid() ); const QgsGeometry atlasGeom( QgsGeometry::fromWkt( QStringLiteral( "Polygon ((-8863916.31126776337623596 4621257.48816855065524578, -9664269.45078738406300545 5097056.938785120844841, -10049249.44194872118532658 3765399.75924854446202517, -8985488.94005555473268032 3458599.17133777122944593, -8863916.31126776337623596 4621257.48816855065524578))" ) ) ); QgsFeature f; @@ -1122,7 +1122,7 @@ void TestQgsLayoutTable::testIntegerNullCell() l.addLayoutItem( frame ); table->addFrame( frame ); - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?field=intf:integer" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?field=intf:integer" ), QStringLiteral( "point" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature f1( layer->dataProvider()->fields(), 1 ); f1.setAttribute( QStringLiteral( "intf" ), 1 ); @@ -1207,7 +1207,7 @@ void TestQgsLayoutTable::wrapChar() table->setHeaderTextFormat( QgsTextFormat::fromQFont( QgsFontUtils::getStandardTestFont( QStringLiteral( "Bold" ) ) ) ); table->setBackgroundColor( Qt::yellow ); - std::unique_ptr multiLineLayer = std::make_unique( QStringLiteral( "Point?field=col1:string&field=col2:string&field=col3:string" ), QStringLiteral( "multiline" ), QStringLiteral( "memory" ) ); + auto multiLineLayer = std::make_unique( QStringLiteral( "Point?field=col1:string&field=col2:string&field=col3:string" ), QStringLiteral( "multiline" ), QStringLiteral( "memory" ) ); QVERIFY( multiLineLayer->isValid() ); QgsFeature f1( multiLineLayer->dataProvider()->fields(), 1 ); f1.setAttribute( QStringLiteral( "col1" ), "multiline\nstring" ); @@ -1248,7 +1248,7 @@ void TestQgsLayoutTable::autoWrap() table->setHeaderTextFormat( QgsTextFormat::fromQFont( QgsFontUtils::getStandardTestFont( QStringLiteral( "Bold" ) ) ) ); table->setBackgroundColor( Qt::yellow ); - std::unique_ptr multiLineLayer = std::make_unique( QStringLiteral( "Point?field=col1:string&field=col2:string&field=col3:string" ), QStringLiteral( "multiline" ), QStringLiteral( "memory" ) ); + auto multiLineLayer = std::make_unique( QStringLiteral( "Point?field=col1:string&field=col2:string&field=col3:string" ), QStringLiteral( "multiline" ), QStringLiteral( "memory" ) ); QVERIFY( multiLineLayer->isValid() ); QgsFeature f1( multiLineLayer->dataProvider()->fields(), 1 ); f1.setAttribute( QStringLiteral( "col1" ), "long multiline\nstring" ); diff --git a/tests/src/core/testqgslegendrenderer.cpp b/tests/src/core/testqgslegendrenderer.cpp index 7be0df036bb3..7521af294883 100644 --- a/tests/src/core/testqgslegendrenderer.cpp +++ b/tests/src/core/testqgslegendrenderer.cpp @@ -615,13 +615,13 @@ void TestQgsLegendRenderer::testOverrideSymbol() QgsLayerTreeLayer *layer = legendModel.rootGroup()->findLayer( mVL2 ); - std::unique_ptr sym2 = std::make_unique(); + auto sym2 = std::make_unique(); sym2->setColor( Qt::red ); QgsLayerTreeModelLegendNode *embeddedNode = legendModel.legendNodeEmbeddedInParent( layer ); qgis::down_cast( embeddedNode )->setCustomSymbol( sym2.release() ); - std::unique_ptr sym3 = std::make_unique(); + auto sym3 = std::make_unique(); sym3->setColor( QColor( 0, 150, 0 ) ); sym3->setSize( 6 ); @@ -1392,7 +1392,7 @@ void TestQgsLegendRenderer::testFilterByExpressionWithContext() { const QString testName = QStringLiteral( "legend_filter_by_expression_context" ); - std::unique_ptr root = std::make_unique(); + auto root = std::make_unique(); root->addLayer( mVL3 ); QgsLayerTreeModel legendModel( root.get() ); @@ -1405,7 +1405,7 @@ void TestQgsLegendRenderer::testFilterByExpressionWithContext() QgsExpressionContext context; - std::unique_ptr scope = std::make_unique( QStringLiteral( "test_scope" ) ); + auto scope = std::make_unique( QStringLiteral( "test_scope" ) ); scope->setVariable( QStringLiteral( "test_var" ), QStringLiteral( "test_value" ) ); context.appendScope( scope.release() ); diff --git a/tests/src/core/testqgslinefillsymbol.cpp b/tests/src/core/testqgslinefillsymbol.cpp index 5330f54c81f2..5204ec891342 100644 --- a/tests/src/core/testqgslinefillsymbol.cpp +++ b/tests/src/core/testqgslinefillsymbol.cpp @@ -144,7 +144,7 @@ void TestQgsLineFillSymbol::lineFillSymbol() void TestQgsLineFillSymbol::lineFillSymbolVector() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -165,7 +165,7 @@ void TestQgsLineFillSymbol::lineFillSymbolVector() void TestQgsLineFillSymbol::viewportLineFillSymbol() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsVectorSimplifyMethod simplifyMethod; @@ -191,7 +191,7 @@ void TestQgsLineFillSymbol::viewportLineFillSymbol() void TestQgsLineFillSymbol::viewportLineFillSymbolVector() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -222,7 +222,7 @@ void TestQgsLineFillSymbol::lineFillSymbolOffset() void TestQgsLineFillSymbol::lineFillSymbolOffsetVector() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -258,7 +258,7 @@ void TestQgsLineFillSymbol::lineFillLargeOffset() void TestQgsLineFillSymbol::lineFillLargeOffsetVector() { // test line fill with large offset compared to line distance - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -293,7 +293,7 @@ void TestQgsLineFillSymbol::lineFillNegativeAngle() void TestQgsLineFillSymbol::lineFillNegativeAngleVector() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -317,7 +317,7 @@ void TestQgsLineFillSymbol::lineFillNegativeAngleVector() void TestQgsLineFillSymbol::lineFillClipPainter() { // test clipping using painter path - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -356,7 +356,7 @@ void TestQgsLineFillSymbol::lineFillClipPainter() void TestQgsLineFillSymbol::lineFillClipIntersection() { // test clipping using intersections - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -395,7 +395,7 @@ void TestQgsLineFillSymbol::lineFillClipIntersection() void TestQgsLineFillSymbol::lineFillNoClip() { // test no clipping - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); @@ -434,7 +434,7 @@ void TestQgsLineFillSymbol::lineFillNoClip() void TestQgsLineFillSymbol::lineFillDataDefinedClip() { // test data defined clipping - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsLinePatternFillSymbolLayer *lineFill = new QgsLinePatternFillSymbolLayer(); diff --git a/tests/src/core/testqgsmaplayer.cpp b/tests/src/core/testqgsmaplayer.cpp index cad52331d752..b4a99607aa00 100644 --- a/tests/src/core/testqgsmaplayer.cpp +++ b/tests/src/core/testqgsmaplayer.cpp @@ -119,7 +119,7 @@ void TestQgsMapLayer::isValid() void TestQgsMapLayer::testId() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "a" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "a" ), QStringLiteral( "memory" ) ); QSignalSpy spy( layer.get(), &QgsMapLayer::idChanged ); QVERIFY( layer->setId( QStringLiteral( "my forced id" ) ) ); QCOMPARE( layer->id(), QStringLiteral( "my forced id" ) ); @@ -430,7 +430,7 @@ void TestQgsMapLayer::notify() void TestQgsMapLayer::customEnumFlagProperties() { - std::unique_ptr ml = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "name" ), QStringLiteral( "memory" ) ); + auto ml = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "name" ), QStringLiteral( "memory" ) ); // assign to inexisting property ml->setCustomProperty( QStringLiteral( "my_property_for_units" ), -1 ); @@ -482,7 +482,7 @@ void TestQgsMapLayer::customEnumFlagProperties() void TestQgsMapLayer::readCustomProperties() { - std::unique_ptr ml = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "name" ), QStringLiteral( "memory" ) ); + auto ml = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "name" ), QStringLiteral( "memory" ) ); // assign to inexisting property ml->setCustomProperty( QStringLiteral( "my_property_one" ), 42 ); diff --git a/tests/src/core/testqgsmaplayerstylemanager.cpp b/tests/src/core/testqgsmaplayerstylemanager.cpp index 03584f2fb04d..718f564b7bce 100644 --- a/tests/src/core/testqgsmaplayerstylemanager.cpp +++ b/tests/src/core/testqgsmaplayerstylemanager.cpp @@ -203,8 +203,8 @@ void TestQgsMapLayerStyleManager::testSwitchingStyles() void TestQgsMapLayerStyleManager::testCopyStyles() { - std::unique_ptr lines = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "Line Layer" ), QStringLiteral( "memory" ) ); - std::unique_ptr lines2 = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "Line Layer" ), QStringLiteral( "memory" ) ); + auto lines = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "Line Layer" ), QStringLiteral( "memory" ) ); + auto lines2 = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "Line Layer" ), QStringLiteral( "memory" ) ); QgsMapLayerStyleManager *sm = lines->styleManager(); diff --git a/tests/src/core/testqgsmaprendererjob.cpp b/tests/src/core/testqgsmaprendererjob.cpp index 3fe73d0db7b4..7bc0bcd48fa6 100644 --- a/tests/src/core/testqgsmaprendererjob.cpp +++ b/tests/src/core/testqgsmaprendererjob.cpp @@ -356,11 +356,11 @@ class TestHandler : public QgsRenderedFeatureHandlerInterface void TestQgsMapRendererJob::testRenderedFeatureHandlers() { - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); - std::unique_ptr linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( linesLayer->isValid() ); - std::unique_ptr polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); + auto polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); QVERIFY( polygonsLayer->isValid() ); QgsMapSettings mapSettings; @@ -466,13 +466,13 @@ void TestQgsMapRendererJob::stagedRenderer() { // test the staged map renderer job subclass - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); - std::unique_ptr linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( linesLayer->isValid() ); - std::unique_ptr polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); + auto polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); QVERIFY( polygonsLayer->isValid() ); - std::unique_ptr rasterLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/raster_layer.tiff" ), QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); + auto rasterLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/raster_layer.tiff" ), QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); QVERIFY( rasterLayer->isValid() ); QgsMapSettings mapSettings; @@ -482,7 +482,7 @@ void TestQgsMapRendererJob::stagedRenderer() mapSettings.setFlag( Qgis::MapSettingsFlag::DrawLabeling, false ); mapSettings.setOutputDpi( 96 ); - std::unique_ptr job = std::make_unique( mapSettings ); + auto job = std::make_unique( mapSettings ); job->start(); // nothing to render QVERIFY( job->isFinished() ); @@ -641,11 +641,11 @@ void TestQgsMapRendererJob::stagedRendererWithStagedLabeling() { // test the staged map renderer job subclass, when using staged labeling - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); - std::unique_ptr linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); + auto linesLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/lines.shp" ), QStringLiteral( "lines" ), QStringLiteral( "ogr" ) ); QVERIFY( linesLayer->isValid() ); - std::unique_ptr polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); + auto polygonsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/polys.shp" ), QStringLiteral( "polys" ), QStringLiteral( "ogr" ) ); QVERIFY( polygonsLayer->isValid() ); QgsMapSettings mapSettings; @@ -655,7 +655,7 @@ void TestQgsMapRendererJob::stagedRendererWithStagedLabeling() mapSettings.setFlag( Qgis::MapSettingsFlag::DrawLabeling, false ); mapSettings.setOutputDpi( 96 ); - std::unique_ptr job = std::make_unique( mapSettings, QgsMapRendererStagedRenderJob::RenderLabelsByMapLayer ); + auto job = std::make_unique( mapSettings, QgsMapRendererStagedRenderJob::RenderLabelsByMapLayer ); job->start(); // nothing to render QVERIFY( job->isFinished() ); @@ -829,13 +829,13 @@ void TestQgsMapRendererJob::stagedRendererWithStagedLabeling() void TestQgsMapRendererJob::vectorLayerBoundsWithReprojection() { - std::unique_ptr gridLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/grid_4326.geojson" ), QStringLiteral( "grid" ), QStringLiteral( "ogr" ) ); + auto gridLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/grid_4326.geojson" ), QStringLiteral( "grid" ), QStringLiteral( "ogr" ) ); QVERIFY( gridLayer->isValid() ); - std::unique_ptr symbol = std::make_unique(); + auto symbol = std::make_unique(); symbol->setColor( QColor( 255, 0, 255 ) ); symbol->setWidth( 2 ); - std::unique_ptr renderer = std::make_unique( symbol.release() ); + auto renderer = std::make_unique( symbol.release() ); gridLayer->setRenderer( renderer.release() ); QgsMapSettings mapSettings; @@ -856,7 +856,7 @@ void TestQgsMapRendererJob::vectorLayerBoundsWithReprojection() void TestQgsMapRendererJob::temporalRender() { - std::unique_ptr rasterLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/raster_layer.tiff" ), QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); + auto rasterLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/raster_layer.tiff" ), QStringLiteral( "raster" ), QStringLiteral( "gdal" ) ); QVERIFY( rasterLayer->isValid() ); QgsMapSettings mapSettings; @@ -925,7 +925,7 @@ class TestLabelSink : public QgsLabelSink void TestQgsMapRendererJob::labelSink() { - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); QgsPalLayerSettings settings; @@ -952,7 +952,7 @@ void TestQgsMapRendererJob::labelSink() QgsMapRendererSequentialJob renderJob( mapSettings ); - std::unique_ptr labelSink = std::make_unique(); + auto labelSink = std::make_unique(); renderJob.setLabelSink( labelSink.get() ); renderJob.start(); renderJob.waitForFinished(); @@ -963,7 +963,7 @@ void TestQgsMapRendererJob::labelSink() void TestQgsMapRendererJob::skipSymbolRendering() { - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); QgsPalLayerSettings settings; @@ -997,7 +997,7 @@ void TestQgsMapRendererJob::skipSymbolRendering() void TestQgsMapRendererJob::customNullPainterJob() { - std::unique_ptr pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); + auto pointsLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/points.shp" ), QStringLiteral( "points" ), QStringLiteral( "ogr" ) ); QVERIFY( pointsLayer->isValid() ); QgsPalLayerSettings settings; @@ -1021,14 +1021,14 @@ void TestQgsMapRendererJob::customNullPainterJob() mapSettings.setOutputDpi( 96 ); mapSettings.setLayers( QList() << pointsLayer.get() ); - std::unique_ptr nullPaintDevice = std::make_unique(); + auto nullPaintDevice = std::make_unique(); nullPaintDevice->setOutputSize( QSize( 512, 512 ) ); nullPaintDevice->setOutputDpi( 96 ); - std::unique_ptr painter = std::make_unique( nullPaintDevice.get() ); + auto painter = std::make_unique( nullPaintDevice.get() ); QgsMapRendererCustomPainterJob renderJob( mapSettings, painter.get() ); - std::unique_ptr labelSink = std::make_unique(); + auto labelSink = std::make_unique(); renderJob.setLabelSink( labelSink.get() ); renderJob.start(); @@ -1039,7 +1039,7 @@ void TestQgsMapRendererJob::customNullPainterJob() void TestQgsMapRendererJob::testMapShading() { - std::unique_ptr pointCloudLayer = std::make_unique( + auto pointCloudLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/point_clouds/ept/lone-star-laszip/ept.json" ), QStringLiteral( "point-cloud" ), QStringLiteral( "ept" ) @@ -1050,7 +1050,7 @@ void TestQgsMapRendererJob::testMapShading() pointCloudRenderer->setDrawOrder2d( Qgis::PointCloudDrawOrder::BottomToTop ); pointCloudLayer->setRenderer( pointCloudRenderer.release() ); - std::unique_ptr rasterLayer = std::make_unique( + auto rasterLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/raster/raster_shading.tif" ), QStringLiteral( "raster" ), QStringLiteral( "gdal" ) @@ -1060,14 +1060,14 @@ void TestQgsMapRendererJob::testMapShading() rasterLayer->dataProvider()->enableProviderResampling( true ); rasterLayer->dataProvider()->setZoomedOutResamplingMethod( Qgis::RasterResamplingMethod::Cubic ); - std::unique_ptr meshLayer = std::make_unique( + auto meshLayer = std::make_unique( TEST_DATA_DIR + QStringLiteral( "/mesh/mesh_shading.nc" ), QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); QVERIFY( meshLayer->isValid() ); - std::unique_ptr vectorLayer = std::make_unique( + auto vectorLayer = std::make_unique( QStringLiteral( "Polygon?crs=%1&field=id:integer&field=name:string(20)&index=no" ) .arg( pointCloudLayer->crs().toWkt( Qgis::CrsWktVariant::Preferred ) ), QStringLiteral( "vector-layer" ), diff --git a/tests/src/core/testqgsmapsettings.cpp b/tests/src/core/testqgsmapsettings.cpp index 7ab81eae21c2..a0fada15c23d 100644 --- a/tests/src/core/testqgsmapsettings.cpp +++ b/tests/src/core/testqgsmapsettings.cpp @@ -632,7 +632,7 @@ void TestQgsMapSettings::testRenderedFeatureHandlers() const std::unique_ptr testHandler = std::make_unique(); const std::unique_ptr testHandler2 = std::make_unique(); - std::unique_ptr mapSettings = std::make_unique(); + auto mapSettings = std::make_unique(); QVERIFY( mapSettings->renderedFeatureHandlers().isEmpty() ); mapSettings->addRenderedFeatureHandler( testHandler.get() ); mapSettings->addRenderedFeatureHandler( testHandler2.get() ); @@ -726,9 +726,9 @@ void TestQgsMapSettings::testLayersWithGroupLayers() // test retrieving layers from map settings when a QgsGroupLayer is present QgsMapSettings settings; - std::unique_ptr vlA = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "a" ), QStringLiteral( "memory" ) ); - std::unique_ptr vlB = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "b" ), QStringLiteral( "memory" ) ); - std::unique_ptr vlC = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "c" ), QStringLiteral( "memory" ) ); + auto vlA = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "a" ), QStringLiteral( "memory" ) ); + auto vlB = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "b" ), QStringLiteral( "memory" ) ); + auto vlC = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "c" ), QStringLiteral( "memory" ) ); QgsGroupLayer::LayerOptions options( ( QgsCoordinateTransformContext() ) ); QgsGroupLayer groupLayer( QStringLiteral( "group" ), options ); diff --git a/tests/src/core/testqgsmesheditor.cpp b/tests/src/core/testqgsmesheditor.cpp index 04159a48ba62..089c25a2097b 100644 --- a/tests/src/core/testqgsmesheditor.cpp +++ b/tests/src/core/testqgsmesheditor.cpp @@ -192,7 +192,7 @@ void TestQgsMeshEditor::startEditingWithErrors() const QgsCoordinateTransform transform; QString uri( mDataDir + QStringLiteral( "/with_flat_face.2dm" ) ); - std::unique_ptr mesh = std::make_unique( uri, QStringLiteral( "With flat face" ), QStringLiteral( "mdal" ) ); + auto mesh = std::make_unique( uri, QStringLiteral( "With flat face" ), QStringLiteral( "mdal" ) ); QVERIFY( mesh->isValid() ); QCOMPARE( mesh->meshFaceCount(), 3 ); QCOMPARE( mesh->meshVertexCount(), 5 ); @@ -2142,7 +2142,7 @@ void TestQgsMeshEditor::refineMesh() void TestQgsMeshEditor::transformByExpression() { - std::unique_ptr layer = std::make_unique( mDataDir + "/quad_flower_to_edit.2dm", "mesh", "mdal" ); + auto layer = std::make_unique( mDataDir + "/quad_flower_to_edit.2dm", "mesh", "mdal" ); const QgsCoordinateTransform transform; QgsMeshEditingError error; @@ -2290,7 +2290,7 @@ void TestQgsMeshEditor::transformByExpression() void TestQgsMeshEditor::forceByLine() { QString uri( mDataDir + "/refined_quad_flower.2dm" ); - std::unique_ptr meshLayer = std::make_unique( uri, "mesh layer", "mdal" ); + auto meshLayer = std::make_unique( uri, "mesh layer", "mdal" ); QgsMeshEditingError error; QVERIFY( meshLayer->isValid() ); @@ -2455,7 +2455,7 @@ void TestQgsMeshEditor::forceByLine() QgsMeshEditForceByPolylines forceByPolyline1; forceByPolyline1.setTolerance( 5 ); - std::unique_ptr lineString = std::make_unique(); + auto lineString = std::make_unique(); lineString->addVertex( { 1250, 2250, 5 } ); lineString->addVertex( { 1850, 2850, 20 } ); lineString->addVertex( { 1850, 0, 150 } ); diff --git a/tests/src/core/testqgsmeshlayer.cpp b/tests/src/core/testqgsmeshlayer.cpp index 2ec1da0b630f..65afef7e4d1d 100644 --- a/tests/src/core/testqgsmeshlayer.cpp +++ b/tests/src/core/testqgsmeshlayer.cpp @@ -990,7 +990,7 @@ void TestQgsMeshLayer::test_path() datasetFile.copy( dir1.filePath( QStringLiteral( "dataseGroup.dat" ) ) ); QString meshLayerUri = QStringLiteral( "2DM:\"" ) + dir1.filePath( QStringLiteral( "quad_and_triangle.2dm" ) ) + QStringLiteral( "\"" ); - std::unique_ptr meshLayer = std::make_unique( + auto meshLayer = std::make_unique( meshLayerUri, QStringLiteral( "mesh layer" ), QStringLiteral( "mdal" ) @@ -1640,7 +1640,7 @@ void TestQgsMeshLayer::test_memory_dataset_group_1d() void TestQgsMeshLayer::test_memoryproviderdataset_invalid_values() { - std::unique_ptr memoryLayer = std::make_unique( readFile( "/quad_and_triangle.txt" ), "Triangle and Quad Memory", "mesh_memory" ); + auto memoryLayer = std::make_unique( readFile( "/quad_and_triangle.txt" ), "Triangle and Quad Memory", "mesh_memory" ); memoryLayer->addDatasets( readFile( "/quad_and_triangle_face_scalar_invalid_values.txt" ) ); memoryLayer->addDatasets( readFile( "/quad_and_triangle_face_vector_invalid_values.txt" ) ); @@ -1965,7 +1965,7 @@ void TestQgsMeshLayer::testSetDataSourceRetainStyle() const QString uri( mDataDir + "/quad_and_triangle.2dm" ); // start with a layer with valid path - std::unique_ptr layer = std::make_unique( uri, "Triangle and Quad MDAL", "mdal" ); + auto layer = std::make_unique( uri, "Triangle and Quad MDAL", "mdal" ); QVERIFY( layer->isValid() ); // ensure a default renderer is set automatically @@ -2022,7 +2022,7 @@ void TestQgsMeshLayer::keepDatasetIndexConsistency() QFile::copy( uri_1, uri ); // start with a layer with valid path - std::unique_ptr layer = std::make_unique( uri, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); + auto layer = std::make_unique( uri, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); QVERIFY( layer->isValid() ); QCOMPARE( layer->datasetGroupCount(), 4 ); @@ -2113,8 +2113,8 @@ void TestQgsMeshLayer::symbologyConsistencyWithName() const QString uri_1( mDataDir + QStringLiteral( "/mesh_z_ws_d_vel.nc" ) ); //mesh with dataset group "Bed Elevation", "Water level", "Depth" and "Velocity" const QString uri_2( mDataDir + QStringLiteral( "/mesh_z_ws_d.nc" ) ); //exactly the same mesh except without "Velocity" - std::unique_ptr layer_1 = std::make_unique( uri_1, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); - std::unique_ptr layer_2 = std::make_unique( uri_2, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); + auto layer_1 = std::make_unique( uri_1, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); + auto layer_2 = std::make_unique( uri_2, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); QMap nameToindex_1; QList indexes = layer_1->datasetGroupsIndexes(); @@ -2288,7 +2288,7 @@ void TestQgsMeshLayer::updateTimePropertiesWhenReloading() QFile::copy( uri_1, uri ); // start with a layer with valid path - std::unique_ptr layer = std::make_unique( uri, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); + auto layer = std::make_unique( uri, QStringLiteral( "mesh" ), QStringLiteral( "mdal" ) ); QVERIFY( layer->isValid() ); QgsMeshLayerTemporalProperties *temporalProperties = static_cast( layer->temporalProperties() ); diff --git a/tests/src/core/testqgsmeshlayerinterpolator.cpp b/tests/src/core/testqgsmeshlayerinterpolator.cpp index 9475459fc5ae..1898282a0751 100644 --- a/tests/src/core/testqgsmeshlayerinterpolator.cpp +++ b/tests/src/core/testqgsmeshlayerinterpolator.cpp @@ -90,7 +90,7 @@ void TestQgsMeshLayerInterpolator::testExportRasterBand() QCOMPARE( block->value( 5, 5 ), 35.0 ); QVERIFY( block->isNoData( 10, 10 ) ); - std::unique_ptr virtualGroup = std::make_unique( QStringLiteral( "on face" ), QgsMeshDatasetGroupMetadata::DataOnFaces ); + auto virtualGroup = std::make_unique( QStringLiteral( "on face" ), QgsMeshDatasetGroupMetadata::DataOnFaces ); std::shared_ptr dataset = std::make_shared(); dataset->values.resize( 2 ); dataset->values[0] = 12; diff --git a/tests/src/core/testqgsogrprovider.cpp b/tests/src/core/testqgsogrprovider.cpp index 86f987bad571..56e5fc427e38 100644 --- a/tests/src/core/testqgsogrprovider.cpp +++ b/tests/src/core/testqgsogrprovider.cpp @@ -500,7 +500,7 @@ void TestQgsOgrProvider::testVsiCredentialOptions() // if actual aws dataset proves flaky, use this instead: // std::unique_ptr< QgsVectorLayer > vl = std::make_unique< QgsVectorLayer >( QStringLiteral( "/vsis3/testbucket/test|credential:AWS_NO_SIGN_REQUEST=YES|credential:AWS_REGION=eu-central-1|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "ogr" ) ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "/vsis3/cdn.proj.org/files.geojson|credential:AWS_NO_SIGN_REQUEST=YES" ), QStringLiteral( "test" ), QStringLiteral( "ogr" ) ); + auto vl = std::make_unique( QStringLiteral( "/vsis3/cdn.proj.org/files.geojson|credential:AWS_NO_SIGN_REQUEST=YES" ), QStringLiteral( "test" ), QStringLiteral( "ogr" ) ); // confirm that GDAL VSI configuration options are set QString noSign( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_NO_SIGN_REQUEST", nullptr ) ); @@ -517,7 +517,7 @@ void TestQgsOgrProvider::testVsiCredentialOptions() QCOMPARE( vl->dataProvider()->dataSourceUri(), QStringLiteral( "/vsis3/cdn.proj.org/files.geojson|credential:AWS_NO_SIGN_REQUEST=YES" ) ); // credentials should be bucket specific - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "/vsis3/ogranother/subfolder/subfolder2/test|credential:AWS_NO_SIGN_REQUEST=NO|credential:AWS_REGION=eu-central-2|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "ogr" ) ); + auto vl2 = std::make_unique( QStringLiteral( "/vsis3/ogranother/subfolder/subfolder2/test|credential:AWS_NO_SIGN_REQUEST=NO|credential:AWS_REGION=eu-central-2|credential:AWS_S3_ENDPOINT=localhost" ), QStringLiteral( "test" ), QStringLiteral( "ogr" ) ); noSign = QString( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_NO_SIGN_REQUEST", nullptr ) ); QCOMPARE( noSign, QStringLiteral( "YES" ) ); region = QString( VSIGetPathSpecificOption( "/vsis3/cdn.proj.org", "AWS_REGION", nullptr ) ); diff --git a/tests/src/core/testqgspainteffect.cpp b/tests/src/core/testqgspainteffect.cpp index b0bc07f9eb88..723cb5334c69 100644 --- a/tests/src/core/testqgspainteffect.cpp +++ b/tests/src/core/testqgspainteffect.cpp @@ -980,7 +980,7 @@ void TestQgsPaintEffect::layout() lineLayer->setRenderer( renderer ); QgsLayout l( QgsProject::instance() ); - std::unique_ptr page = std::make_unique( &l ); + auto page = std::make_unique( &l ); page->setPageSize( QgsLayoutSize( 50, 50 ) ); l.pageCollection()->addPage( page.release() ); diff --git a/tests/src/core/testqgspointcloudediting.cpp b/tests/src/core/testqgspointcloudediting.cpp index ce0ce03756dd..d99218876fba 100644 --- a/tests/src/core/testqgspointcloudediting.cpp +++ b/tests/src/core/testqgspointcloudediting.cpp @@ -71,7 +71,7 @@ void TestQgsPointCloudEditing::testQgsPointCloudEditingIndex() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); auto i = layer->index(); @@ -98,7 +98,7 @@ void TestQgsPointCloudEditing::testStartStopEditing() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QVERIFY( !layer->isEditable() ); QVERIFY( !layer->isModified() ); @@ -163,7 +163,7 @@ void TestQgsPointCloudEditing::testModifyAttributeValue() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QSignalSpy spy( layer.get(), &QgsMapLayer::layerModified ); @@ -235,7 +235,7 @@ void TestQgsPointCloudEditing::testModifyAttributeValueInvalid() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QVERIFY( layer->startEditing() ); QVERIFY( layer->isEditable() ); @@ -441,7 +441,7 @@ void TestQgsPointCloudEditing::testModifyAttributeValueFiltered() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QSignalSpy spy( layer.get(), &QgsMapLayer::layerModified ); @@ -488,7 +488,7 @@ void TestQgsPointCloudEditing::testCommitChanges() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QVERIFY( layer->startEditing() ); QVERIFY( layer->isEditable() ); @@ -539,7 +539,7 @@ void TestQgsPointCloudEditing::testCommitChanges() QCOMPARE( block2Data[14], 1 ); // try to open the file as a new layer and check saved values - std::unique_ptr layerNew = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layerNew = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); // check values in the new layer std::unique_ptr block3 = layerNew->index().nodeData( n, request ); diff --git a/tests/src/core/testqgspointpatternfillsymbol.cpp b/tests/src/core/testqgspointpatternfillsymbol.cpp index bb65e51bdd0b..500a58621377 100644 --- a/tests/src/core/testqgspointpatternfillsymbol.cpp +++ b/tests/src/core/testqgspointpatternfillsymbol.cpp @@ -195,7 +195,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillSymbolVector() void TestQgsPointPatternFillSymbol::viewportPointPatternFillSymbol() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsVectorSimplifyMethod simplifyMethod; @@ -221,7 +221,7 @@ void TestQgsPointPatternFillSymbol::viewportPointPatternFillSymbol() void TestQgsPointPatternFillSymbol::viewportPointPatternFillSymbolVector() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsVectorSimplifyMethod simplifyMethod; @@ -355,7 +355,7 @@ void TestQgsPointPatternFillSymbol::zeroSpacedPointPatternFillSymbolVector() void TestQgsPointPatternFillSymbol::pointPatternFillNoClip() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -379,7 +379,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillNoClip() void TestQgsPointPatternFillSymbol::pointPatternFillCompletelyWithin() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -403,7 +403,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillCompletelyWithin() void TestQgsPointPatternFillSymbol::pointPatternFillCentroidWithin() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -427,7 +427,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillCentroidWithin() void TestQgsPointPatternFillSymbol::pointPatternFillDataDefinedClip() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -452,7 +452,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillDataDefinedClip() void TestQgsPointPatternFillSymbol::pointPatternFillDataDefinedWithOpacity() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -482,7 +482,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillDataDefinedWithOpacity() void TestQgsPointPatternFillSymbol::pointPatternRandomOffset() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -509,7 +509,7 @@ void TestQgsPointPatternFillSymbol::pointPatternRandomOffset() void TestQgsPointPatternFillSymbol::pointPatternRandomOffsetPercent() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -538,7 +538,7 @@ void TestQgsPointPatternFillSymbol::pointPatternRandomOffsetPercent() void TestQgsPointPatternFillSymbol::pointPatternRandomOffsetDataDefined() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -565,7 +565,7 @@ void TestQgsPointPatternFillSymbol::pointPatternRandomOffsetDataDefined() void TestQgsPointPatternFillSymbol::pointPatternAngle() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -590,7 +590,7 @@ void TestQgsPointPatternFillSymbol::pointPatternAngle() void TestQgsPointPatternFillSymbol::pointPatternAngleDataDefined() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); @@ -616,7 +616,7 @@ void TestQgsPointPatternFillSymbol::pointPatternAngleDataDefined() void TestQgsPointPatternFillSymbol::pointPatternAngleViewport() { - std::unique_ptr layer = std::make_unique( mTestDataDir + "polys.shp" ); + auto layer = std::make_unique( mTestDataDir + "polys.shp" ); QVERIFY( layer->isValid() ); QgsPointPatternFillSymbolLayer *pointPatternFill = new QgsPointPatternFillSymbolLayer(); diff --git a/tests/src/core/testqgsproject.cpp b/tests/src/core/testqgsproject.cpp index 0f30d76e43ba..38d4931a4fad 100644 --- a/tests/src/core/testqgsproject.cpp +++ b/tests/src/core/testqgsproject.cpp @@ -991,7 +991,7 @@ void TestQgsProject::testEmbeddedGroupWithJoins() void TestQgsProject::testAsynchronousLayerLoading() { - std::unique_ptr project = std::make_unique(); + auto project = std::make_unique(); QStringList meshFilters; meshFilters << QStringLiteral( "*.nc" ) << QStringLiteral( "*.2dm" ); @@ -1185,8 +1185,8 @@ void TestQgsProject::testSymlinks1LayerRasterChange() QVERIFY( QFile::link( dataDir + "/" + rasters[0], projectDir + "/latest.tif" ) ); // Create project with layer pointing to symlink - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./latest.tif", QStringLiteral( "Latest" ), QStringLiteral( "gdal" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./latest.tif", QStringLiteral( "Latest" ), QStringLiteral( "gdal" ) ); project->addMapLayer( layer.release() ); project->write( projectPath ); project.reset(); @@ -1244,8 +1244,8 @@ void TestQgsProject::testSymlinks2LayerFolder() QVERIFY( QFile::link( dataDir, projectDir + "/data" ) ); // Create project with relative layer - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./data/points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./data/points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); project->addMapLayer( layer.release() ); project->write( projectPath ); project.reset(); @@ -1287,8 +1287,8 @@ void TestQgsProject::testSymlinks3LayerShapefile() } // Create project with relative layer - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); project->addMapLayer( layer.release() ); project->write( projectPath ); project.reset(); @@ -1360,7 +1360,7 @@ void TestQgsProject::testSymlinks4LayerShapefileBroken() // ++Verify that layer creation follows the (broken) symlink++ // Create memory layer with single point - std::unique_ptr memLayer = std::make_unique( "Point", QStringLiteral( "Points" ), QStringLiteral( "memory" ) ); + auto memLayer = std::make_unique( "Point", QStringLiteral( "Points" ), QStringLiteral( "memory" ) ); QgsFeature feat( memLayer->fields() ); feat.setGeometry( QgsGeometry::fromWkt( "POINT(1 2)" ) ); memLayer->startEditing(); @@ -1373,8 +1373,8 @@ void TestQgsProject::testSymlinks4LayerShapefileBroken() QgsVectorFileWriter::writeAsVectorFormatV3( memLayer.get(), projectDir + "/points.shp", QgsCoordinateTransformContext(), options ); // Create project with the layer - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); project->addMapLayer( layer.release() ); project->write( projectPath ); project.reset(); @@ -1424,8 +1424,8 @@ void TestQgsProject::testSymlinks5ProjectFile() // Create initial project in project dir const QString originalPath = projectDir + "/project.qgs"; const QString originalAttachPath = projectDir + "/project_attachments.zip"; - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); project->addMapLayer( layer.release() ); project->write( originalPath ); project.reset(); @@ -1507,8 +1507,8 @@ void TestQgsProject::testSymlinks6ProjectFolder() // Create initial project in project dir const QString originalPath = projectDir + "/project.qgs"; - std::unique_ptr project = std::make_unique(); - std::unique_ptr layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); + auto project = std::make_unique(); + auto layer = std::make_unique( "./points.shp", QStringLiteral( "Points" ), QStringLiteral( "ogr" ) ); project->addMapLayer( layer.release() ); project->write( originalPath ); project.reset(); @@ -1576,10 +1576,10 @@ void TestQgsProject::regression60100() // Create a new/empty project in PROJDIR const QString projectPath = projDirPath + QStringLiteral( "/project.qgs" ); - std::unique_ptr project = std::make_unique(); + auto project = std::make_unique(); // Add the local points.geojson (in PROJDIR) as a layer - std::unique_ptr layer = std::make_unique( + auto layer = std::make_unique( projDirPath + QStringLiteral( "/points.geojson" ), QStringLiteral( "Test Points" ), QStringLiteral( "ogr" ) diff --git a/tests/src/core/testqgsrasterfilewriter.cpp b/tests/src/core/testqgsrasterfilewriter.cpp index 4bfd504ac3bb..73b1308512ab 100644 --- a/tests/src/core/testqgsrasterfilewriter.cpp +++ b/tests/src/core/testqgsrasterfilewriter.cpp @@ -128,7 +128,7 @@ bool TestQgsRasterFileWriter::writeTest( const QString &rasterName ) mReport += "temporary output file: " + tmpName + "
"; QgsRasterFileWriter fileWriter( tmpName ); - std::unique_ptr pipe = std::make_unique(); + auto pipe = std::make_unique(); if ( !pipe->set( provider->clone() ) ) { appendToReport( QStringLiteral( "Write test" ), QStringLiteral( "Cannot set pipe provider" ) ); @@ -199,7 +199,7 @@ void TestQgsRasterFileWriter::testCreateOneBandRaster() QVERIFY( dp->isEditable() ); dp.reset(); - std::unique_ptr rlayer = std::make_unique( filename, QStringLiteral( "tmp" ), QStringLiteral( "gdal" ) ); + auto rlayer = std::make_unique( filename, QStringLiteral( "tmp" ), QStringLiteral( "gdal" ) ); QVERIFY( rlayer->isValid() ); QCOMPARE( rlayer->width(), width ); QCOMPARE( rlayer->height(), height ); @@ -228,7 +228,7 @@ void TestQgsRasterFileWriter::testCreateMultiBandRaster() QVERIFY( dp->isEditable() ); dp.reset(); - std::unique_ptr rlayer = std::make_unique( filename, QStringLiteral( "tmp" ), QStringLiteral( "gdal" ) ); + auto rlayer = std::make_unique( filename, QStringLiteral( "tmp" ), QStringLiteral( "gdal" ) ); QVERIFY( rlayer->isValid() ); QCOMPARE( rlayer->width(), width ); QCOMPARE( rlayer->height(), height ); @@ -268,10 +268,10 @@ void TestQgsRasterFileWriter::testVrtCreation() //create a raster layer that will be used in all tests... const QString srcFileName = mTestDataDir + QStringLiteral( "ALLINGES_RGF93_CC46_1_1.tif" ); const QFileInfo rasterFileInfo( srcFileName ); - std::unique_ptr srcRasterLayer = std::make_unique( rasterFileInfo.absoluteFilePath(), rasterFileInfo.completeBaseName() ); + auto srcRasterLayer = std::make_unique( rasterFileInfo.absoluteFilePath(), rasterFileInfo.completeBaseName() ); const QTemporaryDir dir; - std::unique_ptr rasterFileWriter = std::make_unique( dir.path() + '/' + rasterFileInfo.completeBaseName() ); + auto rasterFileWriter = std::make_unique( dir.path() + '/' + rasterFileInfo.completeBaseName() ); //2. Definition of the pyramid levels QList levelList; @@ -297,7 +297,7 @@ void TestQgsRasterFileWriter::testVrtCreation() QCOMPARE( res, Qgis::RasterFileWriterResult::Success ); // Now let's compare the georef of the original raster with the georef of the generated vrt file - std::unique_ptr vrtRasterLayer = std::make_unique( dir.path() + '/' + rasterFileInfo.completeBaseName() + '/' + rasterFileInfo.completeBaseName() + QStringLiteral( ".vrt" ), rasterFileInfo.completeBaseName() ); + auto vrtRasterLayer = std::make_unique( dir.path() + '/' + rasterFileInfo.completeBaseName() + '/' + rasterFileInfo.completeBaseName() + QStringLiteral( ".vrt" ), rasterFileInfo.completeBaseName() ); const double xminVrt = vrtRasterLayer->extent().xMinimum(); const double yminVrt = vrtRasterLayer->extent().yMaximum(); diff --git a/tests/src/core/testqgsrasterlayer.cpp b/tests/src/core/testqgsrasterlayer.cpp index 5a4b36bd2d63..f5212f4e436c 100644 --- a/tests/src/core/testqgsrasterlayer.cpp +++ b/tests/src/core/testqgsrasterlayer.cpp @@ -683,10 +683,10 @@ void TestQgsRasterLayer::multiBandColorRendererNoDataColor() void TestQgsRasterLayer::palettedRendererNoData() { const QString rasterFileName = mTestDataDir + "raster/with_color_table.tif"; - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); - std::unique_ptr rasterRenderer = std::make_unique( rl->dataProvider(), 1, QList() << QgsPalettedRasterRenderer::Class( 1, QColor( 0, 255, 0 ), QStringLiteral( "class 2" ) ) << QgsPalettedRasterRenderer::Class( 3, QColor( 255, 0, 0 ), QStringLiteral( "class 1" ) ) ); + auto rasterRenderer = std::make_unique( rl->dataProvider(), 1, QList() << QgsPalettedRasterRenderer::Class( 1, QColor( 0, 255, 0 ), QStringLiteral( "class 2" ) ) << QgsPalettedRasterRenderer::Class( 3, QColor( 255, 0, 0 ), QStringLiteral( "class 1" ) ) ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 2 ) ); rl->setRenderer( rasterRenderer.release() ); mMapSettings->setLayers( QList() << rl.get() ); @@ -698,7 +698,7 @@ void TestQgsRasterLayer::palettedRendererNoData() void TestQgsRasterLayer::palettedRendererRasterAttributeTable() { const QString rasterFileName = mTestDataDir + "raster/band1_byte_attribute_table_epsg4326.tif"; - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 9999 ) ); mMapSettings->setLayers( QList() << rl.get() ); @@ -751,7 +751,7 @@ void TestQgsRasterLayer::palettedRendererRasterAttributeTable() void TestQgsRasterLayer::palettedRendererNoDataColor() { const QString rasterFileName = mTestDataDir + "raster/with_color_table.tif"; - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); QgsPalettedRasterRenderer *rasterRenderer = new QgsPalettedRasterRenderer( rl->dataProvider(), 1, QList() << QgsPalettedRasterRenderer::Class( 1, QColor( 0, 255, 0 ), QStringLiteral( "class 2" ) ) << QgsPalettedRasterRenderer::Class( 3, QColor( 255, 0, 0 ), QStringLiteral( "class 1" ) ) ); @@ -774,7 +774,7 @@ void TestQgsRasterLayer::palettedRendererConstantInt() Q_ASSERT( hDS ); GDALFillRaster( GDALGetRasterBand( hDS, 1 ), value, 0 ); GDALClose( hDS ); - std::unique_ptr rl = std::make_unique( QString( tempFileName ), QStringLiteral( "rl" ) ); + auto rl = std::make_unique( QString( tempFileName ), QStringLiteral( "rl" ) ); Q_ASSERT( rl->isValid() ); const auto classData { QgsPalettedRasterRenderer::classDataFromRaster( rl->dataProvider(), 1 ) }; QCOMPARE( classData.size(), 1 ); @@ -790,10 +790,10 @@ void TestQgsRasterLayer::singleBandGrayRendererNoData() QFile::copy( mTestDataDir + "landsat.tif", tmpDir.filePath( QStringLiteral( "landsat.tif" ) ) ); const QString rasterFileName = tmpDir.filePath( QStringLiteral( "landsat.tif" ) ); - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); - std::unique_ptr rasterRenderer = std::make_unique( rl->dataProvider(), 1 ); + auto rasterRenderer = std::make_unique( rl->dataProvider(), 1 ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 126 ) ); rl->setRenderer( rasterRenderer.release() ); mMapSettings->setLayers( QList() << rl.get() ); @@ -809,10 +809,10 @@ void TestQgsRasterLayer::singleBandGrayRendererNoDataColor() QFile::copy( mTestDataDir + "landsat.tif", tmpDir.filePath( QStringLiteral( "landsat.tif" ) ) ); const QString rasterFileName = tmpDir.filePath( QStringLiteral( "landsat.tif" ) ); - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); - std::unique_ptr rasterRenderer = std::make_unique( rl->dataProvider(), 1 ); + auto rasterRenderer = std::make_unique( rl->dataProvider(), 1 ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 126 ) ); rasterRenderer->setNodataColor( QColor( 255, 0, 255 ) ); rl->setRenderer( rasterRenderer.release() ); @@ -829,7 +829,7 @@ void TestQgsRasterLayer::singleBandPseudoRendererNoData() QFile::copy( mTestDataDir + "landsat.tif", tmpDir.filePath( QStringLiteral( "landsat.tif" ) ) ); const QString rasterFileName = tmpDir.filePath( QStringLiteral( "landsat.tif" ) ); - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); QgsRasterShader *rasterShader = new QgsRasterShader(); @@ -858,7 +858,7 @@ void TestQgsRasterLayer::singleBandPseudoRendererNoData() colorRampShader->setColorRampItemList( colorRampItems ); rasterShader->setRasterShaderFunction( colorRampShader ); - std::unique_ptr rasterRenderer = std::make_unique( rl->dataProvider(), 1, rasterShader ); + auto rasterRenderer = std::make_unique( rl->dataProvider(), 1, rasterShader ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 126 ) ); rl->setRenderer( rasterRenderer.release() ); mMapSettings->setLayers( QList() << rl.get() ); @@ -874,7 +874,7 @@ void TestQgsRasterLayer::singleBandPseudoRendererNoDataColor() QFile::copy( mTestDataDir + "landsat.tif", tmpDir.filePath( QStringLiteral( "landsat.tif" ) ) ); const QString rasterFileName = tmpDir.filePath( QStringLiteral( "landsat.tif" ) ); - std::unique_ptr rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); + auto rl = std::make_unique( rasterFileName, QStringLiteral( "rl" ) ); QVERIFY( rl->isValid() ); QgsRasterShader *rasterShader = new QgsRasterShader(); @@ -903,7 +903,7 @@ void TestQgsRasterLayer::singleBandPseudoRendererNoDataColor() colorRampShader->setColorRampItemList( colorRampItems ); rasterShader->setRasterShaderFunction( colorRampShader ); - std::unique_ptr rasterRenderer = std::make_unique( rl->dataProvider(), 1, rasterShader ); + auto rasterRenderer = std::make_unique( rl->dataProvider(), 1, rasterShader ); QVERIFY( rl->dataProvider()->setNoDataValue( 1, 126 ) ); rasterRenderer->setNodataColor( QColor( 255, 0, 255 ) ); rl->setRenderer( rasterRenderer.release() ); @@ -1021,7 +1021,7 @@ void TestQgsRasterLayer::sample() QString fileName = mTestDataDir + "landsat-f32-b1.tif"; QFileInfo rasterFileInfo( fileName ); - std::unique_ptr rl = std::make_unique( rasterFileInfo.filePath(), rasterFileInfo.completeBaseName() ); + auto rl = std::make_unique( rasterFileInfo.filePath(), rasterFileInfo.completeBaseName() ); QVERIFY( rl->isValid() ); QVERIFY( std::isnan( rl->dataProvider()->sample( QgsPointXY( 0, 0 ), 1 ) ) ); bool ok = false; @@ -1102,13 +1102,13 @@ void TestQgsRasterLayer::rotatedRaster() { mMapSettings->setExtent( QgsRectangle( 994, 922, 1174, 1102 ) ); - std::unique_ptr rgb = std::make_unique( mTestDataDir + "raster/rotated_rgb.png", QStringLiteral( "rgb" ) ); + auto rgb = std::make_unique( mTestDataDir + "raster/rotated_rgb.png", QStringLiteral( "rgb" ) ); QVERIFY( rgb->isValid() ); mMapSettings->setLayers( QList() << rgb.get() ); QVERIFY( render( QStringLiteral( "raster_rotated_rgb" ) ) ); - std::unique_ptr rgba = std::make_unique( mTestDataDir + "raster/rotated_rgba.png", QStringLiteral( "rgba" ) ); + auto rgba = std::make_unique( mTestDataDir + "raster/rotated_rgba.png", QStringLiteral( "rgba" ) ); QVERIFY( rgba->isValid() ); mMapSettings->setLayers( QList() << rgba.get() ); diff --git a/tests/src/core/testqgsrenderers.cpp b/tests/src/core/testqgsrenderers.cpp index 913aa82705cd..984087821af0 100644 --- a/tests/src/core/testqgsrenderers.cpp +++ b/tests/src/core/testqgsrenderers.cpp @@ -156,7 +156,7 @@ void TestQgsRenderers::emptyGeometry() QgsProject::instance()->addMapLayer( vl ); QgsFeature f; - std::unique_ptr mp = std::make_unique(); + auto mp = std::make_unique(); mp->addGeometry( new QgsPolygon() ); f.setGeometry( QgsGeometry( std::move( mp ) ) ); QVERIFY( vl->dataProvider()->addFeature( f ) ); @@ -182,7 +182,7 @@ void TestQgsRenderers::emptyGeometry() vl = new QgsVectorLayer( QStringLiteral( "MultiLineString?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); QgsProject::instance()->addMapLayer( vl ); - std::unique_ptr mls = std::make_unique(); + auto mls = std::make_unique(); mls->addGeometry( new QgsLineString() ); f.setGeometry( QgsGeometry( std::move( mls ) ) ); QVERIFY( vl->dataProvider()->addFeature( f ) ); @@ -192,7 +192,7 @@ void TestQgsRenderers::emptyGeometry() vl = new QgsVectorLayer( QStringLiteral( "MultiPoint?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); QgsProject::instance()->addMapLayer( vl ); - std::unique_ptr mlp = std::make_unique(); + auto mlp = std::make_unique(); f.setGeometry( QgsGeometry( std::move( mlp ) ) ); QVERIFY( vl->dataProvider()->addFeature( f ) ); QVERIFY( checkEmptyRender( "MultiPoint", vl ) ); diff --git a/tests/src/core/testqgsrulebasedrenderer.cpp b/tests/src/core/testqgsrulebasedrenderer.cpp index 2fde23257b73..473d81f66ba6 100644 --- a/tests/src/core/testqgsrulebasedrenderer.cpp +++ b/tests/src/core/testqgsrulebasedrenderer.cpp @@ -164,7 +164,7 @@ class TestQgsRuleBasedRenderer : public QgsTest */ void test_many_rules_expression_filter() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "point?field=fld:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "point?field=fld:int" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QgsRenderContext ctx; // dummy render context ctx.expressionContext().setFields( layer->fields() ); @@ -194,7 +194,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testElse() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -232,7 +232,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testDisabledElse() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -272,7 +272,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testNoMatchingZoomRanges() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -330,7 +330,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testWillRenderFeature() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -385,7 +385,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testGroupAndElseRules() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -430,7 +430,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testWillRenderFeatureNestedElse() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -480,7 +480,7 @@ class TestQgsRuleBasedRenderer : public QgsTest // Regression #21287, also test rulesForFeature since there were no tests any where and I've found a couple of issues const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -545,7 +545,7 @@ class TestQgsRuleBasedRenderer : public QgsTest rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); - std::unique_ptr renderer = std::make_unique( rootrule ); + auto renderer = std::make_unique( rootrule ); QgsMapSettings mapsettings; mapsettings.setOutputSize( QSize( 400, 400 ) ); @@ -559,7 +559,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testPointsUsedAttributes() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/points.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); // Create rulebased style @@ -616,7 +616,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testFeatureCount() { const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -672,7 +672,7 @@ class TestQgsRuleBasedRenderer : public QgsTest // Test refining rule with categories (refs #10815) const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -686,7 +686,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -696,7 +696,7 @@ class TestQgsRuleBasedRenderer : public QgsTest cats.append( QgsRendererCategory( 1, new QgsMarkerSymbol(), "id 1" ) ); cats.append( QgsRendererCategory( 2, new QgsMarkerSymbol(), QString() ) ); cats.append( QgsRendererCategory( QVariant(), new QgsMarkerSymbol(), QString() ) ); - std::unique_ptr c = std::make_unique( "id", cats ); + auto c = std::make_unique( "id", cats ); QgsRuleBasedRenderer::refineRuleCategories( r2, c.get() ); QCOMPARE( r2->children()[0]->filterExpression(), "\"id\" = 1" ); @@ -736,7 +736,7 @@ class TestQgsRuleBasedRenderer : public QgsTest // Test refining rule with ranges (refs #10815) const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -750,7 +750,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -759,7 +759,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QList ranges; ranges.append( QgsRendererRange( 0, 1, new QgsMarkerSymbol(), "0-1" ) ); ranges.append( QgsRendererRange( 1, 2, new QgsMarkerSymbol(), "1-2" ) ); - std::unique_ptr c = std::make_unique( "id", ranges ); + auto c = std::make_unique( "id", ranges ); QgsRuleBasedRenderer::refineRuleRanges( r2, c.get() ); QCOMPARE( r2->children()[0]->filterExpression(), "\"id\" >= 0.0000 AND \"id\" <= 1.0000" ); @@ -791,7 +791,7 @@ class TestQgsRuleBasedRenderer : public QgsTest // Test converting categorised renderer to rule based const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -805,7 +805,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -819,7 +819,7 @@ class TestQgsRuleBasedRenderer : public QgsTest cats.append( QgsRendererCategory( "a\\b", new QgsMarkerSymbol(), "id a\\\\b" ) ); cats.append( QgsRendererCategory( "a\tb", new QgsMarkerSymbol(), "id a\\tb" ) ); cats.append( QgsRendererCategory( QVariantList( { "c", "d" } ), new QgsMarkerSymbol(), "c/d" ) ); - std::unique_ptr c = std::make_unique( "id", cats ); + auto c = std::make_unique( "id", cats ); std::unique_ptr r( QgsRuleBasedRenderer::convertFromRenderer( c.get(), layer.get() ) ); QCOMPARE( r->rootRule()->children().size(), 7 ); @@ -881,7 +881,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -895,7 +895,7 @@ class TestQgsRuleBasedRenderer : public QgsTest cats.append( QgsRendererCategory( "a\\b", new QgsMarkerSymbol(), "id a\\\\b" ) ); cats.append( QgsRendererCategory( "a\tb", new QgsMarkerSymbol(), "id a\\tb" ) ); cats.append( QgsRendererCategory( QVariantList( { "c", "d" } ), new QgsMarkerSymbol(), "c/d" ) ); - std::unique_ptr c = std::make_unique( "id", cats ); + auto c = std::make_unique( "id", cats ); std::unique_ptr r( QgsRuleBasedRenderer::convertFromRenderer( c.get() ) ); QCOMPARE( r->rootRule()->children().size(), 7 ); @@ -950,7 +950,7 @@ class TestQgsRuleBasedRenderer : public QgsTest // Test converting graduated renderer to rule based const QString shpFile = TEST_DATA_DIR + QStringLiteral( "/rectangles.shp" ); - std::unique_ptr layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); + auto layer = std::make_unique( shpFile, QStringLiteral( "rectangles" ), QStringLiteral( "ogr" ) ); QVERIFY( layer->isValid() ); QgsField vfield = QgsField( QStringLiteral( "fa_cy-fie+ld" ), QMetaType::Type::Int ); layer->addExpressionField( QStringLiteral( "\"id\"" ), vfield ); @@ -964,7 +964,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -973,7 +973,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QList ranges; ranges.append( QgsRendererRange( 0, 1, new QgsMarkerSymbol(), "0-1" ) ); ranges.append( QgsRendererRange( 1, 2, new QgsMarkerSymbol(), "1-2" ) ); - std::unique_ptr c = std::make_unique( "id", ranges ); + auto c = std::make_unique( "id", ranges ); std::unique_ptr r( QgsRuleBasedRenderer::convertFromRenderer( c.get(), layer.get() ) ); QCOMPARE( r->rootRule()->children().size(), 2 ); @@ -1027,7 +1027,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QgsRuleBasedRenderer::Rule *r2 = new QgsRuleBasedRenderer::Rule( sym2, 0, 0, "\"id\" = 2" ); QgsRuleBasedRenderer::Rule *r3 = new QgsRuleBasedRenderer::Rule( sym3, 0, 0, "ELSE" ); - std::unique_ptr rootrule = std::make_unique( nullptr ); + auto rootrule = std::make_unique( nullptr ); rootrule->appendChild( r1 ); rootrule->appendChild( r2 ); rootrule->appendChild( r3 ); @@ -1036,7 +1036,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QList ranges; ranges.append( QgsRendererRange( 0, 1, new QgsMarkerSymbol(), "0-1" ) ); ranges.append( QgsRendererRange( 1, 2, new QgsMarkerSymbol(), "1-2" ) ); - std::unique_ptr c = std::make_unique( "id", ranges ); + auto c = std::make_unique( "id", ranges ); std::unique_ptr r( QgsRuleBasedRenderer::convertFromRenderer( c.get() ) ); QCOMPARE( r->rootRule()->children().size(), 2 ); @@ -1081,7 +1081,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testConvertFromEmbedded() { // Test converting an embedded symbol renderer to a rule based renderer - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "points" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "points" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature f; @@ -1120,7 +1120,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testNullsCount() { - std::unique_ptr layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=number:int" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); + auto layer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=number:int" ), QStringLiteral( "test" ), QStringLiteral( "memory" ) ); QVERIFY( layer->isValid() ); QgsFeature f( layer->fields() ); @@ -1153,7 +1153,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testLegendKeys() { QgsRuleBasedRenderer::Rule *rootRule = new QgsRuleBasedRenderer::Rule( nullptr ); - std::unique_ptr renderer = std::make_unique( rootRule ); + auto renderer = std::make_unique( rootRule ); QVERIFY( renderer->legendKeys().empty() ); @@ -1179,7 +1179,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testLegendKeysForFeature() { QgsRuleBasedRenderer::Rule *rootRule = new QgsRuleBasedRenderer::Rule( nullptr ); - std::unique_ptr renderer = std::make_unique( rootRule ); + auto renderer = std::make_unique( rootRule ); std::unique_ptr symbol( QgsMarkerSymbol::createSimple( {} ) ); QgsRuleBasedRenderer::Rule *lessThanTwoRule = new QgsRuleBasedRenderer::Rule( symbol->clone(), 0, 0, "\"Importance\" <= 2" ); @@ -1243,7 +1243,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testLegendKeyToExpression() { QgsRuleBasedRenderer::Rule *rootRule = new QgsRuleBasedRenderer::Rule( nullptr ); - std::unique_ptr renderer = std::make_unique( rootRule ); + auto renderer = std::make_unique( rootRule ); bool ok = false; QString exp = renderer->legendKeyToExpression( "xxxx", nullptr, ok ); @@ -1362,7 +1362,7 @@ class TestQgsRuleBasedRenderer : public QgsTest void testElseRuleSld() { QgsRuleBasedRenderer::Rule *rootRule = new QgsRuleBasedRenderer::Rule( nullptr ); - std::unique_ptr renderer = std::make_unique( rootRule ); + auto renderer = std::make_unique( rootRule ); QgsRuleBasedRenderer::Rule *rule1 = new QgsRuleBasedRenderer::Rule( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ), 0, 0, "\"field_name\" = 1" ); QgsRuleBasedRenderer::Rule *rule2 = new QgsRuleBasedRenderer::Rule( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ), 0, 0, "\"field_name\" = 6" ); @@ -1383,7 +1383,7 @@ class TestQgsRuleBasedRenderer : public QgsTest QCOMPARE( exp, "NOT ((\"field_name\" = 1) OR (\"field_name\" = 6))" ); QgsFields fields; - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=field_name:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=field_name:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); vl->setRenderer( renderer.release() ); QString error; QDomDocument dom; diff --git a/tests/src/core/testqgsspatialindex.cpp b/tests/src/core/testqgsspatialindex.cpp index 149038dd6baf..83e62695195a 100644 --- a/tests/src/core/testqgsspatialindex.cpp +++ b/tests/src/core/testqgsspatialindex.cpp @@ -248,7 +248,7 @@ class TestQgsSpatialIndex : public QObject void bulkLoadWithCallback() { - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); QList addedIds; for ( int i = 0; i < 10; ++i ) { diff --git a/tests/src/core/testqgsspatialindexkdbush.cpp b/tests/src/core/testqgsspatialindexkdbush.cpp index f6c0dde86f3f..0a780a528995 100644 --- a/tests/src/core/testqgsspatialindexkdbush.cpp +++ b/tests/src/core/testqgsspatialindexkdbush.cpp @@ -81,7 +81,7 @@ class TestQgsSpatialIndexKdBush : public QObject void testQuery() { - std::unique_ptr vl = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); for ( QgsFeature f : _pointFeatures() ) vl->dataProvider()->addFeature( f ); const QgsSpatialIndexKDBush index( *vl->dataProvider() ); @@ -115,7 +115,7 @@ class TestQgsSpatialIndexKdBush : public QObject void testCopy() { - std::unique_ptr vl = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); for ( QgsFeature f : _pointFeatures() ) vl->dataProvider()->addFeature( f ); @@ -145,7 +145,7 @@ class TestQgsSpatialIndexKdBush : public QObject QVERIFY( indexCopy->d->ref == 1 ); // assignment operator - std::unique_ptr vl2 = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( "Point", QString(), QStringLiteral( "memory" ) ); QgsSpatialIndexKDBush index3( *vl2->dataProvider() ); QVERIFY( index3.size() == 0 ); fids = index3.intersects( QgsRectangle( 0, 0, 10, 10 ) ); diff --git a/tests/src/core/testqgssqliteexpressioncompiler.cpp b/tests/src/core/testqgssqliteexpressioncompiler.cpp index 8197d4512b5f..3ae089e9f7fb 100644 --- a/tests/src/core/testqgssqliteexpressioncompiler.cpp +++ b/tests/src/core/testqgssqliteexpressioncompiler.cpp @@ -124,7 +124,7 @@ void TestQgsSQLiteExpressionCompiler::testPreparedCachedNodes() QgsExpression exp( QStringLiteral( "\"Z\" = (1 + 2) OR \"z\" < (@static_var + 5)" ) ); QgsExpressionContext context; - std::unique_ptr scope = std::make_unique(); + auto scope = std::make_unique(); scope->setVariable( QStringLiteral( "static_var" ), 10, true ); context.appendScope( scope.release() ); // not possible to compile due to use of a variable diff --git a/tests/src/core/testqgsvectorlayerutils.cpp b/tests/src/core/testqgsvectorlayerutils.cpp index d41e93e06d45..8a5b306876d7 100644 --- a/tests/src/core/testqgsvectorlayerutils.cpp +++ b/tests/src/core/testqgsvectorlayerutils.cpp @@ -79,7 +79,7 @@ class FeatureFetcher : public QThread void TestQgsVectorLayerUtils::testGetFeatureSource() { - std::unique_ptr vl = std::make_unique( QStringLiteral( "Point?field=col1:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Point?field=col1:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); vl->startEditing(); QgsFeature f1( vl->fields(), 1 ); f1.setAttribute( QStringLiteral( "col1" ), 10 ); diff --git a/tests/src/core/testqgsvectortilelayer.cpp b/tests/src/core/testqgsvectortilelayer.cpp index 2a55d79f849b..200d6cef0111 100644 --- a/tests/src/core/testqgsvectortilelayer.cpp +++ b/tests/src/core/testqgsvectortilelayer.cpp @@ -332,7 +332,7 @@ void TestQgsVectorTileLayer::test_relativePathsMbTiles() const QString srcMbtiles = QStringLiteral( "type=mbtiles&url=%1/vector_tile/mbtiles_vt.mbtiles" ).arg( TEST_DATA_DIR ); - std::unique_ptr layer = std::make_unique( srcMbtiles ); + auto layer = std::make_unique( srcMbtiles ); QVERIFY( layer->isValid() ); QCOMPARE( layer->providerType(), QStringLiteral( "mbtilesvectortiles" ) ); @@ -376,7 +376,7 @@ void TestQgsVectorTileLayer::test_mbtilesZoom16() { const QString srcMbtiles = QStringLiteral( "type=mbtiles&url=%1/vector_tile/z16.mbtiles" ).arg( TEST_DATA_DIR ); - std::unique_ptr layer = std::make_unique( srcMbtiles ); + auto layer = std::make_unique( srcMbtiles ); QVERIFY( layer->isValid() ); QCOMPARE( layer->providerType(), QStringLiteral( "mbtilesvectortiles" ) ); QCOMPARE( layer->sourceMinZoom(), 16 ); @@ -392,7 +392,7 @@ void TestQgsVectorTileLayer::test_relativePathsXyz() const QString srcXyzLocal = "type=xyz&url=file:///home/qgis/%7Bz%7D/%7Bx%7D/%7By%7D.pbf"; const QString srcXyzRemote = "type=xyz&url=http://www.example.com/%7Bz%7D/%7Bx%7D/%7By%7D.pbf"; - std::unique_ptr layer = std::make_unique( srcXyzLocal ); + auto layer = std::make_unique( srcXyzLocal ); QCOMPARE( layer->providerType(), QStringLiteral( "xyzvectortiles" ) ); // encode source: converting absolute paths to relative @@ -499,7 +499,7 @@ void TestQgsVectorTileLayer::test_relativePathsVtpk() const QString srcVtpk = QStringLiteral( "type=vtpk&url=%1/testvtpk.vtpk" ).arg( TEST_DATA_DIR ); - std::unique_ptr layer = std::make_unique( srcVtpk ); + auto layer = std::make_unique( srcVtpk ); QVERIFY( layer->isValid() ); QCOMPARE( layer->providerType(), QStringLiteral( "vtpkvectortiles" ) ); @@ -546,7 +546,7 @@ void TestQgsVectorTileLayer::test_polygonWithLineStyle() ds.setParam( "type", "xyz" ); ds.setParam( "url", QString( "file://%1/{z}-{x}-{y}.pbf" ).arg( mDataDir ) ); ds.setParam( "zmax", "1" ); - std::unique_ptr layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); + auto layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); QVERIFY( layer->isValid() ); mMapSettings->setLayers( QList() << layer.get() ); @@ -586,7 +586,7 @@ void TestQgsVectorTileLayer::test_polygonWithMarker() ds.setParam( "type", "xyz" ); ds.setParam( "url", QString( "file://%1/{z}-{x}-{y}.pbf" ).arg( mDataDir ) ); ds.setParam( "zmax", "1" ); - std::unique_ptr layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); + auto layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); QVERIFY( layer->isValid() ); mMapSettings->setLayers( QList() << layer.get() ); @@ -624,7 +624,7 @@ void TestQgsVectorTileLayer::test_styleMinZoomBeyondTileMaxZoom() ds.setParam( "type", "xyz" ); ds.setParam( "url", QString( "file://%1/{z}-{x}-{y}.pbf" ).arg( mDataDir ) ); ds.setParam( "zmax", "1" ); - std::unique_ptr layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); + auto layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); QVERIFY( layer->isValid() ); mMapSettings->setLayers( QList() << layer.get() ); @@ -664,7 +664,7 @@ void TestQgsVectorTileLayer::test_filterRuleAllLayers() QgsDataSourceUri ds; ds.setParam( "type", "mbtiles" ); ds.setParam( "url", QString( "/%1/mbtiles_vt.mbtiles" ).arg( mDataDir ) ); - std::unique_ptr layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); + auto layer = std::make_unique( ds.encodedUri(), "Vector Tiles Test" ); QVERIFY( layer->isValid() ); mMapSettings->setLayers( QList() << layer.get() ); diff --git a/tests/src/geometry_checker/testqgsgeometrychecks.cpp b/tests/src/geometry_checker/testqgsgeometrychecks.cpp index 76a98237f82b..b38d5fa8642d 100644 --- a/tests/src/geometry_checker/testqgsgeometrychecks.cpp +++ b/tests/src/geometry_checker/testqgsgeometrychecks.cpp @@ -639,7 +639,7 @@ void TestQgsGeometryChecks::testAllowedGaps() const auto testContext = createTestContext( dir, layers ); // Allowed gaps layer - std::unique_ptr allowedGaps = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326" ), QStringLiteral( "allowedGaps" ), QStringLiteral( "memory" ) ); + auto allowedGaps = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326" ), QStringLiteral( "allowedGaps" ), QStringLiteral( "memory" ) ); QgsProject::instance()->addMapLayer( allowedGaps.get(), true, false ); // Test detection diff --git a/tests/src/geometry_checker/testqgsvectorlayerfeaturepool.cpp b/tests/src/geometry_checker/testqgsvectorlayerfeaturepool.cpp index 2c69d4cb5acd..56ffa2ddeadb 100644 --- a/tests/src/geometry_checker/testqgsvectorlayerfeaturepool.cpp +++ b/tests/src/geometry_checker/testqgsvectorlayerfeaturepool.cpp @@ -199,7 +199,7 @@ void TestQgsVectorLayerFeaturePool::changeGeometry() std::unique_ptr TestQgsVectorLayerFeaturePool::createPopulatedLayer() { - std::unique_ptr vl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "Polygons" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Polygon" ), QStringLiteral( "Polygons" ), QStringLiteral( "memory" ) ); QgsFeature feature; feature.setGeometry( QgsGeometry::fromWkt( QStringLiteral( "Polygon((0 0, 10 0, 10 10, 0 10, 0 0))" ) ) ); diff --git a/tests/src/gui/testprocessinggui.cpp b/tests/src/gui/testprocessinggui.cpp index 93162a486072..c8b30a7326cf 100644 --- a/tests/src/gui/testprocessinggui.cpp +++ b/tests/src/gui/testprocessinggui.cpp @@ -586,19 +586,19 @@ void TestProcessingGui::testWrapperGeneral() QVERIFY( !falseDefault.widgetValue().toBool() ); delete w; - std::unique_ptr mc = std::make_unique(); + auto mc = std::make_unique(); QgsProcessingParameterWidgetContext widgetContext; widgetContext.setMapCanvas( mc.get() ); QCOMPARE( widgetContext.mapCanvas(), mc.get() ); - std::unique_ptr mb = std::make_unique(); + auto mb = std::make_unique(); widgetContext.setMessageBar( mb.get() ); QCOMPARE( widgetContext.messageBar(), mb.get() ); QgsProject p; widgetContext.setProject( &p ); QCOMPARE( widgetContext.project(), &p ); - std::unique_ptr model = std::make_unique(); + auto model = std::make_unique(); widgetContext.setModel( model.get() ); QCOMPARE( widgetContext.model(), model.get() ); widgetContext.setModelChildAlgorithmId( QStringLiteral( "xx" ) ); @@ -893,7 +893,7 @@ void TestProcessingGui::testHiddenWrapper() QVERIFY( !wrapper.createWrappedWidget( context ) ); QVERIFY( !wrapper.createWrappedLabel() ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); QVERIFY( !wrapper.linkedVectorLayer() ); wrapper.setLinkedVectorLayer( vl.get() ); QCOMPARE( wrapper.linkedVectorLayer(), vl.get() ); @@ -984,7 +984,7 @@ void TestProcessingGui::testBooleanWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "boolean" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "boolean" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -1270,7 +1270,7 @@ void TestProcessingGui::testStringWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "string" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "string" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -1378,7 +1378,7 @@ void TestProcessingGui::testFileWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "file" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "file" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -1635,7 +1635,7 @@ void TestProcessingGui::testCrsWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "crs" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "crs" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -1831,7 +1831,7 @@ void TestProcessingGui::testNumericWrapperDouble() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "number" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "number" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2020,7 +2020,7 @@ void TestProcessingGui::testNumericWrapperInt() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "number" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "number" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2146,7 +2146,7 @@ void TestProcessingGui::testDistanceWrapper() QVERIFY( wrapper.mLabel->isVisible() ); // layer values - std::unique_ptr vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "meters" ) ); QVERIFY( !wrapper.mWarningLabel->isVisible() ); @@ -2154,7 +2154,7 @@ void TestProcessingGui::testDistanceWrapper() QVERIFY( !wrapper.mLabel->isVisible() ); QCOMPARE( wrapper.mUnitsCombo->currentData().toInt(), static_cast( Qgis::DistanceUnit::Meters ) ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl2.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "degrees" ) ); QVERIFY( wrapper.mWarningLabel->isVisible() ); @@ -2269,7 +2269,7 @@ void TestProcessingGui::testDistanceWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "distance" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "distance" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2369,7 +2369,7 @@ void TestProcessingGui::testAreaWrapper() QVERIFY( wrapper.mLabel->isVisible() ); // layer values - std::unique_ptr vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "square meters" ) ); QVERIFY( !wrapper.mWarningLabel->isVisible() ); @@ -2377,7 +2377,7 @@ void TestProcessingGui::testAreaWrapper() QVERIFY( !wrapper.mLabel->isVisible() ); QCOMPARE( wrapper.mUnitsCombo->currentData().value(), Qgis::AreaUnit::SquareMeters ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl2.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "square degrees" ) ); QVERIFY( wrapper.mWarningLabel->isVisible() ); @@ -2492,7 +2492,7 @@ void TestProcessingGui::testAreaWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "area" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "area" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2592,7 +2592,7 @@ void TestProcessingGui::testVolumeWrapper() QVERIFY( wrapper.mLabel->isVisible() ); // layer values - std::unique_ptr vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "Polygon?crs=epsg:3111&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "cubic meters" ) ); QVERIFY( !wrapper.mWarningLabel->isVisible() ); @@ -2600,7 +2600,7 @@ void TestProcessingGui::testVolumeWrapper() QVERIFY( !wrapper.mLabel->isVisible() ); QCOMPARE( wrapper.mUnitsCombo->currentData().value(), Qgis::VolumeUnit::CubicMeters ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Polygon?crs=epsg:4326&field=pk:int" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ); wrapper.setUnitParameterValue( QVariant::fromValue( vl2.get() ) ); QCOMPARE( wrapper.mLabel->text(), QStringLiteral( "cubic degrees" ) ); QVERIFY( wrapper.mWarningLabel->isVisible() ); @@ -2715,7 +2715,7 @@ void TestProcessingGui::testVolumeWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "volume" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "volume" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2854,7 +2854,7 @@ void TestProcessingGui::testDurationWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "duration" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "duration" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -2978,7 +2978,7 @@ void TestProcessingGui::testScaleWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "scale" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "scale" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -3138,7 +3138,7 @@ void TestProcessingGui::testRangeWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "range" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "range" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -3170,7 +3170,7 @@ void TestProcessingGui::testRangeWrapper() void TestProcessingGui::testMatrixDialog() { QgsProcessingParameterMatrix matrixParam( QString(), QString(), 3, false, QStringList() << QStringLiteral( "a" ) << QStringLiteral( "b" ) ); - std::unique_ptr dlg = std::make_unique( nullptr, &matrixParam ); + auto dlg = std::make_unique( nullptr, &matrixParam ); // variable length table QVERIFY( dlg->mButtonAdd->isEnabled() ); QVERIFY( dlg->mButtonRemove->isEnabled() ); @@ -3250,7 +3250,7 @@ void TestProcessingGui::testMatrixWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "matrix" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "matrix" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -3476,7 +3476,7 @@ void TestProcessingGui::testExpressionWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "expression" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "expression" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -3935,7 +3935,7 @@ void TestProcessingGui::testFieldWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "field" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "field" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !def->defaultValue().isValid() ); @@ -3978,11 +3978,11 @@ void TestProcessingGui::testMultipleSelectionDialog() { QVariantList availableOptions; QVariantList selectedOptions; - std::unique_ptr dlg = std::make_unique( availableOptions, selectedOptions ); + auto dlg = std::make_unique( availableOptions, selectedOptions ); QVERIFY( dlg->selectedOptions().isEmpty() ); QCOMPARE( dlg->mModel->rowCount(), 0 ); - std::unique_ptr vl = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( QStringLiteral( "LineString" ), QStringLiteral( "x" ), QStringLiteral( "memory" ) ); availableOptions << QVariant( "aa" ) << QVariant( 15 ) << QVariant::fromValue( vl.get() ); dlg = std::make_unique( availableOptions, selectedOptions ); QVERIFY( dlg->selectedOptions().isEmpty() ); @@ -4082,9 +4082,9 @@ void TestProcessingGui::testMultipleSelectionDialog() void TestProcessingGui::testMultipleFileSelectionDialog() { - std::unique_ptr param = std::make_unique( QString(), QString(), Qgis::ProcessingSourceType::Raster ); + auto param = std::make_unique( QString(), QString(), Qgis::ProcessingSourceType::Raster ); QVariantList selectedOptions; - std::unique_ptr dlg = std::make_unique( param.get(), selectedOptions, QList() ); + auto dlg = std::make_unique( param.get(), selectedOptions, QList() ); QVERIFY( dlg->selectedOptions().isEmpty() ); QCOMPARE( dlg->mModel->rowCount(), 0 ); @@ -4558,7 +4558,7 @@ void TestProcessingGui::testBandWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "band" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "band" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -4682,7 +4682,7 @@ void TestProcessingGui::testMultipleInputWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "multilayer" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "multilayer" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -5428,7 +5428,7 @@ void TestProcessingGui::testEnumWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "enum" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "enum" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -5749,7 +5749,7 @@ void TestProcessingGui::testLayoutItemWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "layoutitem" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "layoutitem" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -5777,7 +5777,7 @@ void TestProcessingGui::testLayoutItemWrapper() void TestProcessingGui::testPointPanel() { - std::unique_ptr panel = std::make_unique( nullptr ); + auto panel = std::make_unique( nullptr ); QSignalSpy spy( panel.get(), &QgsProcessingPointPanel::changed ); panel->setValue( QgsPointXY( 100, 150 ), QgsCoordinateReferenceSystem() ); @@ -5960,7 +5960,7 @@ void TestProcessingGui::testPointWrapper() // config widget QgsProcessingContext context; QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "point" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "point" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -6072,7 +6072,7 @@ void TestProcessingGui::testGeometryWrapper() // config widget QgsProcessingContext context; QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "geometry" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "geometry" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -6200,7 +6200,7 @@ void TestProcessingGui::testExtentWrapper() // config widget QgsProcessingContext context; QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "extent" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "extent" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -6304,7 +6304,7 @@ void TestProcessingGui::testColorWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "color" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "color" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -6409,7 +6409,7 @@ void TestProcessingGui::testCoordinateOperationWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "coordinateoperation" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "coordinateoperation" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -6450,7 +6450,7 @@ void TestProcessingGui::mapLayerComboBox() // feature source param std::unique_ptr param( new QgsProcessingParameterFeatureSource( QStringLiteral( "param" ), QString() ) ); - std::unique_ptr combo = std::make_unique( param.get() ); + auto combo = std::make_unique( param.get() ); QSignalSpy spy( combo.get(), &QgsProcessingMapLayerComboBox::valueChanged ); QVERIFY( !combo->value().isValid() ); @@ -7156,7 +7156,7 @@ void TestProcessingGui::testMapLayerWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "layer" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "layer" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -7470,7 +7470,7 @@ void TestProcessingGui::testVectorLayerWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "vector" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "vector" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -7643,7 +7643,7 @@ void TestProcessingGui::testFeatureSourceWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "source" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "source" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -7820,7 +7820,7 @@ void TestProcessingGui::paramConfigWidget() { QgsProcessingContext context; QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr widget = std::make_unique( QStringLiteral( "string" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "string" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -7965,7 +7965,7 @@ void TestProcessingGui::testMapThemeWrapper() QgsProcessingParameterWidgetContext widgetContext; widgetContext.setProject( &p ); QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "maptheme" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "maptheme" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -8118,7 +8118,7 @@ void TestProcessingGui::testDateTimeWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "datetime" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "datetime" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -8243,7 +8243,7 @@ void TestProcessingGui::testProviderConnectionWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "providerconnection" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "providerconnection" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -8439,7 +8439,7 @@ void TestProcessingGui::testDatabaseSchemaWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "databaseschema" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "databaseschema" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -8676,7 +8676,7 @@ void TestProcessingGui::testDatabaseTableWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "databasetable" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "databasetable" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -8882,7 +8882,7 @@ void TestProcessingGui::testFieldMapWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "fields_mapping" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "fields_mapping" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -9085,7 +9085,7 @@ void TestProcessingGui::testAggregateWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "aggregates" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "aggregates" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !( def->flags() & Qgis::ProcessingParameterFlag::Optional ) ); // should default to mandatory @@ -10443,7 +10443,7 @@ void TestProcessingGui::testMeshDatasetWrapperLayerInProject() QgsProcessingContext context; context.setProject( &project ); QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr mapCanvas = std::make_unique(); + auto mapCanvas = std::make_unique(); widgetContext.setMapCanvas( mapCanvas.get() ); widgetContext.setProject( &project ); @@ -10679,7 +10679,7 @@ void TestProcessingGui::testMeshDatasetWrapperLayerOutsideProject() QgsProcessingContext context; context.setProject( &project ); QgsProcessingParameterWidgetContext widgetContext; - std::unique_ptr mapCanvas = std::make_unique(); + auto mapCanvas = std::make_unique(); widgetContext.setMapCanvas( mapCanvas.get() ); widgetContext.setProject( &project ); @@ -11251,7 +11251,7 @@ void TestProcessingGui::testPointCloudAttributeWrapper() // config widget QgsProcessingParameterWidgetContext widgetContext; QgsProcessingContext context; - std::unique_ptr widget = std::make_unique( QStringLiteral( "attribute" ), context, widgetContext ); + auto widget = std::make_unique( QStringLiteral( "attribute" ), context, widgetContext ); std::unique_ptr def( widget->createParameter( QStringLiteral( "param_name" ) ) ); QCOMPARE( def->name(), QStringLiteral( "param_name" ) ); QVERIFY( !def->defaultValue().isValid() ); diff --git a/tests/src/gui/testqgsattributeform.cpp b/tests/src/gui/testqgsattributeform.cpp index cfb4aeccc475..80a4c12f668f 100644 --- a/tests/src/gui/testqgsattributeform.cpp +++ b/tests/src/gui/testqgsattributeform.cpp @@ -1207,7 +1207,7 @@ void TestQgsAttributeForm::testMinimumWidth() ft.setAttribute( QStringLiteral( "col0" ), 0.0 ); QgsAttributeEditorContext context; context.setAttributeFormMode( QgsAttributeEditorContext::SingleEditMode ); - std::unique_ptr form = std::make_unique( &layer, QgsFeature(), context ); + auto form = std::make_unique( &layer, QgsFeature(), context ); form->setFeature( ft ); form->show(); // we don't want the larger width requirement of the search wrappers to be enforced when the attribute form diff --git a/tests/src/gui/testqgscategorizedrendererwidget.cpp b/tests/src/gui/testqgscategorizedrendererwidget.cpp index 21a595ae1ef2..7cf584885ab4 100644 --- a/tests/src/gui/testqgscategorizedrendererwidget.cpp +++ b/tests/src/gui/testqgscategorizedrendererwidget.cpp @@ -61,7 +61,7 @@ void TestQgsCategorizedRendererWidget::cleanup() void TestQgsCategorizedRendererWidget::testAddMissingCategories() { - std::unique_ptr vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); QgsFeature f; @@ -77,7 +77,7 @@ void TestQgsCategorizedRendererWidget::testAddMissingCategories() QgsCategorizedSymbolRenderer *renderer = new QgsCategorizedSymbolRenderer( QStringLiteral( "name" ) ); vl->setRenderer( renderer ); - std::unique_ptr widget = std::make_unique( vl.get(), nullptr, renderer ); + auto widget = std::make_unique( vl.get(), nullptr, renderer ); QVERIFY( static_cast( widget->renderer() )->categories().isEmpty() ); widget->addCategories(); @@ -122,7 +122,7 @@ void TestQgsCategorizedRendererWidget::merge() { // test merging categories - std::unique_ptr vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); QgsFeature f; @@ -140,7 +140,7 @@ void TestQgsCategorizedRendererWidget::merge() QgsCategorizedSymbolRenderer *renderer = new QgsCategorizedSymbolRenderer( QStringLiteral( "name" ) ); vl->setRenderer( renderer ); - std::unique_ptr widget = std::make_unique( vl.get(), nullptr, renderer ); + auto widget = std::make_unique( vl.get(), nullptr, renderer ); widget->addCategories(); QCOMPARE( static_cast( widget->renderer() )->categories().count(), 6 ); QCOMPARE( static_cast( widget->renderer() )->categories().at( 0 ).value().toString(), QStringLiteral( "a" ) ); @@ -266,7 +266,7 @@ void TestQgsCategorizedRendererWidget::merge() void TestQgsCategorizedRendererWidget::model() { - std::unique_ptr vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); + auto vl = std::make_unique( "Point?crs=EPSG:4326&field=idx:integer&field=name:string", QString(), QStringLiteral( "memory" ) ); QVERIFY( vl->isValid() ); QgsFeature f; @@ -289,7 +289,7 @@ void TestQgsCategorizedRendererWidget::model() vl->setRenderer( renderer ); - std::unique_ptr widget = std::make_unique( vl.get(), nullptr, renderer ); + auto widget = std::make_unique( vl.get(), nullptr, renderer ); QgsCategorizedSymbolRendererModel *model = widget->mModel; QCOMPARE( model->rowCount(), 3 ); QCOMPARE( model->data( model->index( 0, 1 ), Qt::DisplayRole ).toString(), QStringLiteral( "b" ) ); diff --git a/tests/src/gui/testqgsmapcanvas.cpp b/tests/src/gui/testqgsmapcanvas.cpp index e13befea6ddc..a8f626d93299 100644 --- a/tests/src/gui/testqgsmapcanvas.cpp +++ b/tests/src/gui/testqgsmapcanvas.cpp @@ -371,7 +371,7 @@ void TestQgsMapCanvas::testZoomByWheel() mCanvas->setWheelFactor( 2 ); //test zoom out - std::unique_ptr e = std::make_unique( QPoint( 0, 0 ), QPointF(), QPoint( 0, -QWheelEvent::DefaultDeltasPerStep ), QPoint( 0, -QWheelEvent::DefaultDeltasPerStep ), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false ); + auto e = std::make_unique( QPoint( 0, 0 ), QPointF(), QPoint( 0, -QWheelEvent::DefaultDeltasPerStep ), QPoint( 0, -QWheelEvent::DefaultDeltasPerStep ), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false ); mCanvas->wheelEvent( e.get() ); QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth * 2.0, 0.1 ); QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight * 2.0, 0.1 ); @@ -410,7 +410,7 @@ void TestQgsMapCanvas::testShiftZoom() // start by testing a tool with shift-zoom enabled mCanvas->setMapTool( &panTool ); - std::unique_ptr e = std::make_unique( QMouseEvent::MouseButtonPress, startPos, Qt::LeftButton, Qt::LeftButton, Qt::ShiftModifier ); + auto e = std::make_unique( QMouseEvent::MouseButtonPress, startPos, Qt::LeftButton, Qt::LeftButton, Qt::ShiftModifier ); mCanvas->mousePressEvent( e.get() ); e = std::make_unique( QMouseEvent::MouseMove, endPos, Qt::LeftButton, Qt::LeftButton, Qt::ShiftModifier ); mCanvas->mouseMoveEvent( e.get() ); @@ -475,8 +475,8 @@ class TestYesDropHandler : public QgsCustomDropHandler void TestQgsMapCanvas::testDragDrop() { // default drag, should not be accepted - std::unique_ptr data = std::make_unique(); - std::unique_ptr event = std::make_unique( QPoint( 10, 10 ), Qt::CopyAction, data.get(), Qt::LeftButton, Qt::NoModifier ); + auto data = std::make_unique(); + auto event = std::make_unique( QPoint( 10, 10 ), Qt::CopyAction, data.get(), Qt::LeftButton, Qt::NoModifier ); mCanvas->dragEnterEvent( event.get() ); QVERIFY( !event->isAccepted() ); @@ -507,7 +507,7 @@ void TestQgsMapCanvas::testDragDrop() // check drop event logic mCanvas->setCustomDropHandlers( QVector>() ); - std::unique_ptr dropEvent = std::make_unique( QPoint( 10, 10 ), Qt::CopyAction, data.get(), Qt::LeftButton, Qt::NoModifier ); + auto dropEvent = std::make_unique( QPoint( 10, 10 ), Qt::CopyAction, data.get(), Qt::LeftButton, Qt::NoModifier ); mCanvas->dropEvent( dropEvent.get() ); QVERIFY( !dropEvent->isAccepted() ); mCanvas->setCustomDropHandlers( QVector>() << &handler ); @@ -596,10 +596,10 @@ void TestQgsMapCanvas::testMapLayers() QVERIFY( vl1->isValid() ); QgsProject::instance()->addMapLayer( vl1 ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=halig:string&field=valig:string" ), QStringLiteral( "vl2" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=halig:string&field=valig:string" ), QStringLiteral( "vl2" ), QStringLiteral( "memory" ) ); QVERIFY( vl2->isValid() ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setLayers( { vl1, vl2.get() } ); QCOMPARE( canvas->layers(), QList( { vl1, vl2.get() } ) ); diff --git a/tests/src/gui/testqgsmaptooledit.cpp b/tests/src/gui/testqgsmaptooledit.cpp index edc444b4ac8e..5d3b58bd5374 100644 --- a/tests/src/gui/testqgsmaptooledit.cpp +++ b/tests/src/gui/testqgsmaptooledit.cpp @@ -100,13 +100,13 @@ void TestQgsMapToolEdit::checkLayers() QVERIFY( vl1->isValid() ); QgsProject::instance()->addMapLayer( vl1 ); - std::unique_ptr vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=halig:string&field=valig:string" ), QStringLiteral( "vl2" ), QStringLiteral( "memory" ) ); + auto vl2 = std::make_unique( QStringLiteral( "Point?crs=epsg:3946&field=halig:string&field=valig:string" ), QStringLiteral( "vl2" ), QStringLiteral( "memory" ) ); QVERIFY( vl2->isValid() ); - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setLayers( { vl1, vl2.get() } ); - std::unique_ptr tool = std::make_unique( canvas.get() ); + auto tool = std::make_unique( canvas.get() ); // retrieving layer by id should work for both layers from the project AND for freestanding layers QCOMPARE( tool->layer( vl1->id() ), vl1 ); diff --git a/tests/src/gui/testqgsmaskingwidget.cpp b/tests/src/gui/testqgsmaskingwidget.cpp index 92b4ff449f37..b8b5ddad84e8 100644 --- a/tests/src/gui/testqgsmaskingwidget.cpp +++ b/tests/src/gui/testqgsmaskingwidget.cpp @@ -102,7 +102,7 @@ void TestQgsMaskingWidget::testTreeWidget() QCOMPARE( maskLayer->masks().count(), 0 ); // update masking widget - std::unique_ptr mw = std::make_unique(); + auto mw = std::make_unique(); QElapsedTimer timer; timer.start(); mw->setLayer( linesWithLabels ); diff --git a/tests/src/gui/testqgsmeshlayerpropertiesdialog.cpp b/tests/src/gui/testqgsmeshlayerpropertiesdialog.cpp index adb8fd55b6b9..164c1c000e1d 100644 --- a/tests/src/gui/testqgsmeshlayerpropertiesdialog.cpp +++ b/tests/src/gui/testqgsmeshlayerpropertiesdialog.cpp @@ -85,7 +85,7 @@ void TestQgsMeshLayerPropertiesDialog::testInvalidLayer() void TestQgsMeshLayerPropertiesDialog::testCrs() { QgsMapCanvas mapCanvas; - std::unique_ptr dialog = std::make_unique( mpMeshLayer, &mapCanvas ); + auto dialog = std::make_unique( mpMeshLayer, &mapCanvas ); QCOMPARE( dialog->mCrsSelector->crs(), mpMeshLayer->crs() ); const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem::fromEpsgId( 27700 ); dialog->mCrsSelector->setCrs( crs ); diff --git a/tests/src/gui/testqgsrangewidgetwrapper.cpp b/tests/src/gui/testqgsrangewidgetwrapper.cpp index 0b29cf61b6fc..d3933355c99d 100644 --- a/tests/src/gui/testqgsrangewidgetwrapper.cpp +++ b/tests/src/gui/testqgsrangewidgetwrapper.cpp @@ -465,7 +465,7 @@ void TestQgsRangeWidgetWrapper::test_focus() void TestQgsRangeWidgetWrapper::testLongLong() { // test range widget with a long long field type - std::unique_ptr wrapper = std::make_unique( vl.get(), 4, nullptr, nullptr ); + auto wrapper = std::make_unique( vl.get(), 4, nullptr, nullptr ); // should use a double spin box, as a integer spin box does not have sufficient range QgsDoubleSpinBox *editor = qobject_cast( wrapper->createWidget( nullptr ) ); diff --git a/tests/src/gui/testqgsrubberband.cpp b/tests/src/gui/testqgsrubberband.cpp index 9205d416a1fb..4939c173b58e 100644 --- a/tests/src/gui/testqgsrubberband.cpp +++ b/tests/src/gui/testqgsrubberband.cpp @@ -120,7 +120,7 @@ void TestQgsRubberband::testAddSingleMultiGeometries() void TestQgsRubberband::pointGeometryAddPoints() { // point geometry - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); QgsRubberBand r1( canvas.get(), Qgis::GeometryType::Point ); QVERIFY( r1.asGeometry().isEmpty() ); r1.addPoint( QgsPointXY( 1, 2 ) ); @@ -138,7 +138,7 @@ void TestQgsRubberband::pointGeometryAddPoints() void TestQgsRubberband::pointGeometrySetGeometry() { // point geometry, set using setToGeometry - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); QgsRubberBand r1( canvas.get(), Qgis::GeometryType::Point ); QVERIFY( r1.asGeometry().isEmpty() ); r1.setToGeometry( QgsGeometry::fromPointXY( QgsPointXY( 1, 2 ) ) ); @@ -160,7 +160,7 @@ void TestQgsRubberband::pointGeometrySetGeometry() void TestQgsRubberband::lineGeometryAddPoints() { - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); QgsRubberBand r1( canvas.get(), Qgis::GeometryType::Line ); QVERIFY( r1.asGeometry().isEmpty() ); r1.addPoint( QgsPointXY( 1, 2 ) ); @@ -177,7 +177,7 @@ void TestQgsRubberband::lineGeometryAddPoints() void TestQgsRubberband::copyPointsFrom() { - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); QgsRubberBand r1( canvas.get(), Qgis::GeometryType::Point ); r1.addPoint( QgsPointXY( 1, 2 ) ); r1.addPoint( QgsPointXY( 3, 4 ) ); @@ -304,7 +304,7 @@ void TestQgsRubberband::testClose() void TestQgsRubberband::testLineSymbolRender() { - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) ) ); canvas->setFrameStyle( 0 ); canvas->resize( 600, 400 ); @@ -340,7 +340,7 @@ void TestQgsRubberband::testLineSymbolRender() void TestQgsRubberband::testFillSymbolRender() { - std::unique_ptr canvas = std::make_unique(); + auto canvas = std::make_unique(); canvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) ) ); canvas->setFrameStyle( 0 ); canvas->resize( 600, 400 ); diff --git a/tests/src/gui/testqgstableeditor.cpp b/tests/src/gui/testqgstableeditor.cpp index ea71d1263f9c..b5eb9288b238 100644 --- a/tests/src/gui/testqgstableeditor.cpp +++ b/tests/src/gui/testqgstableeditor.cpp @@ -76,7 +76,7 @@ void TestQgsTableEditor::testData() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -127,7 +127,7 @@ void TestQgsTableEditor::insertRowsBelow() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -237,7 +237,7 @@ void TestQgsTableEditor::insertRowsAbove() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -347,7 +347,7 @@ void TestQgsTableEditor::insertColumnsBefore() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -429,7 +429,7 @@ void TestQgsTableEditor::insertColumnsAfter() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -511,7 +511,7 @@ void TestQgsTableEditor::deleteRows() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); QgsTableCell c2( 76 ); @@ -574,7 +574,7 @@ void TestQgsTableEditor::deleteColumns() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); QgsTableCell c2( 76 ); @@ -741,7 +741,7 @@ void TestQgsTableEditor::foregroundColor() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -806,7 +806,7 @@ void TestQgsTableEditor::backgroundColor() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -869,7 +869,7 @@ void TestQgsTableEditor::alignment() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -937,7 +937,7 @@ void TestQgsTableEditor::properties() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); c3.setNumericFormat( format.release() ); @@ -1045,7 +1045,7 @@ void TestQgsTableEditor::numericFormat() const QSignalSpy spy( &w, &QgsTableEditorWidget::tableChanged ); QgsTableCell c3; c3.setContent( 87 ); - std::unique_ptr format = std::make_unique(); + auto format = std::make_unique(); format->setNumberDecimalPlaces( 2 ); format->setPrefix( QStringLiteral( "$" ) ); QgsTableCell c2( 76 ); diff --git a/tests/src/gui/testqgsvaluemapwidgetwrapper.cpp b/tests/src/gui/testqgsvaluemapwidgetwrapper.cpp index 366c7c71f4c5..03b570a1fefc 100644 --- a/tests/src/gui/testqgsvaluemapwidgetwrapper.cpp +++ b/tests/src/gui/testqgsvaluemapwidgetwrapper.cpp @@ -76,7 +76,7 @@ void TestQgsValueMapWidgetWrapper::testPopulateComboBox() config.insert( QStringLiteral( "map" ), valueList ); - std::unique_ptr combo = std::make_unique(); + auto combo = std::make_unique(); // with nulls QgsValueMapConfigDlg::populateComboBox( combo.get(), config, false ); diff --git a/tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp b/tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp index 57583fab9ba7..a8d25e2d2f4d 100644 --- a/tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp +++ b/tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp @@ -1885,14 +1885,14 @@ void TestQgsValueRelationWidgetWrapper::testGroup() void TestQgsValueRelationWidgetWrapper::testMultiEditMode() { - std::unique_ptr people = std::make_unique( QStringLiteral( "None?field=firstname:string&field=fullname:string" ), QStringLiteral( "people" ), QStringLiteral( "memory" ) ); + auto people = std::make_unique( QStringLiteral( "None?field=firstname:string&field=fullname:string" ), QStringLiteral( "people" ), QStringLiteral( "memory" ) ); QgsFeature ft( people->dataProvider()->fields(), 1 ); ft.setAttribute( QStringLiteral( "firstname" ), QStringLiteral( "Jhon" ) ); ft.setAttribute( QStringLiteral( "fullname" ), QStringLiteral( "Jhon Carpenter" ) ); people->dataProvider()->addFeature( ft ); - std::unique_ptr famous = std::make_unique( QStringLiteral( "None?field=name:string" ), QStringLiteral( "famous" ), QStringLiteral( "memory" ) ); + auto famous = std::make_unique( QStringLiteral( "None?field=name:string" ), QStringLiteral( "famous" ), QStringLiteral( "memory" ) ); const QStringList famousNames { QStringLiteral( "Jhon Carpenter" ), QStringLiteral( "Jhon F. Kennedy" ), QStringLiteral( "Jhon Lennon" ), QStringLiteral( "Paul Mc Cartney" ) }; for ( const QString &name : famousNames ) diff --git a/tests/src/providers/grass/testqgsgrassprovider.cpp b/tests/src/providers/grass/testqgsgrassprovider.cpp index b18ec149c925..597fb60410da 100644 --- a/tests/src/providers/grass/testqgsgrassprovider.cpp +++ b/tests/src/providers/grass/testqgsgrassprovider.cpp @@ -487,7 +487,7 @@ void TestQgsGrassProvider::vectorLayers() void TestQgsGrassProvider::invalidLayer() { - std::unique_ptr brokenLayer = std::make_unique( QStringLiteral( "/not/valid" ), QStringLiteral( "test" ), QStringLiteral( "grass" ) ); + auto brokenLayer = std::make_unique( QStringLiteral( "/not/valid" ), QStringLiteral( "test" ), QStringLiteral( "grass" ) ); QVERIFY( !brokenLayer->isValid() ); QgsVectorDataProvider *provider = brokenLayer->dataProvider(); QVERIFY( provider ); diff --git a/tests/src/providers/testqgscopcprovider.cpp b/tests/src/providers/testqgscopcprovider.cpp index c9ae675825ed..de52c770ad3f 100644 --- a/tests/src/providers/testqgscopcprovider.cpp +++ b/tests/src/providers/testqgscopcprovider.cpp @@ -216,7 +216,7 @@ void TestQgsCopcProvider::querySublayers() void TestQgsCopcProvider::brokenPath() { // test loading a bad layer URI - std::unique_ptr layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( !layer->isValid() ); } @@ -252,7 +252,7 @@ void TestQgsCopcProvider::validLayer() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QCOMPARE( layer->crs().authid(), QStringLiteral( "EPSG:28356" ) ); @@ -274,7 +274,7 @@ void TestQgsCopcProvider::validLayerWithCopcHierarchy() { const QString dataPath = copyTestData( QStringLiteral( "point_clouds/copc/lone-star.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QGSCOMPARENEAR( layer->extent().xMinimum(), 515368.6022, 0.1 ); @@ -292,7 +292,7 @@ void TestQgsCopcProvider::attributes() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); const QgsPointCloudAttributeCollection attributes = layer->attributes(); @@ -345,7 +345,7 @@ void TestQgsCopcProvider::calculateZRange() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/sunshine-coast.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QgsDoubleRange range = layer->elevationProperties()->calculateZRange( layer.get() ); @@ -373,7 +373,7 @@ void TestQgsCopcProvider::testIdentify() const QString datasetPath = copyTestData( srcDatasetPath ); - std::unique_ptr layer = std::make_unique( datasetPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( datasetPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); @@ -567,7 +567,7 @@ void TestQgsCopcProvider::testExtraBytesAttributesValues() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/extrabytes-dataset.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); { const float maxErrorInMapCoords = 0.0015207174f; @@ -650,7 +650,7 @@ void TestQgsCopcProvider::testClassFlagsValues() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/extrabytes-dataset.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); { const float maxErrorInMapCoords = 0.0015207174f; @@ -822,7 +822,7 @@ void TestQgsCopcProvider::testPointCloudIndex() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/lone-star.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QgsPointCloudIndex index = layer->dataProvider()->index(); @@ -878,7 +878,7 @@ void TestQgsCopcProvider::testStatsCalculator() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/extrabytes-dataset.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QgsPointCloudIndex index = layer->dataProvider()->index(); QgsPointCloudStatsCalculator calculator( index ); @@ -1127,7 +1127,7 @@ void TestQgsCopcProvider::testSaveLoadStats() const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/lone-star.copc.laz" ) ); { - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QVERIFY( layer->dataProvider() && layer->dataProvider()->isValid() && layer->dataProvider()->index() ); @@ -1138,7 +1138,7 @@ void TestQgsCopcProvider::testSaveLoadStats() } { - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QVERIFY( layer->dataProvider() && layer->dataProvider()->isValid() && layer->dataProvider()->index() ); @@ -1155,7 +1155,7 @@ void TestQgsCopcProvider::testPointCloudRequest() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/lone-star.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); QgsPointCloudIndex index = layer->dataProvider()->index(); @@ -1225,7 +1225,7 @@ void TestQgsCopcProvider::testPointCloudRequestIgnoreFilter() { const QString dataPath = copyTestData( QStringLiteral( "/point_clouds/copc/lone-star.copc.laz" ) ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "copc" ) ); QVERIFY( layer->isValid() ); layer->setSubsetString( QStringLiteral( "Intensity < 1000" ) ); diff --git a/tests/src/providers/testqgseptprovider.cpp b/tests/src/providers/testqgseptprovider.cpp index ebf527653d87..bcc44579ac9f 100644 --- a/tests/src/providers/testqgseptprovider.cpp +++ b/tests/src/providers/testqgseptprovider.cpp @@ -208,7 +208,7 @@ void TestQgsEptProvider::querySublayers() void TestQgsEptProvider::brokenPath() { // test loading a bad layer URI - std::unique_ptr layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( !layer->isValid() ); } @@ -252,7 +252,7 @@ void TestQgsEptProvider::validLayer() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/sunshine-coast" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QCOMPARE( layer->crs().authid(), QStringLiteral( "EPSG:28356" ) ); @@ -274,7 +274,7 @@ void TestQgsEptProvider::validLayerWithEptHierarchy() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/lone-star-laszip" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QGSCOMPARENEAR( layer->extent().xMinimum(), 515368.000000, 0.1 ); @@ -292,7 +292,7 @@ void TestQgsEptProvider::attributes() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/sunshine-coast" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); const QgsPointCloudAttributeCollection attributes = layer->attributes(); @@ -335,7 +335,7 @@ void TestQgsEptProvider::calculateZRange() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/sunshine-coast" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QgsDoubleRange range = layer->elevationProperties()->calculateZRange( layer.get() ); @@ -364,7 +364,7 @@ void TestQgsEptProvider::testIdentify() const QString path = copyTestDataDirectory( datasetPath ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); // identify 1 point click (rectangular point shape) { @@ -548,7 +548,7 @@ void TestQgsEptProvider::testExtraBytesAttributesValues() const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/extrabytes-dataset" ) ); QString dataPath = path + QStringLiteral( "/ept.json" ); - std::unique_ptr layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( dataPath, QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); { const float maxErrorInMapCoords = 0.0015207174f; @@ -625,7 +625,7 @@ void TestQgsEptProvider::testPointCloudIndex() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/lone-star-laszip" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QgsPointCloudIndex index = layer->dataProvider()->index(); @@ -682,7 +682,7 @@ void TestQgsEptProvider::testPointCloudRequest() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/lone-star-laszip" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); QgsPointCloudIndex index = layer->dataProvider()->index(); @@ -752,7 +752,7 @@ void TestQgsEptProvider::testPointCloudRequestIgnoreFilter() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/lone-star-laszip" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QVERIFY( layer->isValid() ); layer->setSubsetString( QStringLiteral( "Intensity < 1000" ) ); @@ -800,7 +800,7 @@ void TestQgsEptProvider::testStatsCalculator() { const QString path = copyTestDataDirectory( QStringLiteral( "point_clouds/ept/extrabytes-dataset" ) ); - std::unique_ptr layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); + auto layer = std::make_unique( path + QStringLiteral( "/ept.json" ), QStringLiteral( "layer" ), QStringLiteral( "ept" ) ); QgsPointCloudIndex index = layer->dataProvider()->index(); QgsPointCloudStatsCalculator calculator( index ); diff --git a/tests/src/providers/testqgspdalprovider.cpp b/tests/src/providers/testqgspdalprovider.cpp index f3d48b39dc7e..dfd01d1de503 100644 --- a/tests/src/providers/testqgspdalprovider.cpp +++ b/tests/src/providers/testqgspdalprovider.cpp @@ -191,7 +191,7 @@ void TestQgsPdalProvider::querySublayers() void TestQgsPdalProvider::brokenPath() { // test loading a bad layer URI - std::unique_ptr layer = std::make_unique( + auto layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "pdal" ) @@ -204,7 +204,7 @@ void TestQgsPdalProvider::validLayer() QgsPointCloudLayer::LayerOptions options; options.skipIndexGeneration = true; - std::unique_ptr layer = std::make_unique( + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/las/cloud.las" ), QStringLiteral( "layer" ), QStringLiteral( "pdal" ), diff --git a/tests/src/providers/testqgsvirtualpointcloudprovider.cpp b/tests/src/providers/testqgsvirtualpointcloudprovider.cpp index 1d49725bd310..5b65842a9337 100644 --- a/tests/src/providers/testqgsvirtualpointcloudprovider.cpp +++ b/tests/src/providers/testqgsvirtualpointcloudprovider.cpp @@ -205,13 +205,13 @@ void TestQgsVirtualPointCloudProvider::querySublayers() void TestQgsVirtualPointCloudProvider::brokenPath() { // test loading a bad layer URI - std::unique_ptr layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); + auto layer = std::make_unique( QStringLiteral( "not valid" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); QVERIFY( !layer->isValid() ); } void TestQgsVirtualPointCloudProvider::validLayer() { - std::unique_ptr layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); QVERIFY( layer->isValid() ); QCOMPARE( layer->crs().authid(), QStringLiteral( "EPSG:5514" ) ); @@ -228,7 +228,7 @@ void TestQgsVirtualPointCloudProvider::validLayer() void TestQgsVirtualPointCloudProvider::attributes() { - std::unique_ptr layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); QVERIFY( layer->isValid() ); const QgsPointCloudAttributeCollection attributes = layer->attributes(); @@ -269,7 +269,7 @@ void TestQgsVirtualPointCloudProvider::attributes() void TestQgsVirtualPointCloudProvider::testLazyLoading() { - std::unique_ptr layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "point_clouds/virtual/tiles.vpc" ), QStringLiteral( "layer" ), QStringLiteral( "vpc" ) ); QVERIFY( layer->isValid() ); QgsPointCloudIndex index = layer->dataProvider()->index(); diff --git a/tests/src/providers/testqgsvirtualrasterprovider.cpp b/tests/src/providers/testqgsvirtualrasterprovider.cpp index 592db283d8c5..718d13c549c1 100644 --- a/tests/src/providers/testqgsvirtualrasterprovider.cpp +++ b/tests/src/providers/testqgsvirtualrasterprovider.cpp @@ -105,7 +105,7 @@ void TestQgsVirtualRasterProvider::validLayer() { QgsRasterLayer::LayerOptions options; - std::unique_ptr layer = std::make_unique( + auto layer = std::make_unique( mTestDataDir + QStringLiteral( "raster/dem.tif" ), QStringLiteral( "layer" ), QStringLiteral( "virtualraster" ), @@ -195,7 +195,7 @@ void TestQgsVirtualRasterProvider::testConstructorWrong() //Giving an invalid uri, with more raster referencies compared to the raster.ref that are present in the formula QString str1 = QStringLiteral( "?crs=EPSG:4326&extent=18.6662979442000001,45.7767014376000034,18.7035979441999984,45.8117014376000000&width=373&height=350&formula=\"dem@1\" + 200&dem:provider=gdal&landsat:provider=gdal" ); QString uri = QString( "%1&%2&%3" ).arg( str1, QStringLiteral( "dem:uri=" ) % mTestDataDir % QStringLiteral( "raster/dem.tif" ), QStringLiteral( "landsat:uri=" ) % mTestDataDir % QStringLiteral( "landsat.tif" ) ); - std::unique_ptr layer = std::make_unique( uri, QStringLiteral( "layer" ), QStringLiteral( "virtualraster" ) ); + auto layer = std::make_unique( uri, QStringLiteral( "layer" ), QStringLiteral( "virtualraster" ) ); QVERIFY( !layer->isValid() ); } @@ -204,7 +204,7 @@ void TestQgsVirtualRasterProvider::testConstructor() { QString str1 = QStringLiteral( "?crs=EPSG:4326&extent=18.6662979442000001,45.7767014376000034,18.7035979441999984,45.8117014376000000&width=373&height=350&formula=\"dem@1\" + 200&dem:provider=gdal" ); QString uri1 = QString( "%1&%2" ).arg( str1, QStringLiteral( "dem:uri=" ) % mTestDataDir % QStringLiteral( "raster/dem.tif" ) ); - std::unique_ptr layer_1 = std::make_unique( uri1, QStringLiteral( "layer_1" ), QStringLiteral( "virtualraster" ) ); + auto layer_1 = std::make_unique( uri1, QStringLiteral( "layer_1" ), QStringLiteral( "virtualraster" ) ); QVERIFY( layer_1->dataProvider()->isValid() ); QVERIFY( layer_1->isValid() ); @@ -219,7 +219,7 @@ void TestQgsVirtualRasterProvider::testConstructor() const QString landsatPath = dir.filePath( QStringLiteral( "landsat.tif" ) ); QVERIFY( QFile::copy( mTestDataDir + "landsat.tif", landsatPath ) ); // remove nodata values from layer for consistent test results - std::unique_ptr landsat = std::make_unique( landsatPath, QString(), QStringLiteral( "gdal" ) ); + auto landsat = std::make_unique( landsatPath, QString(), QStringLiteral( "gdal" ) ); QVERIFY( landsat->isValid() ); landsat->dataProvider()->setNoDataValue( 1, -999999 ); landsat->dataProvider()->setNoDataValue( 2, -999999 ); @@ -227,7 +227,7 @@ void TestQgsVirtualRasterProvider::testConstructor() QString str2 = QStringLiteral( "?crs=EPSG:32633&extent=781662.375,3339523.125,793062.375,3350923.125&width=200&height=200&formula=\"landsat@1\" + \"landsat@2\"&landsat:provider=gdal" ); QString uri2 = QString( "%1&%2" ).arg( str2, QStringLiteral( "landsat:uri=" ) % landsatPath ); - std::unique_ptr layer_2 = std::make_unique( uri2, QStringLiteral( "layer_2" ), QStringLiteral( "virtualraster" ) ); + auto layer_2 = std::make_unique( uri2, QStringLiteral( "layer_2" ), QStringLiteral( "virtualraster" ) ); QVERIFY( layer_2->isValid() ); QVERIFY( layer_2->dataProvider()->isValid() ); @@ -238,7 +238,7 @@ void TestQgsVirtualRasterProvider::testConstructor() //use wrong formula QString str3 = QStringLiteral( "?crs=EPSG:32633&extent=781662.375,3339523.125,793062.375,3350923.125&width=200&height=200&formula=\"landsat@1\" xxxxxx+ \"landsat@2\"&landsat:provider=gdal" ); QString uri3 = QString( "%1&%2" ).arg( str3, QStringLiteral( "landsat:uri=" ) % landsatPath ); - std::unique_ptr layer_3 = std::make_unique( uri3, QStringLiteral( "layer_3" ), QStringLiteral( "virtualraster" ) ); + auto layer_3 = std::make_unique( uri3, QStringLiteral( "layer_3" ), QStringLiteral( "virtualraster" ) ); QVERIFY( !layer_3->isValid() ); } @@ -267,7 +267,7 @@ void TestQgsVirtualRasterProvider::testSecondGenerationVirtualRaster() // creation of the "first generation" virtual raster, meaning a virtual raster that comes directly from a file QString str = QStringLiteral( "?crs=EPSG:4326&extent=18.6662979442000001,45.7767014376000034,18.7035979441999984,45.8117014376000000&width=373&height=350&formula=\"dem@1\" + 200&dem:provider=gdal" ); QString uri = QString( "%1&%2" ).arg( str, QStringLiteral( "dem:uri=" ) % mTestDataDir % QStringLiteral( "raster/dem.tif" ) ); - std::unique_ptr layerFirst = std::make_unique( uri, QStringLiteral( "firstGenerationLayer" ), QStringLiteral( "virtualraster" ) ); + auto layerFirst = std::make_unique( uri, QStringLiteral( "firstGenerationLayer" ), QStringLiteral( "virtualraster" ) ); QVERIFY( layerFirst->dataProvider()->isValid() ); QVERIFY( layerFirst->isValid() ); @@ -287,7 +287,7 @@ void TestQgsVirtualRasterProvider::testSecondGenerationVirtualRaster() params.rInputLayers.append( rasterParams ); QString uriSecond = QgsVirtualRasterProvider::encodeVirtualRasterProviderUri( params ); - std::unique_ptr layerSecond = std::make_unique( uriSecond, QStringLiteral( "SecondGenerationLayer" ), QStringLiteral( "virtualraster" ) ); + auto layerSecond = std::make_unique( uriSecond, QStringLiteral( "SecondGenerationLayer" ), QStringLiteral( "virtualraster" ) ); QVERIFY( layerSecond->dataProvider()->isValid() ); QVERIFY( layerSecond->isValid() ); @@ -312,7 +312,7 @@ void TestQgsVirtualRasterProvider::testNoData() QString uri = QString( "%1&%2" ).arg( str, QStringLiteral( "nodata:uri=" ) % mTestDataDir % QStringLiteral( "raster/no_data.tif" ) ); - std::unique_ptr layerNoData = std::make_unique( uri, QStringLiteral( "no-data" ), QStringLiteral( "virtualraster" ) ); + auto layerNoData = std::make_unique( uri, QStringLiteral( "no-data" ), QStringLiteral( "virtualraster" ) ); QVERIFY( layerNoData->dataProvider()->isValid() ); QVERIFY( layerNoData->isValid() ); diff --git a/tests/src/providers/testqgswmsprovider.cpp b/tests/src/providers/testqgswmsprovider.cpp index d159ee26b638..009603f9d405 100644 --- a/tests/src/providers/testqgswmsprovider.cpp +++ b/tests/src/providers/testqgswmsprovider.cpp @@ -569,7 +569,7 @@ void TestQgsWmsProvider::testResampling() QVERIFY( layer.dataProvider()->setZoomedInResamplingMethod( Qgis::RasterResamplingMethod::Cubic ) ); QVERIFY( layer.dataProvider()->setZoomedOutResamplingMethod( Qgis::RasterResamplingMethod::Cubic ) ); layer.setResamplingStage( Qgis::RasterResamplingStage::Provider ); - std::unique_ptr hillshade = std::make_unique( layer.dataProvider(), 1, 315, 45 ); + auto hillshade = std::make_unique( layer.dataProvider(), 1, 315, 45 ); hillshade->setZFactor( 0.0005 ); layer.setRenderer( hillshade.release() );