+shared_ptr<Property> DecoderOptions::bind_enum(
+ const QString &name, const srd_decoder_option *option,
+ Property::Getter getter, Property::Setter setter)
+{
+ vector< pair<GVariant*, QString> > values;
+ for (GSList *l = option->values; l; l = l->next) {
+ GVariant *const var = (GVariant*)l->data;
+ assert(var);
+ values.push_back(make_pair(var, print_gvariant(var)));
+ }
+
+ return shared_ptr<Property>(new Enum(name, values, getter, setter));
+}
+