mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-04 00:06:46 -05:00
[sextante] fixed problem when exporting non-file based data to be used by 3rd party apps
This commit is contained in:
parent
cf8f8c3c35
commit
06d20455f5
@ -49,12 +49,18 @@ class LayerExporter():
|
||||
It also export to a new file if the original one contains non-ascii characters'''
|
||||
settings = QSettings()
|
||||
systemEncoding = settings.value( "/UI/encoding", "System" ).toString()
|
||||
|
||||
filename = os.path.basename(unicode(layer.source()))
|
||||
idx = filename.rfind(".")
|
||||
if idx != -1:
|
||||
filename = filename[:idx]
|
||||
|
||||
filename = str(layer.name())
|
||||
validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:"
|
||||
filename = ''.join(c for c in filename if c in validChars)
|
||||
if len(filename) == 0:
|
||||
filename = "layer"
|
||||
output = SextanteUtils.getTempFilenameInTempFolder(filename + ".shp")
|
||||
#output = SextanteUtils.getTempFilename("shp")
|
||||
provider = layer.dataProvider()
|
||||
useSelection = SextanteConfig.getSetting(SextanteConfig.USE_SELECTED)
|
||||
if useSelection and layer.selectedFeatureCount() != 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user