mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-12 20:51:17 +00:00
Fix Enter turning the thumbnail filter bar into a regular search bar
BUGS: 375755
This commit is contained in:
parent
be6b0b6f48
commit
96d8953878
|
@ -588,8 +588,8 @@ class OKULARCORE_EXPORT Document : public QObject
|
||||||
NextMatch, ///< Search next match
|
NextMatch, ///< Search next match
|
||||||
PreviousMatch, ///< Search previous match
|
PreviousMatch, ///< Search previous match
|
||||||
AllDocument, ///< Search complete document
|
AllDocument, ///< Search complete document
|
||||||
GoogleAll, ///< Search all words in google style
|
GoogleAll, ///< Search complete document (all words in google style)
|
||||||
GoogleAny ///< Search any words in google style
|
GoogleAny ///< Search complete document (any words in google style)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,7 +39,6 @@ SearchLineEdit::SearchLineEdit( QWidget * parent, Okular::Document * document )
|
||||||
connect(m_inputDelayTimer, &QTimer::timeout, this, &SearchLineEdit::startSearch);
|
connect(m_inputDelayTimer, &QTimer::timeout, this, &SearchLineEdit::startSearch);
|
||||||
|
|
||||||
connect(this, &SearchLineEdit::textChanged, this, &SearchLineEdit::slotTextChanged);
|
connect(this, &SearchLineEdit::textChanged, this, &SearchLineEdit::slotTextChanged);
|
||||||
connect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit::slotReturnPressed);
|
|
||||||
connect(document, &Okular::Document::searchFinished, this, &SearchLineEdit::searchFinished);
|
connect(document, &Okular::Document::searchFinished, this, &SearchLineEdit::searchFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +64,16 @@ void SearchLineEdit::setSearchType( Okular::Document::SearchType type )
|
||||||
if ( type == m_searchType )
|
if ( type == m_searchType )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
disconnect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit::slotReturnPressed);
|
||||||
|
|
||||||
m_searchType = type;
|
m_searchType = type;
|
||||||
|
|
||||||
|
// Only connect Enter for next/prev searches, the rest of searches are document global so
|
||||||
|
// next/prev serach does not make sense for them
|
||||||
|
if (m_searchType == Okular::Document::NextMatch || m_searchType == Okular::Document::PreviousMatch) {
|
||||||
|
connect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit::slotReturnPressed);
|
||||||
|
}
|
||||||
|
|
||||||
if ( !m_changed )
|
if ( !m_changed )
|
||||||
m_changed = ( m_searchType != Okular::Document::NextMatch && m_searchType != Okular::Document::PreviousMatch );
|
m_changed = ( m_searchType != Okular::Document::NextMatch && m_searchType != Okular::Document::PreviousMatch );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue