Skip to content
Permalink
Browse files

[processing] use original filename when possible when exporting vecto…

…r layer

Conflicts:
	python/plugins/processing/tools/dataobjects.py
  • Loading branch information
volaya committed Oct 5, 2016
1 parent c65cc92 commit a968fa3dea1222231f44e8ec5149c95318dc5fe0
Showing with 8 additions and 0 deletions.
  1. +8 −0 python/plugins/processing/tools/dataobjects.py
@@ -47,6 +47,7 @@
from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import (getTempFilenameInTempFolder,
getTempFilename,
removeInvalidChars
isWindows)

ALL_TYPES = [-1]
@@ -311,6 +312,13 @@ def exportVectorLayer(layer, supported=None):
systemEncoding = settings.value('/UI/encoding', 'System')

output = getTempFilename('shp')
basename = removeInvalidChars(os.path.basename(layer.source()))
if basename:
if not basename.endswith("shp"):
basename = basename + ".shp"
output = getTempFilenameInTempFolder(basename)
else:
output = getTempFilename("shp")
provider = layer.dataProvider()
useSelection = ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED)
if useSelection and layer.selectedFeatureCount() != 0:

0 comments on commit a968fa3

Please sign in to comment.
You can’t perform that action at this time.