From c3eb6b2dbff2758bb6a1cc296a02d417ca4c04a4 Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Wed, 11 Jan 2023 16:59:05 +0100 Subject: [PATCH] GODT-1797: copyright notice shows a date range with the build year. --- internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp | 8 ++++++++ internal/frontend/bridge-gui/bridge-gui/QMLBackend.h | 1 + internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp index b05c2f07..e3dc104f 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp @@ -102,6 +102,14 @@ bool QMLBackend::waitForEventStreamReaderToFinish(qint32 timeoutMs) { } +//**************************************************************************************************************************************************** +/// \return The build year as a string (e.g. 2023) +//**************************************************************************************************************************************************** +QString QMLBackend::buildYear() { + return QString(__DATE__).right(4); +} + + //**************************************************************************************************************************************************** /// \return The position of the cursor. //**************************************************************************************************************************************************** diff --git a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h index deef93c9..3e41a5d9 100644 --- a/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h +++ b/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h @@ -45,6 +45,7 @@ public: // member functions. bool waitForEventStreamReaderToFinish(qint32 timeoutMs); ///< Wait for the event stream reader to finish. // invokable methods can be called from QML. They generally return a value, which slots cannot do. + Q_INVOKABLE static QString buildYear(); ///< Return the application build year. Q_INVOKABLE QPoint getCursorPos() const; ///< Retrieve the cursor position. Q_INVOKABLE bool isPortFree(int port) const; ///< Check if a given network port is available. Q_INVOKABLE QString nativePath(QUrl const &url) const; ///< Retrieve the native path of a local URL. diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml index 3b553bbd..21b48555 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/HelpView.qml @@ -108,9 +108,10 @@ SettingsView { horizontalAlignment: Text.AlignHCenter - text: qsTr("%1 v%2
© 2021 %3
%4 %5
%6"). + text: qsTr("%1 v%2
© 2017-%3 %4
%5 %6
%7"). arg(Backend.appname). arg(Backend.version). + arg(Backend.buildYear()). arg(Backend.vendor). arg(link(Backend.licensePath, qsTr("License"))). arg(link(Backend.dependencyLicensesLink, qsTr("Dependencies"))).