make CopyrightHolders more generic

This commit is contained in:
UdjinM6 2017-12-11 17:20:11 +03:00 committed by Alexander Block
parent 4e0bb527d0
commit af5aece96b
4 changed files with 6 additions and 6 deletions

View File

@ -643,7 +643,7 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo() std::string LicenseInfo()
{ {
// todo: remove urls from translations on next change // 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" + "\n" +
_("This is experimental software.") + "\n" + _("This is experimental software.") + "\n" +
"\n" + "\n" +

View File

@ -48,7 +48,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
// define text to place // define text to place
QString titleText = tr(PACKAGE_NAME); QString titleText = tr(PACKAGE_NAME);
QString versionText = QString(tr("Version %1")).arg(QString::fromStdString(FormatFullVersion())); 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(); QString titleAddText = networkStyle->getTitleAddText();
// networkstyle.cpp can't (yet) read themes, so we do it here to get the correct Splash-screen // networkstyle.cpp can't (yet) read themes, so we do it here to get the correct Splash-screen
QString splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash"; QString splashScreenPath = ":/images/" + GUIUtil::getThemeName() + "/splash";

View File

@ -954,14 +954,14 @@ int GetNumCores()
#endif #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) { if (strCopyrightHolders.find("%s") != strCopyrightHolders.npos) {
strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION)); strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION));
} }
if (strCopyrightHolders.find("Bitcoin Core developers") == strCopyrightHolders.npos) { 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; return strCopyrightHolders;
} }

View File

@ -271,7 +271,7 @@ template <typename Callable> 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 * @brief Converts version strings to 4-byte unsigned integer