From: Soeren Apel Date: Sun, 10 Jun 2018 06:54:46 +0000 (+0200) Subject: Fix #979 by querying trigger types only once and storing them X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=2795de2e7fdaeb6e9f672e0dc73dea328f35e585;hp=6b197c700a2065941671c5ef557dc80ba3c978ac Fix #979 by querying trigger types only once and storing them --- diff --git a/pv/views/trace/logicsignal.cpp b/pv/views/trace/logicsignal.cpp index 870af9c5..79065ebd 100644 --- a/pv/views/trace/logicsignal.cpp +++ b/pv/views/trace/logicsignal.cpp @@ -103,6 +103,7 @@ LogicSignal::LogicSignal( shared_ptr base) : Signal(session, base), device_(device), + trigger_types_(get_trigger_types()), trigger_none_(nullptr), trigger_rising_(nullptr), trigger_high_(nullptr), @@ -295,9 +296,8 @@ void LogicSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp) // Draw the trigger marker if (base_->enabled() && trigger_match_) { const int y = get_visual_y(); - const vector trig_types = get_trigger_types(); - for (int32_t type_id : trig_types) { + for (int32_t type_id : trigger_types_) { const TriggerMatchType *const type = TriggerMatchType::get(type_id); if (trigger_match_ != type || type_id < 0 || diff --git a/pv/views/trace/logicsignal.hpp b/pv/views/trace/logicsignal.hpp index e49d69b3..45e815ba 100644 --- a/pv/views/trace/logicsignal.hpp +++ b/pv/views/trace/logicsignal.hpp @@ -147,6 +147,7 @@ private: QSpinBox *signal_height_sb_; const sigrok::TriggerMatchType *trigger_match_; + const vector trigger_types_; QToolBar *trigger_bar_; QAction *trigger_none_; QAction *trigger_rising_;