aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils/CommonUtils.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-12 15:08:38 +0000
committersaturneric <[email protected]>2024-01-12 15:08:38 +0000
commit6983b5c1dd82d159236ebd06cf17f071cc9c1ee9 (patch)
treefc53f790e33546320b2ecd306a1a9ade6fbdfe7a /src/core/utils/CommonUtils.cpp
parentfix: slove a heap-use-after-free issue (diff)
downloadGpgFrontend-6983b5c1dd82d159236ebd06cf17f071cc9c1ee9.tar.gz
GpgFrontend-6983b5c1dd82d159236ebd06cf17f071cc9c1ee9.zip
refactor: remove boost and use QString instead of std::filesystem::path
Diffstat (limited to 'src/core/utils/CommonUtils.cpp')
-rw-r--r--src/core/utils/CommonUtils.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/utils/CommonUtils.cpp b/src/core/utils/CommonUtils.cpp
index 0e6eaf64..0b182241 100644
--- a/src/core/utils/CommonUtils.cpp
+++ b/src/core/utils/CommonUtils.cpp
@@ -28,17 +28,15 @@
#include "CommonUtils.h"
-#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
-
namespace GpgFrontend {
auto BeautifyFingerprint(QString fingerprint) -> QString {
auto len = fingerprint.size();
- QTextStream out;
+ QString buffer;
+ QTextStream out(&buffer);
decltype(len) count = 0;
while (count < len) {
- if ((count != 0U) && !(count % 5)) out << " ";
+ if ((count != 0U) && ((count % 5) == 0)) out << " ";
out << fingerprint[count];
count++;
}