- for(; l; l = l->next)
- {
- QAction *const action = addAction(QString::fromUtf8(
- ((srd_decoder*)l->data)->name));
- action->setData(qVariantFromValue(l->data));
- _mapper.setMapping(action, action);
- connect(action, SIGNAL(triggered()),
- &_mapper, SLOT(map()));
+ for (; l; l = l->next) {
+ const srd_decoder *const d = (srd_decoder*)l->data;
+ assert(d);
+
+ 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));
+ mapper_.setMapping(action, action);
+ connect(action, SIGNAL(triggered()),
+ &mapper_, SLOT(map()));
+ }