Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
replaceAll was called multiple times as a new "setQuery" added a new
connection
  • Loading branch information
sunderme committed Sep 24, 2024
1 parent 86c9fdb commit c4b16da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/searchresultwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : QWidget(parent), query
replaceButton = new QPushButton(tr("Replace all"));
m_replaceByLabel=new QLabel(tr("Replace by:"));

connect(replaceTextEdit, &QLineEdit::textChanged, this, &SearchResultWidget::replaceTextEditChanged);
connect(replaceTextEdit, SIGNAL(returnPressed()), query, SLOT(replaceAll()));
connect(replaceButton, &QPushButton::clicked, this, &SearchResultWidget::replaceButtonClicked);

// special widgets for search in files
m_fileFilterBox = new QComboBox;
m_fileFilterBox->addItem(tr("TeX files")+" (*.tex)");
Expand Down Expand Up @@ -102,9 +106,6 @@ void SearchResultWidget::setQuery(SearchQuery *sq)
replaceTextEdit->setEnabled(replaceAllowed);
replaceTextEdit->setText(query->replacementText());
replaceButton->setEnabled(replaceAllowed);
connect(replaceTextEdit, &QLineEdit::textChanged, this, &SearchResultWidget::replaceTextEditChanged);
connect(replaceTextEdit, SIGNAL(returnPressed()), query, SLOT(replaceAll()));
connect(replaceButton, &QPushButton::clicked, this, &SearchResultWidget::replaceButtonClicked);

searchTree->setModel(query->model());
connect(query, &SearchQuery::runCompleted, this, &SearchResultWidget::searchCompleted);
Expand Down

0 comments on commit c4b16da

Please sign in to comment.