X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.cpp;h=e2c211840dd6e24a715198ff9341a9341e4bdff2;hp=618de9a338fe88c566f3e2904a56ae483755d9b6;hb=d9aecf1fcd9af471db3b59de7efc65b9632a6d79;hpb=ea86bc4d01851dab34b6ec0e1015a224cecc0fd5 diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 618de9a3..e2c21184 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -24,7 +24,6 @@ extern "C" { #include -#include #include #include @@ -214,7 +213,7 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right) _decoder_stack->get_annotation_subset(annotations, row, start_sample, end_sample); if (!annotations.empty()) { - BOOST_FOREACH(const Annotation &a, annotations) + for (const Annotation &a : annotations) draw_annotation(a, p, get_text_colour(), annotation_height, left, right, samples_per_pixel, pixels_offset, y, @@ -303,8 +302,7 @@ void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form) } else { - list< shared_ptr >::const_iterator iter = - stack.begin(); + auto iter = stack.cbegin(); for (int i = 0; i < (int)stack.size(); i++, iter++) { shared_ptr dec(*iter); create_decoder_form(i, dec, parent, form); @@ -430,7 +428,7 @@ void DecodeTrace::draw_range(const pv::data::decode::Annotation &a, QPainter &p, QString best_annotation; int best_width = 0; - BOOST_FOREACH(const QString &a, annotations) { + for (const QString &a : annotations) { const int w = p.boundingRect(QRectF(), 0, a).width(); if (w <= rect.width() && w > best_width) best_annotation = a, best_width = w; @@ -481,7 +479,7 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left, // We get the logic data of the first probe in the list. // This works because we are currently assuming all // LogicSignals have the same data/snapshot - BOOST_FOREACH (const shared_ptr &dec, stack) + for (const shared_ptr &dec : stack) if (dec && !dec->channels().empty() && ((logic_signal = (*dec->channels().begin()).second)) && ((data = logic_signal->logic_data()))) @@ -592,9 +590,7 @@ QComboBox* DecodeTrace::create_probe_selector( const vector< shared_ptr > sigs = _session.get_signals(); assert(_decoder_stack); - const map >::const_iterator probe_iter = - dec->channels().find(pdch); + const auto probe_iter = dec->channels().find(pdch); QComboBox *selector = new QComboBox(parent); @@ -626,7 +622,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr &dec) map > probe_map; const vector< shared_ptr > sigs = _session.get_signals(); - BOOST_FOREACH(const ProbeSelector &s, _probe_selectors) + for (const ProbeSelector &s : _probe_selectors) { if(s._decoder != dec) break; @@ -635,7 +631,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr &dec) (LogicSignal*)s._combo->itemData( s._combo->currentIndex()).value(); - BOOST_FOREACH(shared_ptr sig, sigs) + for (shared_ptr sig : sigs) if(sig.get() == selection) { probe_map[s._pdch] = dynamic_pointer_cast(sig); @@ -649,8 +645,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr &dec) void DecodeTrace::commit_probes() { assert(_decoder_stack); - BOOST_FOREACH(shared_ptr dec, - _decoder_stack->stack()) + for (shared_ptr dec : _decoder_stack->stack()) commit_decoder_probes(dec); _decoder_stack->begin_decode(); @@ -705,7 +700,7 @@ void DecodeTrace::on_show_hide_decoder(int index) const list< shared_ptr > stack(_decoder_stack->stack()); // Find the decoder in the stack - list< shared_ptr >::const_iterator iter = stack.begin(); + auto iter = stack.cbegin(); for(int i = 0; i < index; i++, iter++) assert(iter != stack.end());