telepathy-qt: Refactor Message::text()

Alexandr Akulich kaffeine at kemper.freedesktop.org
Mon Sep 2 18:00:10 UTC 2019


Module: telepathy-qt
Branch: master
Commit: 166004d698faa9db4e3874af128496f0188fe69a
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=166004d698faa9db4e3874af128496f0188fe69a

Author: Alexander Akulich <akulichalexander at gmail.com>
Date:   Sat May  5 01:58:47 2018 +0300

Refactor Message::text()

---

 TelepathyQt/message.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/TelepathyQt/message.cpp b/TelepathyQt/message.cpp
index bafec2b2..6994028c 100644
--- a/TelepathyQt/message.cpp
+++ b/TelepathyQt/message.cpp
@@ -376,10 +376,10 @@ QString Message::text() const
     QString text;
 
     for (int i = 1; i < size(); i++) {
-        QString altGroup = stringOrEmptyFromPart(mPriv->parts, i, "alternative");
-        QString contentType = stringOrEmptyFromPart(mPriv->parts, i, "content-type");
+        const QString contentType = stringOrEmptyFromPart(mPriv->parts, i, "content-type");
 
         if (contentType == QLatin1String("text/plain")) {
+            const QString altGroup = stringOrEmptyFromPart(mPriv->parts, i, "alternative");
             if (!altGroup.isEmpty()) {
                 if (altGroupsUsed.contains(altGroup)) {
                     continue;



More information about the telepathy-commits mailing list