aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2014-01-20 18:13:31 (GMT)
committerDominik Haumann <dhaumann@kde.org>2014-01-20 18:13:31 (GMT)
commit79fd507a4f2ad6b774e25752592db7e9cc0dc4fa (patch)
tree1401889a063bcd83e51ea2f7e14941c3a9113251
parent0c3b65574284797539197d7b720d2a9a31b21c91 (diff)
fix queuing of search wrap messages when holding down F3
needs to be backported
-rw-r--r--src/search/katesearchbar.cpp22
-rw-r--r--src/search/katesearchbar.h2
2 files changed, 18 insertions, 6 deletions
diff --git a/src/search/katesearchbar.cpp b/src/search/katesearchbar.cpp
index 3e993df..9f6c6d8 100644
--- a/src/search/katesearchbar.cpp
+++ b/src/search/katesearchbar.cpp
@@ -611,12 +611,22 @@ bool KateSearchBar::find(SearchDirection searchDirection, const QString *replace
}
if (wrap) {
- const QString msg = (searchDirection == SearchForward) ? i18n("Continuing search from top") : i18n("Continuing search from bottom");
- QPointer<KTextEditor::Message> message = new KTextEditor::Message(msg, KTextEditor::Message::Information);
- message->setPosition((searchDirection == KateSearchBar::SearchForward) ? KTextEditor::Message::TopInView : KTextEditor::Message::BottomInView);
- message->setAutoHide(2000);
- message->setAutoHideMode(KTextEditor::Message::Immediate);
- m_view->doc()->postMessage(message);
+ // show message widget when wrapping (if not already present)
+ if (searchDirection == SearchForward && !m_wrappedTopMessage) {
+ const QString msg = i18n("Continuing search from top");
+ m_wrappedTopMessage = new KTextEditor::Message(msg, KTextEditor::Message::Information);
+ m_wrappedTopMessage->setPosition(KTextEditor::Message::TopInView);
+ m_wrappedTopMessage->setAutoHide(2000);
+ m_wrappedTopMessage->setAutoHideMode(KTextEditor::Message::Immediate);
+ m_view->doc()->postMessage(m_wrappedTopMessage);
+ } else if (searchDirection == SearchBackward && !m_wrappedBottomMessage) {
+ const QString msg = i18n("Continuing search from bottom");
+ m_wrappedBottomMessage = new KTextEditor::Message(msg, KTextEditor::Message::Information);
+ m_wrappedBottomMessage->setPosition(KTextEditor::Message::BottomInView);
+ m_wrappedBottomMessage->setAutoHide(2000);
+ m_wrappedBottomMessage->setAutoHideMode(KTextEditor::Message::Immediate);
+ m_view->doc()->postMessage(m_wrappedBottomMessage);
+ }
inputRange = m_view->document()->documentRange();
match.searchText(inputRange, searchPattern());
diff --git a/src/search/katesearchbar.h b/src/search/katesearchbar.h
index 5c3d681..f89602c 100644
--- a/src/search/katesearchbar.h
+++ b/src/search/katesearchbar.h
@@ -178,6 +178,8 @@ private:
KateViewConfig *const m_config;
QList<KTextEditor::MovingRange *> m_hlRanges;
QPointer<KTextEditor::Message> m_infoMessage;
+ QPointer<KTextEditor::Message> m_wrappedTopMessage;
+ QPointer<KTextEditor::Message> m_wrappedBottomMessage;
// Shared by both dialogs
QVBoxLayout *const m_layout;