sort_filter_model_->setSourceModel(model_);
sort_filter_model_->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ sort_filter_model_->setFilterKeyColumn(-1);
tree_view_->setModel(sort_filter_model_);
tree_view_->setRootIsDecorated(true);
connect(this, SIGNAL(new_decoders_selected(vector<const srd_decoder*>)),
&session, SLOT(on_new_decoders_selected(vector<const srd_decoder*>)));
+
+ // Place the keyboard cursor in the filter QLineEdit initially
+ filter->setFocus();
}
bool SubWindow::has_toolbar() const
if (!d->outputs)
continue;
+ const int maxlen = 1024;
+
// TODO For now we ignore that d->outputs is actually a list
- if (strncmp((char*)(d->outputs->data), output, strlen(output)) == 0)
+ if (strncmp((char*)(d->outputs->data), output, maxlen) == 0)
ret_val.push_back(d);
}
return;
}
- if (strncmp(inputs.at(0), "logic", 5) == 0) {
+ if (strcmp(inputs.at(0), "logic") == 0) {
new_decoders_selected(decoders);
return;
}
// Check if we can automatically fulfill the stacking requirements
- while (strncmp(inputs.at(0), "logic", 5) != 0) {
+ while (strcmp(inputs.at(0), "logic") != 0) {
vector<const srd_decoder*> prov_decoders = get_decoders_providing(inputs.at(0));
if (prov_decoders.size() == 0) {
void SubWindow::on_filter_changed(const QString& text)
{
sort_filter_model_->setFilterFixedString(text);
+
+ // Expand the "All Decoders" category/tag if the user filtered
+ tree_view_->setExpanded(tree_view_->model()->index(0, 0), !text.isEmpty());
}
} // namespace decoder_selector