diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-14 13:37:26 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-14 13:37:26 +0200 |
| commit | fef6d7be1f70cb51431afef608b037b85029c3c2 (patch) | |
| tree | 5b2aaac5bf7e2cc196d50799812c1d61ea2da028 | |
| parent | 5b18bc2123d8bf0830ebf8ab3f735c9496342e97 (diff) | |
| download | qtmaildir-fef6d7be1f70cb51431afef608b037b85029c3c2.tar.gz qtmaildir-fef6d7be1f70cb51431afef608b037b85029c3c2.zip | |
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.
| -rw-r--r-- | src/messageview.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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(); |
