bindings: Rename ConfigKey::get(string) to get_by_identifier().
The polymorphism with get(int) causes problems here when a char * is passed.
This commit is contained in:
parent
9d229ecb9e
commit
0bc1a7613a
|
@ -22,7 +22,7 @@ string ConfigKey::description() const
|
||||||
return valid_string(info->name);
|
return valid_string(info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfigKey *ConfigKey::get(string identifier)
|
const ConfigKey *ConfigKey::get_by_identifier(string identifier)
|
||||||
{
|
{
|
||||||
const struct sr_config_info *info = sr_config_info_name_get(identifier.c_str());
|
const struct sr_config_info *info = sr_config_info_name_get(identifier.c_str());
|
||||||
if (!info)
|
if (!info)
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
/** Description of this configuration key. */
|
/** Description of this configuration key. */
|
||||||
string description() const;
|
string description() const;
|
||||||
/** Get configuration key by string identifier. */
|
/** Get configuration key by string identifier. */
|
||||||
static const ConfigKey *get(string identifier);
|
static const ConfigKey *get_by_identifier(string identifier);
|
||||||
/** Parse a string argument into the appropriate type for this key. */
|
/** Parse a string argument into the appropriate type for this key. */
|
||||||
Glib::VariantBase parse_string(string value) const;
|
Glib::VariantBase parse_string(string value) const;
|
||||||
|
|
|
@ -377,7 +377,7 @@ std::map<std::string, Glib::VariantBase> dict_to_map_options(PyObject *dict,
|
||||||
{
|
{
|
||||||
if (!PyString_Check(py_key))
|
if (!PyString_Check(py_key))
|
||||||
throw sigrok::Error(SR_ERR_ARG);
|
throw sigrok::Error(SR_ERR_ARG);
|
||||||
auto key = sigrok::ConfigKey::get(PyString_AsString(py_key));
|
auto key = sigrok::ConfigKey::get_by_identifier(PyString_AsString(py_key));
|
||||||
auto value = python_to_variant_by_key(py_value, key);
|
auto value = python_to_variant_by_key(py_value, key);
|
||||||
options[key] = value;
|
options[key] = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue