diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-03-05 23:57:38 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-03-06 19:36:18 +0100 |
commit | 973ec13ad89deacbb6ec732e24740fb904dec8db (patch) | |
tree | bf5cc071b24be392fb8f2e5cbeab48db0309dd4b /src/Utils.cpp | |
parent | Merge pull request #506 from Nheko-Reborn/timeline-buttons (diff) | |
download | nheko-973ec13ad89deacbb6ec732e24740fb904dec8db.tar.xz |
Add linebreaks to fingerprint
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r-- | src/Utils.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp index 07fe8a00..7106d865 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 |