Skip to content

Commit

Permalink
[Processing] fixed #13790 (issue saving config option)
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 8, 2015
1 parent ac01d48 commit f0bbb88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -255,7 +255,7 @@ def checkFileOrFolder(v):

def setValue(self, value):
self.validator(value)
self._value = value
self.value = value

def read(self):
qsettings = QSettings()
Expand Down
14 changes: 2 additions & 12 deletions python/plugins/processing/gui/ConfigDialog.py
Expand Up @@ -215,25 +215,15 @@ def setEditorData(self, editor, index):
if setting.valuetype == Setting.SELECTION:
editor.setCurrentIndex(editor.findText(value))
else:
if isinstance(value, (int, long)):
editor.setValue(value)
elif isinstance(value, float):
editor.setValue(value)
elif isinstance(value, (str, unicode)):
editor.setText(value)
editor.setText(value)

def setModelData(self, editor, model, index):
value = self.convertValue(index.model().data(index, Qt.EditRole))
setting = index.model().data(index, Qt.UserRole)
if setting.valuetype == Setting.SELECTION:
model.setData(index, editor.currentText(), Qt.EditRole)
else:
if isinstance(value, (int, long)):
model.setData(index, editor.value(), Qt.EditRole)
elif isinstance(value, float):
model.setData(index, editor.value(), Qt.EditRole)
elif isinstance(value, (str, unicode)):
model.setData(index, editor.text(), Qt.EditRole)
model.setData(index, editor.text(), Qt.EditRole)

def sizeHint(self, option, index):
return QSpinBox().sizeHint()
Expand Down

0 comments on commit f0bbb88

Please sign in to comment.