mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 12:02:09 +08:00
cabana: filtering in both address and msg name (#26929)
search in address and name Co-authored-by: Shane Smiskol <shane@smiskol.com> old-commit-hash: 66d0d4c7d7035375bc17bdc9da404c2a5e77d453
This commit is contained in:
@@ -80,11 +80,11 @@ QVariant MessageListModel::data(const QModelIndex &index, int role) const {
|
||||
|
||||
void MessageListModel::setFilterString(const QString &string) {
|
||||
filter_str = string;
|
||||
bool search_id = filter_str.contains(':');
|
||||
msgs.clear();
|
||||
for (auto it = can->can_msgs.begin(); it != can->can_msgs.end(); ++it) {
|
||||
if ((search_id ? it.key() : msgName(it.key())).contains(filter_str, Qt::CaseInsensitive))
|
||||
if (it.key().contains(filter_str, Qt::CaseInsensitive) || msgName(it.key()).contains(filter_str, Qt::CaseInsensitive)) {
|
||||
msgs.push_back(it.key());
|
||||
}
|
||||
}
|
||||
sortMessages();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user