From: Soeren Apel Date: Sat, 5 Sep 2020 20:04:38 +0000 (+0200) Subject: Channel popup: Don't use exceptions X-Git-Url: http://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=c5a871570b79107260398936c3c335b26df2c26b Channel popup: Don't use exceptions --- diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp index 842a19d2..ecdc59a3 100644 --- a/pv/popups/channels.cpp +++ b/pv/popups/channels.cpp @@ -333,11 +333,9 @@ void Channels::showEvent(QShowEvent *event) for (auto& entry : device->channel_groups()) { const shared_ptr group = entry.second; - try { - QLabel* label = group_label_map_.at(group); + if (group_label_map_.count(group) > 0) { + QLabel* label = group_label_map_[group]; label->setText(QString("

%1

").arg(group->name().c_str())); - } catch (out_of_range&) { - // Do nothing } } diff --git a/pv/popups/channels.hpp b/pv/popups/channels.hpp index 972549a8..c176eb7a 100644 --- a/pv/popups/channels.hpp +++ b/pv/popups/channels.hpp @@ -103,8 +103,7 @@ private: bool updating_channels_; vector< shared_ptr > group_bindings_; - map< QCheckBox*, shared_ptr > - check_box_signal_map_; + map< QCheckBox*, shared_ptr > check_box_signal_map_; map< shared_ptr, QLabel*> group_label_map_; QGridLayout filter_buttons_bar_;