From 56a64ae4c5c4cf3fb567445a1bcec0f3a9db143c Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Wed, 2 Aug 2023 02:34:01 +0200 Subject: Initialize find dialog with text from main window Properly emit the text that was entered in the search bar before the find dialog was opened. This makes sure that it is queried as expected by the user. --- src/finddialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/finddialog.cpp') diff --git a/src/finddialog.cpp b/src/finddialog.cpp index 4de17d0..26538d2 100644 --- a/src/finddialog.cpp +++ b/src/finddialog.cpp @@ -47,8 +47,10 @@ void FindDialog::on_textInputSearch_textEdited(const QString &text) { differed_search->start(); } -void FindDialog::set_search_text(const QString &text) { +void FindDialog::set_search_text(const QString &text, bool search_immediately) { ui->textInputSearch->setText(text); + if (search_immediately) init_search(); + else on_textInputSearch_textEdited(text); } inline void FindDialog::run_search() { -- cgit v1.2.3-54-g00ecf