[kde-doc-english] [trojita] src/Gui: GUI: display a warning when we unexpectedly cannot determine the list of recipients

Jan Kundrát jkt at flaska.net
Sat Jan 5 15:04:28 UTC 2013


Git commit 656491d7d8b925d6250042d1755a9a33cc87c547 by Jan Kundrát.
Committed on 05/01/2013 at 14:53.
Pushed by jkt into branch 'master'.

GUI: display a warning when we unexpectedly cannot determine the list of recipients

M  +19   -1    src/Gui/MessageView.cpp

http://commits.kde.org/trojita/656491d7d8b925d6250042d1755a9a33cc87c547

diff --git a/src/Gui/MessageView.cpp b/src/Gui/MessageView.cpp
index 924d044..70d9152 100644
--- a/src/Gui/MessageView.cpp
+++ b/src/Gui/MessageView.cpp
@@ -25,6 +25,7 @@
 #include <QKeyEvent>
 #include <QLabel>
 #include <QMenu>
+#include <QMessageBox>
 #include <QTextDocument>
 #include <QTimer>
 #include <QUrl>
@@ -436,8 +437,25 @@ void MessageView::reply(MainWindow *mainWindow, Composer::ReplyMode mode)
                 message.data(Imap::Mailbox::RoleMessageHeaderReferences).value<QList<QByteArray> >() << messageId,
                 message
                 );
+
     bool ok = w->setReplyMode(mode);
-    Q_ASSERT(ok);
+    if (!ok) {
+        QString err;
+        switch (mode) {
+        case Composer::REPLY_ALL:
+            // do nothing
+            break;
+        case Composer::REPLY_LIST:
+            err = tr("It doesn't look like this is a message to the mailing list. Please file in the recipients manually.");
+            break;
+        case Composer::REPLY_PRIVATE:
+            err = trUtf8("Trojitá was unable to safely determine the real e-mail address of the author of the message. "
+                         "You might want to use the \"Reply All\" funciton and trim the list of addresses manually.");
+            break;
+        }
+        if (!err.isEmpty())
+            QMessageBox::warning(w, tr("Cannot Determine Recipients"), err);
+    }
 }
 
 void MessageView::externalsRequested(const QUrl &url)



More information about the kde-doc-english mailing list