Skip to content
Permalink
Browse files

Merge pull request #3941 from nirvn/processing_options_freeze

[processing] fix app freeze when closing options dialog (fixes #15550)
  • Loading branch information
alexbruy committed Jan 3, 2017
2 parents 57917ab + 3dcf487 commit a643f4b4a6ea0fe74d540ed4036fa5d4214dfd46
@@ -289,16 +289,15 @@ def setValue(self, value):
self.validator(value)
self.value = value

def read(self):
qsettings = QSettings()
def read(self, qsettings=QSettings()):
value = qsettings.value(self.qname, None)
if value is not None:
if isinstance(self.value, bool):
value = str(value).lower() == str(True).lower()
self.value = value

def save(self):
QSettings().setValue(self.qname, self.value)
def save(self, qsettings=QSettings()):
qsettings.setValue(self.qname, self.value)

def __str__(self):
return self.name + '=' + str(self.value)
@@ -30,8 +30,7 @@
import os

from qgis.PyQt import uic
from qgis.PyQt.QtCore import (Qt,
QEvent)
from qgis.PyQt.QtCore import Qt, QEvent, QSettings
from qgis.PyQt.QtWidgets import (QFileDialog,
QDialog,
QStyle,
@@ -266,6 +265,7 @@ def resetMenusToDefaults(self):

def accept(self):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
qsettings = QSettings()
for setting in list(self.items.keys()):
if setting.group != menusSettingsGroup or self.saveMenus:
if isinstance(setting.value, bool):
@@ -277,7 +277,7 @@ def accept(self):
QMessageBox.warning(self, self.tr('Wrong value'),
self.tr('Wrong value for parameter "%s":\n\n%s' % (setting.description, str(e))))
return
setting.save()
setting.save(qsettings)
Processing.updateAlgsList()
settingsWatcher.settingsChanged.emit()
QApplication.restoreOverrideCursor()

0 comments on commit a643f4b

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