From 5c40975fe7a255733157a897af3ab1eb485f9755 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 15 Feb 2018 16:43:21 +1000 Subject: [PATCH] [processing] Don't replace " with ' when handling layer paths Since netcdf, and possibly other gdal drivers, use layer uris of the format NETCDF:"/tmp/test.nc":var1 we can't safely remove or reformat these quotations. --- src/core/processing/qgsprocessingutils.cpp | 1 - tests/src/analysis/testqgsprocessing.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/processing/qgsprocessingutils.cpp b/src/core/processing/qgsprocessingutils.cpp index 936ede4efcd..262426df3e4 100644 --- a/src/core/processing/qgsprocessingutils.cpp +++ b/src/core/processing/qgsprocessingutils.cpp @@ -295,7 +295,6 @@ QString QgsProcessingUtils::normalizeLayerSource( const QString &source ) { QString normalized = source; normalized.replace( '\\', '/' ); - normalized.replace( '"', QLatin1String( "'" ) ); return normalized.trimmed(); } diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index d622e378b63..2a6af37537f 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -682,7 +682,7 @@ void TestQgsProcessing::compatibleLayers() void TestQgsProcessing::normalizeLayerSource() { QCOMPARE( QgsProcessingUtils::normalizeLayerSource( "data\\layers\\test.shp" ), QString( "data/layers/test.shp" ) ); - QCOMPARE( QgsProcessingUtils::normalizeLayerSource( "data\\layers \"new\"\\test.shp" ), QString( "data/layers 'new'/test.shp" ) ); + QCOMPARE( QgsProcessingUtils::normalizeLayerSource( "data\\layers \"new\"\\test.shp" ), QString( "data/layers \"new\"/test.shp" ) ); } void TestQgsProcessing::context()