From 298c241db4e4b8980e87f0be04e5f8b02c3c6f93 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 30 Nov 2022 19:39:34 +0100 Subject: [PATCH] Fix the version string for released builds --- changelog/unreleased/10329 | 5 +++++ src/common/version.cpp.in | 9 +++++++++ src/common/version.h | 5 +---- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/10329 diff --git a/changelog/unreleased/10329 b/changelog/unreleased/10329 new file mode 100644 index 00000000000..d16b62d836f --- /dev/null +++ b/changelog/unreleased/10329 @@ -0,0 +1,5 @@ +Bugfix: Fix the display of the version string for released builds + +We removed a trailing `-` in the version string of released clients. + +https://github.com/owncloud/client/pull/10329 diff --git a/src/common/version.cpp.in b/src/common/version.cpp.in index 8bfa00e4574..1b4c8b2e814 100644 --- a/src/common/version.cpp.in +++ b/src/common/version.cpp.in @@ -39,3 +39,12 @@ QString OCC::Version::suffix() { return QStringLiteral("@MIRALL_VERSION_SUFFIX@"); } + +QString OCC::Version::displayString() +{ + constexpr bool hasSuffix = !std::string_view("@MIRALL_VERSION_SUFFIX@").empty(); + if (hasSuffix) { + return QStringLiteral("%1-%2").arg(versionWithBuildNumber().toString(), suffix()); + } + return versionWithBuildNumber().toString(); +} \ No newline at end of file diff --git a/src/common/version.h b/src/common/version.h index 2d93d31256f..ba9a9029c56 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -43,8 +43,5 @@ OCSYNC_EXPORT QString suffix(); */ OCSYNC_EXPORT QString gitSha(); -inline auto displayString() -{ - return QStringLiteral("%1-%2").arg(versionWithBuildNumber().toString(), suffix()); -} +OCSYNC_EXPORT QString displayString(); }