Add missing #include <cassert> in multiple files
[pulseview.git] / pv / widgets / decodermenu.cpp
index 23c74a0ac70abe3f1e25db3e871b9a5291349fdf..b90c86d7403e3df7bc7e2848d84d2579bbd74126 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,7 +38,8 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
 
-               if (!first_level_decoder || d->probes || d->opt_probes) {
+               const bool have_probes = (d->channels || d->opt_channels) != 0;
+               if (first_level_decoder == have_probes) {
                        QAction *const action =
                                addAction(QString::fromUtf8(d->name));
                        action->setData(qVariantFromValue(l->data));