if (_check_box)
return _check_box;
- _check_box = new QCheckBox(name(), parent);
-
GVariant *const value = _getter ? _getter() : NULL;
+ if (!value)
+ return NULL;
- if (value) {
- _check_box->setCheckState(g_variant_get_boolean(value) ?
- Qt::Checked : Qt::Unchecked);
- g_variant_unref(value);
- }
+ _check_box = new QCheckBox(name(), parent);
+ _check_box->setCheckState(g_variant_get_boolean(value) ?
+ Qt::Checked : Qt::Unchecked);
+ g_variant_unref(value);
if (auto_commit)
connect(_check_box, SIGNAL(stateChanged(int)),