From: Joel Holdsworth Date: Sun, 7 Apr 2013 19:49:10 +0000 (+0100) Subject: Enum now allows the no-selection condition X-Git-Tag: pulseview-0.1.0~44 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0912f8a7b0fde306f2616fef3c63ce742006602d;p=pulseview.git Enum now allows the no-selection condition --- diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index 065fd548..ced2f2bb 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -51,13 +51,12 @@ QWidget* Enum::get_widget(QWidget *parent) return _selector; GVariant *const value = _getter ? _getter() : NULL; - assert(value); _selector = new QComboBox(parent); for (unsigned int i = 0; i < _values.size(); i++) { const pair &v = _values[i]; _selector->addItem(v.second, qVariantFromValue((void*)v.first)); - if (g_variant_compare(v.first, value) == 0) + if (value && g_variant_compare(v.first, value) == 0) _selector->setCurrentIndex(i); }