Skip to content

Commit

Permalink
Fix creation of feature sinks when using windows style paths
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 22, 2017
1 parent 9d8118c commit d8c44cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/processing/qgsprocessingutils.cpp
Expand Up @@ -229,7 +229,7 @@ QString QgsProcessingUtils::normalizeLayerSource( const QString &source )

void parseDestinationString( QString &destination, QString &providerKey, QString &uri, QString &format, QMap<QString, QVariant> &options )
{
QRegularExpression splitRx( "^(.*?):(.*)$" );
QRegularExpression splitRx( "^(.{3,}):(.*)$" );
QRegularExpressionMatch match = splitRx.match( destination );
if ( match.hasMatch() )
{
Expand Down
5 changes: 5 additions & 0 deletions tests/src/core/testqgsprocessing.cpp
Expand Up @@ -1135,6 +1135,11 @@ void TestQgsProcessing::createFeatureSink()
QCOMPARE( layer->featureCount(), 1L );
delete layer;
layer = nullptr;

//windows style path
destination = "d:\\temp\\create_feature_sink.tab";
sink.reset( QgsProcessingUtils::createFeatureSink( destination, context, fields, QgsWkbTypes::Polygon, QgsCoordinateReferenceSystem::fromEpsgId( 3111 ) ) );
QVERIFY( sink.get() );
}

void TestQgsProcessing::parameters()
Expand Down

0 comments on commit d8c44cb

Please sign in to comment.