]> sigrok.org Git - pulseview.git/commitdiff
Channel popup: Don't use exceptions
authorSoeren Apel <redacted>
Sat, 5 Sep 2020 20:04:38 +0000 (22:04 +0200)
committerSoeren Apel <redacted>
Sat, 5 Sep 2020 20:05:11 +0000 (22:05 +0200)
pv/popups/channels.cpp
pv/popups/channels.hpp

index 842a19d29305ba3db38de9a43f096ba22da45490..ecdc59a35466cd82f378cd1393f5f366bb091ccf 100644 (file)
@@ -333,11 +333,9 @@ void Channels::showEvent(QShowEvent *event)
        for (auto& entry : device->channel_groups()) {
                const shared_ptr<ChannelGroup> 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("<h3>%1</h3>").arg(group->name().c_str()));
-               } catch (out_of_range&) {
-                       // Do nothing
                }
        }
 
index 972549a8d1c9fd2f65b63e997eb37b1d6440459f..c176eb7a95184850ca89dc1b2c90d7ce4d1d660e 100644 (file)
@@ -103,8 +103,7 @@ private:
        bool updating_channels_;
 
        vector< shared_ptr<pv::binding::Device> > group_bindings_;
-       map< QCheckBox*, shared_ptr<pv::data::SignalBase> >
-               check_box_signal_map_;
+       map< QCheckBox*, shared_ptr<pv::data::SignalBase> > check_box_signal_map_;
        map< shared_ptr<sigrok::ChannelGroup>, QLabel*> group_label_map_;
 
        QGridLayout filter_buttons_bar_;