Skip to content

[DictQuickLookup] create addQueryWordToFirstResult method#13911

Merged
poire-z merged 2 commits into
koreader:masterfrom
Commodore64user:word-query
Jun 21, 2025
Merged

[DictQuickLookup] create addQueryWordToFirstResult method#13911
poire-z merged 2 commits into
koreader:masterfrom
Commodore64user:word-query

Conversation

@Commodore64user

@Commodore64user Commodore64user commented Jun 5, 2025

Copy link
Copy Markdown
Member

what's new

  • Extraction of logic into a new method: The code responsible for appending the queried word to the first result's definition has been moved from DictQuickLookup:changeDictionary to a new method, DictQuickLookup:addQueryWordToFirstResult, making the code easier to override or remove via user patches.

This change is Reviewable

Comment thread frontend/ui/widget/dictquicklookup.lua Outdated
end
self.definition = self.definition..T(_("(query : %1)"), self.word)
end
self:addQueryWordToFirstResult(index)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a bit odd, to have that method named addQueryWordToFirstResult(), pass it the index so it can check that only when index==1, it can addQueryWord.
I would keep the if index == 1 then here and call self:addQueryWordToResult().

@Commodore64user Commodore64user requested a review from poire-z June 21, 2025 09:29
@poire-z poire-z merged commit b2f9530 into koreader:master Jun 21, 2025
2 of 4 checks passed
@poire-z poire-z added this to the 2025.06 milestone Jun 21, 2025
@Commodore64user Commodore64user deleted the word-query branch June 21, 2025 11:07
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants