]> sigrok.org Git - pulseview.git/commitdiff
Rename Decoder::shown() and such
authorSoeren Apel <redacted>
Wed, 1 Jan 2020 14:56:28 +0000 (15:56 +0100)
committerSoeren Apel <redacted>
Wed, 1 Jan 2020 21:41:53 +0000 (22:41 +0100)
pv/data/decode/decoder.cpp
pv/data/decode/decoder.hpp
pv/data/decodesignal.cpp
pv/views/trace/decodetrace.cpp

index 99118d1707e5361e9f9449fbb6b24e18b1cd61f1..9792ace43412ad6d01bb44596d3676641b24f9cc 100644 (file)
@@ -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<DecodeChannel*>& Decoder::channels() const
index c0a30a7e2f50a9e89c574dba739c0d8f7e1a0ece..545992f8a24a379b2381c93739432656aa45bcc7 100644 (file)
@@ -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<DecodeChannel*>& channels() const;
        void set_channels(vector<DecodeChannel*> channels);
@@ -120,7 +120,7 @@ public:
 private:
        const srd_decoder* const srd_decoder_;
 
-       bool shown_;
+       bool visible_;
 
        vector<DecodeChannel*> channels_;
        vector<Row> rows_;
index d976c494e2a74c88fce9aec39bf1bb983a470dce..d6eb924755b15452323c684cf2bdc285cd774a2c 100644 (file)
@@ -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<Row*> DecodeSignal::get_rows(bool visible_only)
 
        for (const shared_ptr<Decoder>& 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<const Row*> DecodeSignal::get_rows(bool visible_only) const
 
        for (const shared_ptr<Decoder>& 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<string, GVariant*>& options = decoder->options();
@@ -747,7 +747,7 @@ void DecodeSignal::restore_settings(QSettings &settings)
                                shared_ptr<Decoder> decoder = make_shared<Decoder>(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();
index 3deebf6951ae769814a174a37f916d0ace393b91..fc7ae6b0042ec375fa1863bed85ce0934eb2e81a 100644 (file)
@@ -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);