From 973ec13ad89deacbb6ec732e24740fb904dec8db Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Fri, 5 Mar 2021 23:57:38 +0100
Subject: [PATCH] Add linebreaks to fingerprint

---
 src/Utils.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Utils.cpp b/src/Utils.cpp
index 07fe8a00e..7106d865a 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -351,11 +351,15 @@ utils::humanReadableFingerprint(const std::string &ed25519)
 QString
 utils::humanReadableFingerprint(const QString &ed25519)
 {
-        QStringList fingerprintList;
+        QString fingerprint;
         for (int i = 0; i < ed25519.length(); i = i + 4) {
-                fingerprintList << ed25519.mid(i, 4);
+                fingerprint.append(ed25519.midRef(i, 4));
+                if (i > 0 && i % 16 == 12)
+                        fingerprint.append('\n');
+                else if (i < ed25519.length())
+                        fingerprint.append(' ');
         }
-        return fingerprintList.join(" ");
+        return fingerprint;
 }
 
 QString
-- 
GitLab