mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
opt: erase the need to use extra variable to hold the ftsSearchPanel state
This commit is contained in:
parent
39b207fa78
commit
585d547d28
|
@ -607,7 +607,7 @@ bool ArticleView::handleF3( QObject * /*obj*/, QEvent * ev )
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if ( ke->key() == Qt::Key_F3 && ftsSearchIsOpened ) {
|
||||
if ( ke->key() == Qt::Key_F3 && ftsSearchPanel->isVisible() ) {
|
||||
if ( !ke->modifiers() ) {
|
||||
if ( ev->type() == QEvent::KeyPress )
|
||||
on_ftsSearchNext_clicked();
|
||||
|
@ -1930,7 +1930,7 @@ void ArticleView::openSearch()
|
|||
if ( !isVisible() )
|
||||
return;
|
||||
|
||||
if ( ftsSearchIsOpened )
|
||||
if ( ftsSearchPanel->isVisible() )
|
||||
closeSearch();
|
||||
|
||||
if ( !searchPanel->isVisible() ) {
|
||||
|
@ -2070,10 +2070,9 @@ bool ArticleView::closeSearch()
|
|||
|
||||
return true;
|
||||
}
|
||||
else if ( ftsSearchIsOpened ) {
|
||||
if ( ftsSearchPanel->isVisible() ) {
|
||||
firstAvailableText.clear();
|
||||
uniqueMatches.clear();
|
||||
ftsSearchIsOpened = false;
|
||||
|
||||
ftsSearchPanel->hide();
|
||||
webview->setFocus();
|
||||
|
@ -2084,7 +2083,6 @@ bool ArticleView::closeSearch()
|
|||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2156,7 +2154,7 @@ void ArticleView::dictionaryClear( const ActiveDictIds & ad )
|
|||
|
||||
void ArticleView::performFtsFindOperation( bool backwards )
|
||||
{
|
||||
if ( !ftsSearchIsOpened )
|
||||
if ( !ftsSearchPanel->isVisible() )
|
||||
return;
|
||||
|
||||
if ( firstAvailableText.isEmpty() ) {
|
||||
|
|
|
@ -84,7 +84,7 @@ class ArticleView: public QWidget
|
|||
/// Search in results of full-text search
|
||||
QString firstAvailableText;
|
||||
QStringList uniqueMatches;
|
||||
bool ftsSearchIsOpened = false;
|
||||
|
||||
bool ftsSearchMatchCase = false;
|
||||
|
||||
QString delayedHighlightText;
|
||||
|
|
Loading…
Reference in a new issue