Skip to content

Commit 4166a3e

Browse files
committedOct 24, 2016
Fix most clazy qstring-unneeded-heap-allocations warnings
By flipping string literals to QStringLiteral/QLatin1String see https://woboq.com/blog/qstringliteral.html
1 parent f6a344c commit 4166a3e

File tree

1,041 files changed

+25464
-25413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,041 files changed

+25464
-25413
lines changed
 

‎src/analysis/interpolation/DualEdgeTriangulation.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3090,12 +3090,12 @@ bool DualEdgeTriangulation::saveAsShapefile( const QString& fileName ) const
30903090
QString shapeFileName = fileName;
30913091

30923092
QgsFields fields;
3093-
fields.append( QgsField( "type", QVariant::String, "String" ) );
3093+
fields.append( QgsField( QStringLiteral( "type" ), QVariant::String, QStringLiteral( "String" ) ) );
30943094

30953095
// add the extension if not present
3096-
if ( shapeFileName.indexOf( ".shp" ) == -1 )
3096+
if ( shapeFileName.indexOf( QLatin1String( ".shp" ) ) == -1 )
30973097
{
3098-
shapeFileName += ".shp";
3098+
shapeFileName += QLatin1String( ".shp" );
30993099
}
31003100

31013101
//delete already existing files
@@ -3107,7 +3107,7 @@ bool DualEdgeTriangulation::saveAsShapefile( const QString& fileName ) const
31073107
}
31083108
}
31093109

3110-
QgsVectorFileWriter writer( shapeFileName, "Utf-8", fields, QgsWkbTypes::LineString );
3110+
QgsVectorFileWriter writer( shapeFileName, QStringLiteral( "Utf-8" ), fields, QgsWkbTypes::LineString );
31113111
if ( writer.hasError() != QgsVectorFileWriter::NoError )
31123112
{
31133113
return false;
@@ -3147,11 +3147,11 @@ bool DualEdgeTriangulation::saveAsShapefile( const QString& fileName ) const
31473147
{
31483148
if ( currentEdge->getBreak() )
31493149
{
3150-
attributeString = "break line";
3150+
attributeString = QStringLiteral( "break line" );
31513151
}
31523152
else
31533153
{
3154-
attributeString = "structure line";
3154+
attributeString = QStringLiteral( "structure line" );
31553155
}
31563156
}
31573157
edgeLineFeature.setAttribute( 0, attributeString );

‎src/analysis/network/qgsgraphbuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
3939
/**
4040
* default constructor
4141
*/
42-
QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool otfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" );
42+
QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool otfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = QStringLiteral( "WGS84" ) );
4343

4444
~QgsGraphBuilder();
4545

0 commit comments

Comments
 (0)
Please sign in to comment.