[processing] don't use temp folder for default output folder

This commit is contained in:
volaya 2015-11-05 09:16:00 +01:00
parent 54bdcefc11
commit 4692eb526b
2 changed files with 9 additions and 3 deletions

View File

@ -29,13 +29,13 @@ import os
from PyQt4.QtCore import QPyNullVariant, QCoreApplication, QSettings
from PyQt4.QtGui import QIcon
from processing.tools.system import tempFolder
from processing.tools.system import defaultOutputFolder
import processing.tools.dataobjects
class ProcessingConfig:
OUTPUT_FOLDER = 'OUTPUT_FOLDER'
OUTPUT_FOLDER = 'OUTPUTS_FOLDER'
RASTER_STYLE = 'RASTER_STYLE'
VECTOR_POINT_STYLE = 'VECTOR_POINT_STYLE'
VECTOR_LINE_STYLE = 'VECTOR_LINE_STYLE'
@ -83,7 +83,7 @@ class ProcessingConfig:
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
ProcessingConfig.OUTPUT_FOLDER,
ProcessingConfig.tr('Output folder'), tempFolder(),
ProcessingConfig.tr('Output folder'), defaultOutputFolder(),
valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),

View File

@ -45,6 +45,12 @@ def userFolder():
return unicode(QDir.toNativeSeparators(userDir))
def defaultOutputFolder():
folder = os.path.join(os.path.dirname(QgsApplication.qgisUserDbFilePath()), "processing", "outputs")
if not QDir(folder).exists():
QDir().mkpath(folder)
return unicode(QDir.toNativeSeparators(folder))
def isWindows():
return os.name == 'nt'