-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable search in Browse & Recording views #11014
Conversation
allow simple text filter, i.e. no special tag filters like artist, crate etc.
The last commit allows searching for individual words or quoted word groups. |
735bc2a
to
04be78d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this first version. I have not yet tested it only some C++ suggestions.
How does the tokenizing compare to our normal search? I think it fails for things like "gimme gimme gimme" ... probably expected
src/library/proxytrackmodel.cpp
Outdated
if (strData.contains(filter)) { | ||
rowMatches = true; | ||
|
||
for (QString token : tokens) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (QString token : tokens) { | |
for (const auto& token : std::as_const(tokens)) { |
Not sure if std::as_const() is strictly required though...
src/library/proxytrackmodel.cpp
Outdated
for (QString token : tokens) { | ||
QListIterator<int> iter(filterColumns); | ||
bool tokenMatch = false; | ||
while (iter.hasNext() && !tokenMatch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also become a range based loop with a break statement below for early abbort.
Sorry, I don't understand the question, it's the same tokenizer used by |
Never mind, I have just tested it and it works like a charm. Thank you very much. |
This enables a
simplecase-insensitive text filter for the Browse & Recording view via their proxymodels.Edit not so simple anymore since with the last commit the query is not treated as one string but is split into words, so it allows queries like
holy "blue cow"
.All columns are considered, incl. invisible.
Query is saved per feature only (not for individual folders).
closes #11012