File tree 1 file changed +8
-0
lines changed
python/plugins/processing/tools
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 47
47
from processing .algs .gdal .GdalUtils import GdalUtils
48
48
from processing .tools .system import (getTempFilenameInTempFolder ,
49
49
getTempFilename ,
50
+ removeInvalidChars
50
51
isWindows )
51
52
52
53
ALL_TYPES = [- 1 ]
@@ -311,6 +312,13 @@ def exportVectorLayer(layer, supported=None):
311
312
systemEncoding = settings .value ('/UI/encoding' , 'System' )
312
313
313
314
output = getTempFilename ('shp' )
315
+ basename = removeInvalidChars (os .path .basename (layer .source ()))
316
+ if basename :
317
+ if not basename .endswith ("shp" ):
318
+ basename = basename + ".shp"
319
+ output = getTempFilenameInTempFolder (basename )
320
+ else :
321
+ output = getTempFilename ("shp" )
314
322
provider = layer .dataProvider ()
315
323
useSelection = ProcessingConfig .getSetting (ProcessingConfig .USE_SELECTED )
316
324
if useSelection and layer .selectedFeatureCount () != 0 :
You can’t perform that action at this time.
0 commit comments