[kde-doc-english] [trojita] src/Gui: GUI: wrap the message-ids in brackets and support more of them

Jan Kundrát jkt at flaska.net
Mon Dec 9 11:01:20 UTC 2013


Git commit 1c774288a57cccabe8463da8ca436f0fc56f5bfe by Jan Kundrát.
Committed on 07/12/2013 at 13:52.
Pushed by jkt into branch 'master'.

GUI: wrap the message-ids in brackets and support more of them

Also be sure to not cast from QByteArray to QString directly.

M  +8    -1    src/Gui/ComposeWidget.cpp

http://commits.kde.org/trojita/1c774288a57cccabe8463da8ca436f0fc56f5bfe

diff --git a/src/Gui/ComposeWidget.cpp b/src/Gui/ComposeWidget.cpp
index d0817b4..d6c3331 100644
--- a/src/Gui/ComposeWidget.cpp
+++ b/src/Gui/ComposeWidget.cpp
@@ -1050,7 +1050,14 @@ void ComposeWidget::loadDraft(const QString &path)
         m_submission->composer()->setTimestamp(timestamp);
         if (!m_inReplyTo.isEmpty()) {
             ui->markAsReply->setVisible(true);
-            ui->markAsReply->setText(tr("In-Reply-To: %1").arg(QString(m_inReplyTo[0])));
+
+            // We do not have the message index at this point, but we can at least show the Message-Id here
+            QStringList inReplyTo;
+            Q_FOREACH(auto item, m_inReplyTo) {
+                // There's no HTML escaping to worry about
+                inReplyTo << QLatin1Char('<') + QString::fromUtf8(item.constData()) + QLatin1Char('>');
+            }
+            ui->markAsReply->setText(tr("In-Reply-To: %1").arg(inReplyTo.join(tr(", "))));
         }
     }
     if (version >= 3) {



More information about the kde-doc-english mailing list