Added wrapping for backward finding

remotes/origin/falkon
nowrep 15 years ago
parent 2449573c13
commit ea6a0078e0
  1. 5
      src/other/sourceviewersearch.cpp
  2. 2
      src/other/sourceviewersearch.ui

@ -52,7 +52,8 @@ SourceViewerSearch::SourceViewerSearch(SourceViewer* parent) :
ui->lineEdit->setFocus();
startAnimation();
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->lineEdit, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(next()));
connect(ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(next()));
connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(next()));
connect(ui->next, SIGNAL(clicked()), this, SLOT(next()));
connect(ui->previous, SIGNAL(clicked()), this, SLOT(previous()));
}
@ -97,7 +98,7 @@ bool SourceViewerSearch::find(QTextDocument::FindFlags flags)
if (!m_sourceViewer->sourceEdit()->find(string, flags)) {
QTextCursor cursor = m_sourceViewer->sourceEdit()->textCursor();
m_sourceViewer->sourceEdit()->moveCursor(QTextCursor::Start);
m_sourceViewer->sourceEdit()->moveCursor( (flags == QTextDocument::FindBackward ) ? QTextCursor::End : QTextCursor::Start );
if (!m_sourceViewer->sourceEdit()->find(string,flags)) {
cursor.clearSelection();
m_sourceViewer->sourceEdit()->setTextCursor(cursor);

@ -32,7 +32,7 @@
<string/>
</property>
<property name="shortcut">
<string>Esc</string>
<string notr="true">Esc</string>
</property>
<property name="autoRaise">
<bool>true</bool>

Loading…
Cancel
Save