From: Soeren Apel Date: Wed, 1 Jan 2020 14:56:28 +0000 (+0100) Subject: Rename Decoder::shown() and such X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5d3ca591b02ce030239ad4b86d9b172b925b4c5d;p=pulseview.git Rename Decoder::shown() and such --- diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index 99118d17..9792ace4 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -38,7 +38,7 @@ namespace decode { Decoder::Decoder(const srd_decoder *const dec) : srd_decoder_(dec), - shown_(true), + visible_(true), decoder_inst_(nullptr) { // Query the annotation output classes @@ -101,14 +101,14 @@ const char* Decoder::name() const return srd_decoder_->name; } -bool Decoder::shown() const +bool Decoder::visible() const { - return shown_; + return visible_; } -void Decoder::show(bool show) +void Decoder::set_visible(bool visible) { - shown_ = show; + visible_ = visible; } const vector& Decoder::channels() const diff --git a/pv/data/decode/decoder.hpp b/pv/data/decode/decoder.hpp index c0a30a7e..545992f8 100644 --- a/pv/data/decode/decoder.hpp +++ b/pv/data/decode/decoder.hpp @@ -90,8 +90,8 @@ public: const char* name() const; - bool shown() const; - void show(bool show = true); + bool visible() const; + void set_visible(bool visible); const vector& channels() const; void set_channels(vector channels); @@ -120,7 +120,7 @@ public: private: const srd_decoder* const srd_decoder_; - bool shown_; + bool visible_; vector channels_; vector rows_; diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index d976c494..d6eb9247 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -136,8 +136,8 @@ bool DecodeSignal::toggle_decoder_visibility(int index) // Toggle decoder visibility bool state = false; if (dec) { - state = !dec->shown(); - dec->show(state); + state = !dec->visible(); + dec->set_visible(state); } return state; @@ -437,7 +437,7 @@ vector DecodeSignal::get_rows(bool visible_only) for (const shared_ptr& dec : stack_) { assert(dec); - if (visible_only && !dec->shown()) + if (visible_only && !dec->visible()) continue; for (Row* row : dec->get_rows()) @@ -453,7 +453,7 @@ vector DecodeSignal::get_rows(bool visible_only) const for (const shared_ptr& dec : stack_) { assert(dec); - if (visible_only && !dec->shown()) + if (visible_only && !dec->visible()) continue; for (const Row* row : dec->get_rows()) @@ -679,7 +679,7 @@ void DecodeSignal::save_settings(QSettings &settings) const settings.beginGroup("decoder" + QString::number(decoder_idx++)); settings.setValue("id", decoder->get_srd_decoder()->id); - settings.setValue("shown", decoder->shown()); + settings.setValue("visible", decoder->visible()); // Save decoder options const map& options = decoder->options(); @@ -747,7 +747,7 @@ void DecodeSignal::restore_settings(QSettings &settings) shared_ptr decoder = make_shared(dec); stack_.push_back(decoder); - decoder->show(settings.value("shown", true).toBool()); + decoder->set_visible(settings.value("visible", true).toBool()); // Restore decoder options that differ from their default int options = settings.value("options").toInt(); diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 3deebf69..fc7ae6b0 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -231,7 +231,7 @@ void DecodeTrace::paint_mid(QPainter &p, ViewItemPaintParams &pp) // If the row is hidden, we don't want to fetch annotations assert(r.decode_row); assert(r.decode_row->decoder()); - if ((!r.decode_row->decoder()->shown()) || (!r.decode_row->visible())) { + if ((!r.decode_row->decoder()->visible()) || (!r.decode_row->visible())) { r.currently_visible = false; continue; } @@ -1034,7 +1034,7 @@ void DecodeTrace::create_decoder_form(int index, tr("%1:\n%2").arg(QString::fromUtf8(decoder->longname), QString::fromUtf8(decoder->desc)), nullptr, decoder_deletable); - group->set_decoder_visible(dec->shown()); + group->set_decoder_visible(dec->visible()); if (decoder_deletable) { delete_mapper_.setMapping(group, index);