From kde-commits Tue Jan 31 23:49:58 2017 From: Albert Astals Cid Date: Tue, 31 Jan 2017 23:49:58 +0000 To: kde-commits Subject: [okular/Applications/16.12] /: Fix Enter turning the thumbnail filter bar into a regular search bar Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=148590661132424 Git commit 96d8953878e00543194913a674497c1e656c28de by Albert Astals Cid. Committed on 31/01/2017 at 23:49. Pushed by aacid into branch 'Applications/16.12'. Fix Enter turning the thumbnail filter bar into a regular search bar BUGS: 375755 M +2 -2 core/document.h M +8 -1 ui/searchlineedit.cpp https://commits.kde.org/okular/96d8953878e00543194913a674497c1e656c28de diff --git a/core/document.h b/core/document.h index 9f1106f8..d92374fa 100644 --- a/core/document.h +++ b/core/document.h @@ -588,8 +588,8 @@ class OKULARCORE_EXPORT Document : public QObject NextMatch, ///< Search next match PreviousMatch, ///< Search previous match AllDocument, ///< Search complete document - GoogleAll, ///< Search all words in google style - GoogleAny ///< Search any words in google style + GoogleAll, ///< Search complete document (all words in go= ogle style) + GoogleAny ///< Search complete document (any words in go= ogle style) }; = /** diff --git a/ui/searchlineedit.cpp b/ui/searchlineedit.cpp index 85516efb..baac8be0 100644 --- a/ui/searchlineedit.cpp +++ b/ui/searchlineedit.cpp @@ -39,7 +39,6 @@ SearchLineEdit::SearchLineEdit( QWidget * parent, Okular:= :Document * document ) connect(m_inputDelayTimer, &QTimer::timeout, this, &SearchLineEdit::st= artSearch); = connect(this, &SearchLineEdit::textChanged, this, &SearchLineEdit::slo= tTextChanged); - connect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit::s= lotReturnPressed); connect(document, &Okular::Document::searchFinished, this, &SearchLine= Edit::searchFinished); } = @@ -65,8 +64,16 @@ void SearchLineEdit::setSearchType( Okular::Document::Se= archType type ) if ( type =3D=3D m_searchType ) return; = + disconnect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdit= ::slotReturnPressed); + m_searchType =3D 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 =3D=3D Okular::Document::NextMatch || m_searchType = =3D=3D Okular::Document::PreviousMatch) { + connect(this, &SearchLineEdit::returnPressed, this, &SearchLineEdi= t::slotReturnPressed); + } + if ( !m_changed ) m_changed =3D ( m_searchType !=3D Okular::Document::NextMatch && m= _searchType !=3D Okular::Document::PreviousMatch ); }