diff options
Diffstat (limited to 'src/core/utils/CommonUtils.cpp')
-rw-r--r-- | src/core/utils/CommonUtils.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/utils/CommonUtils.cpp b/src/core/utils/CommonUtils.cpp index 569d79e1..fc5af6c8 100644 --- a/src/core/utils/CommonUtils.cpp +++ b/src/core/utils/CommonUtils.cpp @@ -100,16 +100,15 @@ auto GFUnStrDup(const char* s) -> QString { return GFUnStrDup(const_cast<char*>(s)); } -auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool { +auto GF_CORE_EXPORT IsFlatpakENV() -> bool { return QString::fromLocal8Bit(qgetenv("container")) == "flatpak"; } -auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool { +auto GF_CORE_EXPORT IsAppImageENV() -> bool { return !QString::fromLocal8Bit(qgetenv("APPIMAGE")).isEmpty(); } -auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s) - -> int { +auto GF_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; @@ -120,7 +119,7 @@ auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s) const auto kReEmail = QRegularExpression{ R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"}; -auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString& str) -> bool { +auto GF_CORE_EXPORT IsEmailAddress(const QString& str) -> bool { return kReEmail.match(str).hasMatch(); } } // namespace GpgFrontend
\ No newline at end of file |