Skip to content

Commit f24880b

Browse files
committed
Merge pull request #6908
c53d48a BIP70: Chainparams: DRY: Make qt/guiutil.cpp fit BIP70 chain name strings (Jorge Timón)
2 parents 6176e9b + c53d48a commit f24880b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/qt/guiutil.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,12 @@ TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* t
581581
#ifdef WIN32
582582
boost::filesystem::path static StartupShortcutPath()
583583
{
584-
if (GetBoolArg("-testnet", false))
584+
std::string chain = ChainNameFromCommandLine();
585+
if (chain == CBaseChainParams::MAIN)
586+
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk";
587+
if (chain == CBaseChainParams::TESTNET) // Remove this special case when CBaseChainParams::TESTNET = "testnet4"
585588
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (testnet).lnk";
586-
else if (GetBoolArg("-regtest", false))
587-
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin (regtest).lnk";
588-
589-
return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk";
589+
return GetSpecialFolderPath(CSIDL_STARTUP) / strprintf("Bitcoin (%s).lnk", chain);
590590
}
591591

592592
bool GetStartOnSystemStartup()
@@ -719,15 +719,14 @@ bool SetStartOnSystemStartup(bool fAutoStart)
719719
boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);
720720
if (!optionFile.good())
721721
return false;
722+
std::string chain = ChainNameFromCommandLine();
722723
// Write a bitcoin.desktop file to the autostart directory:
723724
optionFile << "[Desktop Entry]\n";
724725
optionFile << "Type=Application\n";
725-
if (GetBoolArg("-testnet", false))
726-
optionFile << "Name=Bitcoin (testnet)\n";
727-
else if (GetBoolArg("-regtest", false))
728-
optionFile << "Name=Bitcoin (regtest)\n";
729-
else
726+
if (chain == CBaseChainParams::MAIN)
730727
optionFile << "Name=Bitcoin\n";
728+
else
729+
optionFile << strprintf("Name=Bitcoin (%s)\n", chain);
731730
optionFile << "Exec=" << pszExePath << strprintf(" -min -testnet=%d -regtest=%d\n", GetBoolArg("-testnet", false), GetBoolArg("-regtest", false));
732731
optionFile << "Terminal=false\n";
733732
optionFile << "Hidden=false\n";

0 commit comments

Comments
 (0)