1

Config: properly handle loading bool datatype

Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
Juraj Oravec 2019-07-01 20:52:51 +02:00
parent a15d214160
commit f97ae0a02b
No known key found for this signature in database
GPG Key ID: 63ACB65056BC8D07

View File

@ -66,7 +66,7 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy
settings.beginGroup("{% if settings_group_name %}{{ settings_group_name }}{% else %}{{ name }}{% endif %}")
{% for member in members %}
self.{{ member.name }} = {{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }}))
self.{{ member.name }} = {% if member.type == "bool" %}self._{% endif %}{{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }}))
{% endfor %}
settings.endGroup()
@ -118,3 +118,11 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy
self.{{ member.name }}Changed.emit({{ member.name }})
{% endfor %}
{% if include_load_save %}
def _bool(self, value):
return value == "true"
{% endif %}