diff options
author | Robert Adam <krzmbrzl@gmail.com> | 2021-02-23 19:37:56 +0300 |
---|---|---|
committer | Robert Adam <krzmbrzl@gmail.com> | 2021-02-23 19:39:58 +0300 |
commit | b20d3b2642de6143d810edd141826674158cf751 (patch) | |
tree | b2d021d06e9d31b6a8cb9cc96735c3d495bf19cf | |
parent | 2da30bbb6dff97329e568771174090f59c7fe4da (diff) |
FIX(client): Outdated copyright notice
The copyright end year displayed in the About dialog was hardcoded to
2020. This commit replaces the hardcoded version with a dynamic version
that uses the year the software was actually built as the end date.
Fixes #4784
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/licenses.h | 11 | ||||
-rw-r--r-- | src/mumble/About.cpp | 13 |
3 files changed, 25 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d09366fd..856d1eca1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,6 +105,9 @@ if(tests) endif() +# Make the build year accessible as a macro +add_compile_definitions(MUMBLE_BUILD_YEAR=${MUMBLE_BUILD_YEAR}) + add_subdirectory(src) if(g15 AND WIN32) diff --git a/src/licenses.h b/src/licenses.h index 505fe00a5..1087b89c8 100644 --- a/src/licenses.h +++ b/src/licenses.h @@ -18,7 +18,16 @@ struct ThirdPartyLicense { bool isEmpty() const { return (name == 0 && url == 0 && license == 0); } }; -static const char *licenseMumble = "Copyright (C) 2005-2020 The Mumble Developers\n" +#define DOQUOTE(arg) #arg +#define QUOTE(arg) DOQUOTE(arg) + +#ifdef MUMBLE_BUILD_YEAR +# define COPYRIGHT_END QUOTE(MUMBLE_BUILD_YEAR) +#else +# define COPYRIGHT_END "now" +#endif + +static const char *licenseMumble = "Copyright (C) 2005-" COPYRIGHT_END " The Mumble Developers\n" "\n" "A list of The Mumble Developers can be found in the\n" "AUTHORS file at the root of the Mumble source tree\n" diff --git a/src/mumble/About.cpp b/src/mumble/About.cpp index 77d147598..5b11d4be3 100644 --- a/src/mumble/About.cpp +++ b/src/mumble/About.cpp @@ -16,6 +16,9 @@ // (like protobuf 3.7 does). As such, for now, we have to make this our last include. #include "Global.h" +#define DOQUOTE(arg) #arg +#define QUOTE(arg) DOQUOTE(arg) + AboutDialog::AboutDialog(QWidget *p) : QDialog(p) { setWindowTitle(tr("About Mumble")); @@ -55,13 +58,21 @@ AboutDialog::AboutDialog(QWidget *p) : QDialog(p) { QLabel *text = new QLabel(about); text->setTextInteractionFlags(Qt::TextBrowserInteraction); text->setOpenExternalLinks(true); + + QString copyrightText; +#ifdef MUMBLE_BUILD_YEAR + copyrightText = "Copyright 2005-" QUOTE(MUMBLE_BUILD_YEAR) " The Mumble Developers"; +#else // MUMBLE_BUILD_YEAR + copyrightText = "Copyright 2005-now The Mumble Developers"; +#endif // MUMBLE_BUILD_YEAR + text->setText(tr("<h3>Mumble (%1)</h3>" "<p>%3</p>" "<p><b>A voice-chat utility for gamers</b></p>" "<p><tt><a href=\"%2\">%2</a></tt></p>") .arg(QLatin1String(MUMBLE_RELEASE)) .arg(QLatin1String("https://www.mumble.info/")) - .arg(QLatin1String("Copyright 2005-2020 The Mumble Developers"))); + .arg(copyrightText)); QHBoxLayout *qhbl = new QHBoxLayout(about); qhbl->addWidget(icon); qhbl->addWidget(text); |