make_shared<DecoderCollectionItem>(item_data, root_);
root_->appendSubItem(group_item_all);
- GSList* l = g_slist_copy((GSList*)srd_decoder_list());
- for (GSList* li = l; li; li = li->next) {
+ for (GSList* li = (GSList*)srd_decoder_list(); li; li = li->next) {
const srd_decoder *const d = (srd_decoder*)li->data;
assert(d);
group_item_all->appendSubItem(decoder_item_all);
// Add decoder to all relevant groups using the tag information
- GSList* t = g_slist_copy((GSList*)d->tags);
- for (GSList* ti = t; ti; ti = ti->next) {
+ 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);
}
- g_slist_free(t);
}
- g_slist_free(l);
}
QVariant DecoderCollectionModel::data(const QModelIndex& index, int role) const
{
const srd_decoder* ret_val = nullptr;
- GSList* l = g_slist_copy((GSList*)srd_decoder_list());
- for (GSList* li = l; li; li = li->next) {
+ for (GSList* li = (GSList*)srd_decoder_list(); li; li = li->next) {
const srd_decoder* d = (srd_decoder*)li->data;
assert(d);
if (QString::fromUtf8(d->id) == id)
ret_val = d;
}
- g_slist_free(l);
return ret_val;
}
{
vector<const char*> ret_val;
- GSList* l = g_slist_copy(d->inputs);
- for (GSList* li = l; li; li = li->next) {
- const char* input = (const char*)li->data;
- ret_val.push_back(input);
- }
- g_slist_free(l);
+ for (GSList* li = d->inputs; li; li = li->next)
+ ret_val.push_back((const char*)li->data);
return ret_val;
}
{
vector<const srd_decoder*> ret_val;
- GSList* l = g_slist_copy((GSList*)srd_decoder_list());
- for (GSList* li = l; li; li = li->next) {
+ for (GSList* li = (GSList*)srd_decoder_list(); li; li = li->next) {
const srd_decoder* d = (srd_decoder*)li->data;
assert(d);
if (strncmp((char*)(d->outputs->data), output, strlen(output)) == 0)
ret_val.push_back(d);
}
- g_slist_free(l);
return ret_val;
}
const QString doc = QString::fromUtf8(srd_decoder_doc_get(d));
QString tags;
- GSList* l = g_slist_copy((GSList*)d->tags);
- for (GSList* li = l; li; li = li->next) {
- QString s = (li == l) ?
+ 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);
}
- g_slist_free(l);
info_label_header_->setText(QString("<span style='font-size:large;font-weight:bold'>%1 (%2)</span><br>%3")
.arg(longname, id, desc));