From: Martin Ling Date: Wed, 29 Oct 2014 14:33:46 +0000 (+0000) Subject: bindings: Rename ConfigKey::get(string) to get_by_identifier(). X-Git-Tag: libsigrok-0.4.0~800 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=0bc1a7613ac2ad4c5b1148b9714791769a2b834c bindings: Rename ConfigKey::get(string) to get_by_identifier(). The polymorphism with get(int) causes problems here when a char * is passed. --- diff --git a/bindings/cxx/ConfigKey_methods.cpp b/bindings/cxx/ConfigKey_methods.cpp index f9ce9984..9ba82adb 100644 --- a/bindings/cxx/ConfigKey_methods.cpp +++ b/bindings/cxx/ConfigKey_methods.cpp @@ -22,7 +22,7 @@ string ConfigKey::description() const 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()); if (!info) diff --git a/bindings/cxx/ConfigKey_methods.hpp b/bindings/cxx/ConfigKey_methods.hpp index 35315318..f759cc4e 100644 --- a/bindings/cxx/ConfigKey_methods.hpp +++ b/bindings/cxx/ConfigKey_methods.hpp @@ -5,6 +5,6 @@ /** Description of this configuration key. */ string description() const; /** 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. */ Glib::VariantBase parse_string(string value) const; diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index 1da14d87..27060cd1 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -377,7 +377,7 @@ std::map dict_to_map_options(PyObject *dict, { if (!PyString_Check(py_key)) 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); options[key] = value; }