[pim/kdepim-addons] kmail/editorplugins/insertemail: Verify that emails are not empty and close dialog when we double click

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit a4c23789b5100acfe910bf1c21029c9d235ea0a6 by Laurent Montel.
Committed on 16/08/2026 at 13:50.
Pushed by mlaurent into branch 'master'.

Verify that emails are not empty and close dialog when we double click

M  +5    -1    kmail/editorplugins/insertemail/selectmaildialog.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/a4c23789b5100acfe910bf1c21029c9d235ea0a6

diff --git a/kmail/editorplugins/insertemail/selectmaildialog.cpp b/kmail/editorplugins/insertemail/selectmaildialog.cpp
index bf7e34c94..31e36d9b5 100644
--- a/kmail/editorplugins/insertemail/selectmaildialog.cpp
+++ b/kmail/editorplugins/insertemail/selectmaildialog.cpp
@@ -53,11 +53,15 @@ QStringList SelectMailDialog::selectedEmails() const
 void SelectMailDialog::slotInsertEmails()
 {
     Q_EMIT emailSelected(selectedEmails());
+    accept();
 }
 
 void SelectMailDialog::accept()
 {
-    Q_EMIT emailSelected(selectedEmails());
+    const QStringList emails = selectedEmails();
+    if (!emails.isEmpty()) {
+        Q_EMIT emailSelected(emails);
+    }
     QDialog::accept();
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.