From: Joel Holdsworth Date: Sat, 8 Feb 2014 10:04:51 +0000 (+0000) Subject: Fixed decoder probes auto-select logic X-Git-Tag: pulseview-0.2.0~88 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d2f46d2719dae993818784ffffc8697d7e827258;p=pulseview.git Fixed decoder probes auto-select logic This fixes bug #310 --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 6f66be7c..e507a099 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -233,10 +233,15 @@ bool SigSession::add_decoder(srd_decoder *const dec) decoder_stack = shared_ptr( new data::DecoderStack(dec)); - // Auto select the initial probes + // Make a list of all the probes + std::vector all_probes; for(const GSList *i = dec->probes; i; i = i->next) - { - const srd_probe *const probe = (const srd_probe*)i->data; + all_probes.push_back((const srd_probe*)i->data); + for(const GSList *i = dec->opt_probes; i; i = i->next) + all_probes.push_back((const srd_probe*)i->data); + + // Auto select the initial probes + BOOST_FOREACH(const srd_probe *probe, all_probes) BOOST_FOREACH(shared_ptr s, _signals) { shared_ptr l = @@ -246,7 +251,6 @@ bool SigSession::add_decoder(srd_decoder *const dec) l->get_name().toLower())) probes[probe] = l; } - } assert(decoder_stack); assert(!decoder_stack->stack().empty());