opt: clear the delayedHighlight text earlier

This commit is contained in:
Xiao YiFang 2022-06-03 12:32:27 +08:00
parent 006c45e0e9
commit b5d005d3ed

View file

@ -402,8 +402,11 @@ void ArticleView::showDefinition( Config::InputPhrase const & phrase, unsigned g
if ( scrollTo.size() ) if ( scrollTo.size() )
Utils::Url::addQueryItem( req, "scrollto", scrollTo ); Utils::Url::addQueryItem( req, "scrollto", scrollTo );
if(delayedHighlightText.size()) if( delayedHighlightText.size() )
{
Utils::Url::addQueryItem( req, "regexp", delayedHighlightText ); Utils::Url::addQueryItem( req, "regexp", delayedHighlightText );
delayedHighlightText.clear();
}
Contexts::Iterator pos = contexts.find( "gdanchor" ); Contexts::Iterator pos = contexts.find( "gdanchor" );
if( pos != contexts.end() ) if( pos != contexts.end() )
@ -582,12 +585,6 @@ void ArticleView::loadFinished( bool result )
} }
if( Utils::Url::hasQueryItem( ui.definition->url(), "regexp" ) ) if( Utils::Url::hasQueryItem( ui.definition->url(), "regexp" ) )
highlightFTSResults(); highlightFTSResults();
if( !delayedHighlightText.isEmpty() )
{
// findText( delayedHighlightText, QWebEnginePage::FindCaseSensitively ,[](bool){});
delayedHighlightText.clear();
}
} }
void ArticleView::loadProgress(int ){ void ArticleView::loadProgress(int ){