From fef6d7be1f70cb51431afef608b037b85029c3c2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 13:37:26 +0200 Subject: fix(details): close the dialog before the search runs, not after The connection is direct, so emitting first runs the query synchronously: the model clears and the pane blanks while the modal dialog is still up, holding the m_items it was built from. Closing first leaves no window in which the dialog describes a thread the pane has already dropped. --- src/messageview.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/messageview.cpp b/src/messageview.cpp index 1e6c256..2e7e694 100644 --- a/src/messageview.cpp +++ b/src/messageview.cpp @@ -637,13 +637,17 @@ void MessageView::showDetailsDialog() // It CLOSES on the way out, and that is not tidiness. The dialog is modal, // so without this the query runs and the thread list repaints behind a // window the user still has to dismiss, making the search look like it did - // nothing. The dialog is also built from m_items, which the new query is - // about to replace, so what it displays would describe a thread the pane - // has already stopped showing. + // nothing. + // + // accept() BEFORE the emit, not after. The connection is direct, so the + // emit runs the query synchronously: the model clears and this pane blanks + // while the modal dialog is still up, holding the m_items it was built + // from. Closing first leaves no window in which the dialog describes a + // thread the pane has already dropped. connect(&dialog, &MessageDetailsDialog::searchRequested, this, [this, &dialog](const QString &query, bool extend) { - emit searchRequested(query, extend); dialog.accept(); + emit searchRequested(query, extend); }); dialog.exec(); -- cgit v1.2.3