#include <libsigrokdecode/libsigrokdecode.h>
+#define DECODERS_HAVE_TAGS \
+ ((SRD_PACKAGE_VERSION_MAJOR > 0) || \
+ (SRD_PACKAGE_VERSION_MAJOR == 0) && (SRD_PACKAGE_VERSION_MINOR > 5))
+
using std::make_shared;
namespace pv {
group_item_all->appendSubItem(decoder_item_all);
// Add decoder to all relevant groups using the tag information
+#if DECODERS_HAVE_TAGS
for (GSList* ti = (GSList*)d->tags; ti; ti = ti->next) {
const QString tag = tr((char*)ti->data);
const QVariant tag_var = QVariant(tag);
// Add decoder to tag group
group_item->appendSubItem(decoder_item);
}
+#endif
}
}
Qt::ItemFlags DecoderCollectionModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
- return 0;
+ return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
QVariant DecoderCollectionModel::headerData(int section, Qt::Orientation orientation,
int role) const
{
- if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
+ if ((orientation == Qt::Horizontal) && (role == Qt::DisplayRole))
return root_->data(section);
return QVariant();