X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Flogicsignal.cpp;h=86d45a4319013536ed12664ab49deda7e427d543;hb=aca9aa834c742ba70f49d1ac3eb2d1e02e759416;hp=f78170b01a30a0028a95befaf7665e7d8a33e649;hpb=6f925ba9d6faf1077b73c5a5808259576081716a;p=pulseview.git diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index f78170b..86d45a4 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -31,14 +31,14 @@ #include "logicsignal.hpp" #include "view.hpp" -#include -#include -#include #include #include #include -#include +#include +#include #include +#include +#include #include @@ -53,9 +53,7 @@ using std::vector; using sigrok::ConfigKey; using sigrok::Capability; -using sigrok::Error; using sigrok::Trigger; -using sigrok::TriggerStage; using sigrok::TriggerMatch; using sigrok::TriggerMatchType; @@ -178,8 +176,7 @@ void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp) if (segments.empty()) return; - const shared_ptr &segment = - segments.front(); + const shared_ptr &segment = segments.front(); double samplerate = segment->samplerate(); @@ -347,6 +344,10 @@ void LogicSignal::init_trigger_actions(QWidget *parent) const vector LogicSignal::get_trigger_types() const { + // We may not be associated with a device + if (!device_) + return vector(); + const auto sr_dev = device_->device(); if (sr_dev->config_check(ConfigKey::TRIGGER_MATCH, Capability::LIST)) { const Glib::VariantContainerBase gvar = @@ -393,7 +394,7 @@ QAction* LogicSignal::action_from_trigger_type(const TriggerMatchType *type) action = trigger_change_; break; default: - assert(0); + assert(false); } }