mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
fix: search in the current page does not clear found dictionary panel (#1123)
* fix: search in the current page does not clear found dictionary panel * [autofix.ci] apply automated fixes --------- Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
b1ea47be26
commit
5c9beab96c
|
@ -379,6 +379,8 @@ void ArticleView::showDefinition( QString const & word,
|
|||
if ( currentWord.isEmpty() )
|
||||
return;
|
||||
historyMode = false;
|
||||
//clear founded dicts.
|
||||
currentActiveDictIds.clear();
|
||||
// first, let's stop the player
|
||||
audioPlayer->stop();
|
||||
|
||||
|
@ -2205,7 +2207,11 @@ void ArticleView::highlightFTSResults()
|
|||
|
||||
void ArticleView::setActiveDictIds( const ActiveDictIds & ad )
|
||||
{
|
||||
if ( ( ad.word == currentWord && ad.groupId == getCurrentGroup() ) || historyMode ) {
|
||||
auto groupId = ad.groupId;
|
||||
if ( groupId == 0 ) {
|
||||
groupId = Instances::Group::AllGroupId;
|
||||
}
|
||||
if ( ( ad.word == currentWord && groupId == getCurrentGroup() ) || historyMode ) {
|
||||
// ignore all other signals.
|
||||
qDebug() << "receive dicts, current word:" << currentWord << ad.word << ":" << ad.dictIds;
|
||||
currentActiveDictIds << ad.dictIds;
|
||||
|
@ -2216,8 +2222,12 @@ void ArticleView::setActiveDictIds( const ActiveDictIds & ad )
|
|||
|
||||
void ArticleView::dictionaryClear( const ActiveDictIds & ad )
|
||||
{
|
||||
auto groupId = ad.groupId;
|
||||
if ( groupId == 0 ) {
|
||||
groupId = Instances::Group::AllGroupId;
|
||||
}
|
||||
// ignore all other signals.
|
||||
if ( ad.word == currentWord && ad.groupId == getCurrentGroup() ) {
|
||||
if ( ad.word == currentWord && groupId == getCurrentGroup() ) {
|
||||
qDebug() << "clear current dictionaries:" << currentWord;
|
||||
currentActiveDictIds.clear();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue