diff -r d0774130e860 -r afed72b544f0 src/version.cpp --- a/src/version.cpp Tue Jun 28 11:19:33 2022 +0300 +++ b/src/version.cpp Tue Jun 28 11:51:17 2022 +0300 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -29,35 +30,35 @@ # define HGTEXT HG_NODE #endif -QString detailedVersionString() +QString detailedVersionString(QLocale::FormatType formatType) { - return QStringLiteral(VERSION_STRING "-" HGTEXT) - + " (" + revisionDateString() + ")"; + return QStringLiteral(CMAKE_PROJECT_VERSION "-" HGTEXT) + + " (" + revisionDateString(formatType) + ")"; } -QString versionString() +QString versionString(QLocale::FormatType formatType) { #ifndef HG_VERSION_TAG - return detailedVersionString(); + return detailedVersionString(formatType); #else return QStringLiteral(HG_VERSION_TAG); #endif } -static QString makeFullVersionString() +static QString makeFullVersionString(QLocale::FormatType formatType) { - QString versionstring = APPNAME " " + versionString(); + QString versionstring = CMAKE_PROJECT_NAME " " + versionString(formatType); return versionstring; } -const QString& fullVersionString() +const QString& fullVersionString(QLocale::FormatType formatType) { - static const QString cached = makeFullVersionString(); + static const QString cached = makeFullVersionString(formatType); return cached; } -QString revisionDateString() +QString revisionDateString(QLocale::FormatType formatType) { const QDateTime dt = QDateTime::fromSecsSinceEpoch(HG_DATE_TIME); - return dt.toString(QObject::tr("d MMM yyyy")); + return QLocale{}.toString(dt.date(), formatType); }