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
History: search #11084
History: search #11084
Conversation
if match_table then | ||
self.filter_text = match_table.filter_text |
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.
The whole thing was a bit hard to review because of the choice of these variable names.
You choose self.filter_text
because we already have a self.filter
(not fond of "filter" when reading it, but ok, might be just my French influence).
Or may be its just "text" that reads usually as something we will display, not that we will search. You use "keywords" elsewhere, may be filter_keywords
would sound better and consistent (even if keywords sounds like its multiple keywords and not a single string).
You pass them in a match_table
(again, no real need to put "table" in its name:)), that you could have named filter_table
or filtering_info
.
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 new search inherits from old
koreader/frontend/apps/filemanager/filemanagerfilesearcher.lua
Lines 129 to 130 in 2e2ca76
local keywords = self.search_value | |
if keywords ~= "*" then -- one * to show all files |
and
koreader/frontend/apps/reader/modules/readerbookmark.lua
Lines 1118 to 1124 in 2e2ca76
local match_table = { | |
search_str = search_str, | |
bookmark = check_button_bookmark.checked, | |
highlight = check_button_highlight.checked, | |
note = check_button_note.checked, | |
case_sensitive = check_button_case.checked, | |
} |
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.
We can polish them all for consistency.
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.
As you feel (you're the code owner of all this :) and if it doesn't bug anybody else, fine with me.)
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.
I haven't had a chance to read it yet. You could always name it filter_str(ing) if I understand the complaint correctly?
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.
Your search_string
and search_info
read well to me, thanks.
Search in history in filenames and books metadata (without opening files).
Available in the History
and by dispatcher in FM and Reader.
This change is