X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Frow.cpp;h=f1895ae4ef7c71bb100c46d645fc356cc4d78b57;hb=38b77a3ba1738aebf516491cc95e25219938a877;hp=72a6869f94250abcbe731a75d5ebcaffc3b028a2;hpb=6a26fc4417798ab21654197e105e707a14d462f0;p=pulseview.git diff --git a/pv/data/decode/row.cpp b/pv/data/decode/row.cpp index 72a6869f..f1895ae4 100644 --- a/pv/data/decode/row.cpp +++ b/pv/data/decode/row.cpp @@ -17,6 +17,8 @@ * along with this program; if not, see . */ +#include + #include "decoder.hpp" #include "row.hpp" @@ -75,11 +77,17 @@ const QString Row::description() const vector Row::ann_classes() const { + assert(decoder_); + vector result; - if (!srd_row_) + if (!srd_row_) { + if (index_ == 0) { + // When operating as the fallback row, all annotation classes belong to it + return decoder_->ann_classes(); + } return result; - assert(decoder_); + } for (GSList *l = srd_row_->ann_classes; l; l = l->next) { size_t class_id = (size_t)l->data; @@ -104,6 +112,15 @@ void Row::set_visible(bool visible) visible_ = visible; } +bool Row::has_hidden_classes() const +{ + for (const AnnotationClass* c : ann_classes()) + if (!c->visible) + return true; + + return false; +} + bool Row::operator<(const Row& other) const { return (decoder_ < other.decoder_) ||