X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdecoderoptions.cpp;h=8738300ee9550007486c2b81f2fee1749f0293c5;hb=8dd4419097191563045396946f0dcff5ac9714b2;hp=34f1b813a6478012ceec15eaa7f6d704784ab525;hpb=7491a29f33471b38e161b3254f4d8e708b05f929;p=pulseview.git diff --git a/pv/prop/binding/decoderoptions.cpp b/pv/prop/binding/decoderoptions.cpp index 34f1b81..8738300 100644 --- a/pv/prop/binding/decoderoptions.cpp +++ b/pv/prop/binding/decoderoptions.cpp @@ -31,8 +31,11 @@ #include #include -using namespace boost; -using namespace std; +using boost::bind; +using boost::none; +using boost::shared_ptr; +using std::map; +using std::string; namespace pv { namespace prop { @@ -54,7 +57,7 @@ DecoderOptions::DecoderOptions( const srd_decoder_option *const opt = (srd_decoder_option*)l->data; - const QString name(opt->desc); + const QString name = QString::fromUtf8(opt->desc); const Property::Getter getter = bind( &DecoderOptions::getter, this, opt->id); @@ -78,13 +81,17 @@ DecoderOptions::DecoderOptions( GVariant* DecoderOptions::getter(const char *id) { + GVariant *val = NULL; + assert(_decoder); // Get the value from the hash table if it is already present - GVariant *val = (GVariant*)g_hash_table_lookup( - (GHashTable*)_decoder->options(), id); + const map& options = _decoder->options(); + map::const_iterator iter = options.find(id); - if (!val) + if (iter != options.end()) + val = (*iter).second; + else { assert(_decoder->decoder());