Skip to content
Browse files
[processing] fix app freeze when closing options dialog (fixes #15550)
(cherry picked from commit 3dcf487)
  • Loading branch information
nirvn authored and alexbruy committed Jan 24, 2017
1 parent da3eb06 commit e648e212212555ba98897b7208719cd106ea8b0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
@@ -268,16 +268,15 @@ def setValue(self, 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 = unicode(value).lower() == unicode(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 + '=' + unicode(self.value)
@@ -30,7 +30,7 @@

from PyQt4 import uic
from PyQt4.QtCore import Qt, QEvent, QPyNullVariant
from PyQt4.QtGui import (QFileDialog, QDialog, QIcon, QStyle,
from PyQt4.QtGui import (QFileDialog, QDialog, QIcon, QStyle, QSettings,
QStandardItemModel, QStandardItem, QMessageBox, QStyledItemDelegate,
QLineEdit, QWidget, QToolButton, QHBoxLayout,
@@ -139,6 +139,7 @@ def fillTree(self):

def accept(self):
qsettings = QSettings()
for setting in self.items.keys():
if isinstance(setting.value, bool):
setting.setValue(self.items[setting].checkState() == Qt.Checked)
@@ -149,7 +150,7 @@ def accept(self):
QMessageBox.warning(self,'Wrong value'),'Wrong value for parameter "%s":\n\n%s' % (setting.description, unicode(e))))


0 comments on commit e648e21

Please sign in to comment.