]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/decodermenu.cpp
Use a generic approach when adding the "close on enter" hook for popups
[pulseview.git] / pv / widgets / decodermenu.cpp
index ff687e4cb85a6d279d5a532b73c9ba35cebbb92d..60eb8e8a576205a8ec480f2a6669fc43695cb82c 100644 (file)
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <cassert>
+
 #include <libsigrokdecode/libsigrokdecode.h>
 
 #include "decodermenu.h"
@@ -36,8 +38,8 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
 
-               const bool have_probes = (d->probes || d->opt_probes) != 0;
-               if (first_level_decoder == have_probes) {
+               const bool have_channels = (d->channels || d->opt_channels) != 0;
+               if (first_level_decoder == have_channels) {
                        QAction *const action =
                                addAction(QString::fromUtf8(d->name));
                        action->setData(qVariantFromValue(l->data));