Skip to content

Commit e4f1d5c

Browse files
committedMay 13, 2020
fix typo in the short help and improve field equality expression
1 parent 3a51f93 commit e4f1d5c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ QString QgsSplitVectorLayerAlgorithm::groupId() const
4747

4848
QString QgsSplitVectorLayerAlgorithm::shortHelpString() const
4949
{
50-
return QObject::tr( "Splits input vector layer into multiple layers by specified unique ID field."
51-
"Each of the layers created in the output folder contains all features from "
52-
"the input layer with the same value for the specified attribute. The number "
53-
":of files generated is equal to the number of different values found for the "
54-
"specified attribute." );
50+
return QObject::tr( "Splits input vector layer into multiple layers by specified unique ID field." )
51+
+ QStringLiteral( "\n\n" )
52+
+ QObject::tr( "Each of the layers created in the output folder contains all features from "
53+
"the input layer with the same value for the specified attribute. The number "
54+
"of files generated is equal to the number of different values found for the "
55+
"specified attribute." );
5556
}
5657

5758
QgsSplitVectorLayerAlgorithm *QgsSplitVectorLayerAlgorithm::createInstance() const
@@ -107,7 +108,7 @@ QVariantMap QgsSplitVectorLayerAlgorithm::processAlgorithm( const QVariantMap &p
107108
feedback->pushInfo( QObject::tr( "Creating layer: %1" ).arg( fileName ) );
108109

109110
sink.reset( QgsProcessingUtils::createFeatureSink( fileName, context, fields, geometryType, crs ) );
110-
QString expr = QStringLiteral( "%1 = %2" ).arg( QgsExpression::quotedColumnRef( fieldName ), QgsExpression::quotedValue( *it ) );
111+
QString expr = QgsExpression::createFieldEqualityExpression( fieldName, *it );
111112
QgsFeatureIterator features = source->getFeatures( QgsFeatureRequest().setFilterExpression( expr ) );
112113
while ( features.nextFeature( feat ) )
113114
{

0 commit comments

Comments
 (0)
Please sign in to comment.