From 571cfb16ccfd7ac6bc59b5acc77a94d0bdcf0990 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 13 Apr 2025 01:03:57 +0200 Subject: feat: add openpgp smart card support --- src/core/utils/CommonUtils.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/utils/CommonUtils.cpp') diff --git a/src/core/utils/CommonUtils.cpp b/src/core/utils/CommonUtils.cpp index 9687acd4..0adc4d7f 100644 --- a/src/core/utils/CommonUtils.cpp +++ b/src/core/utils/CommonUtils.cpp @@ -98,4 +98,13 @@ auto GFUnStrDup(const char* s) -> QString { auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool { return QString::fromLocal8Bit(qgetenv("container")) == "flatpak"; } + +auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s) + -> int { + // s is a hex-encoded, unsigned int-packed version tuple, + // i.e. each byte represents one part of the version tuple + bool ok; + const auto version = s.toUtf8().toUInt(&ok, 16); + return ok ? static_cast(version) : -1; +} } // namespace GpgFrontend \ No newline at end of file -- cgit v1.2.3