From af5aece96b4123ceb2af1cd6967cc0e014e8ea1b Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 11 Dec 2017 17:20:11 +0300 Subject: [PATCH] make CopyrightHolders more generic --- src/init.cpp | 2 +- src/qt/splashscreen.cpp | 2 +- src/util.cpp | 6 +++--- src/util.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 9797943fe..2ac4e99a9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -643,7 +643,7 @@ std::string HelpMessage(HelpMessageMode mode) std::string LicenseInfo() { // todo: remove urls from translations on next change - return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" + + return CopyrightHolders(_("Copyright (C)"), 2014, COPYRIGHT_YEAR) + "\n" + "\n" + _("This is experimental software.") + "\n" + "\n" + diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index f28c461f7..24ccbcca8 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -48,7 +48,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // define text to place QString titleText = tr(PACKAGE_NAME); QString versionText = QString(tr("Version %1")).arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str()); + QString copyrightText = QString::fromUtf8(CopyrightHolders("\xc2\xA9", 2014, COPYRIGHT_YEAR).c_str()); QString titleAddText = networkStyle->getTitleAddText(); // networkstyle.cpp can't (yet) read themes, so we do it here to get the correct Splash-screen QString splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash"; diff --git a/src/util.cpp b/src/util.cpp index f833f1774..37d3f99ac 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -954,14 +954,14 @@ int GetNumCores() #endif } -std::string CopyrightHolders(const std::string& strPrefix) +std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYear, unsigned int nEndYear) { - std::string strCopyrightHolders = strPrefix + _(COPYRIGHT_HOLDERS); + std::string strCopyrightHolders = strPrefix + strprintf(" %u-%u ", nStartYear, nEndYear) + _(COPYRIGHT_HOLDERS); if (strCopyrightHolders.find("%s") != strCopyrightHolders.npos) { strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION)); } if (strCopyrightHolders.find("Bitcoin Core developers") == strCopyrightHolders.npos) { - strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers"; + strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2009, nEndYear) + "The Bitcoin Core developers"; } return strCopyrightHolders; } diff --git a/src/util.h b/src/util.h index 725349f00..f1491623e 100644 --- a/src/util.h +++ b/src/util.h @@ -271,7 +271,7 @@ template void TraceThread(const char* name, Callable func) } } -std::string CopyrightHolders(const std::string& strPrefix); +std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYear, unsigned int nEndYear); /** * @brief Converts version strings to 4-byte unsigned integer