#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
}
}
#include "pv/session.hpp"
#include "pv/subwindows/decoder_selector/subwindow.hpp"
+#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::reverse;
namespace pv {
filter->setClearButtonEnabled(true);
filter->addAction(filter_icon, QLineEdit::LeadingPosition);
+
sort_filter_model_->setSourceModel(model_);
+ sort_filter_model_->setSortCaseSensitivity(Qt::CaseInsensitive);
sort_filter_model_->setFilterCaseSensitivity(Qt::CaseInsensitive);
sort_filter_model_->setFilterKeyColumn(-1);
tree_view_->setIndentation(10);
+#if (!DECODERS_HAVE_TAGS)
+ tree_view_->expandAll();
+ tree_view_->setItemsExpandable(false);
+#endif
+
QScrollArea* info_label_body_container = new QScrollArea();
info_label_body_container->setWidget(info_label_body_);
info_label_body_container->setWidgetResizable(true);
const QString doc = QString::fromUtf8(srd_decoder_doc_get(d)).trimmed();
QString tags;
+#if DECODERS_HAVE_TAGS
for (GSList* li = (GSList*)d->tags; li; li = li->next) {
QString s = (li == (GSList*)d->tags) ?
tr((char*)li->data) :
QString(tr(", %1")).arg(tr((char*)li->data));
tags.append(s);
}
+#endif
info_label_header_->setText(QString("<span style='font-size:large'><b>%1 (%2)</b></span><br><i>%3</i>")
.arg(longname, id, desc));
info_label_body_->setText(doc);
- info_label_footer_->setText(tr("<p align='right'>Tags: %1</p>").arg(tags));
+
+ if (!tags.isEmpty())
+ info_label_footer_->setText(tr("<p align='right'>Tags: %1</p>").arg(tags));
}
void SubWindow::on_item_activated(const QModelIndex& index)