mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 16:42:54 +01:00
scripted-diff: stop using the gArgs wrappers
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
1227be30ec
commit
bb81e17355
@@ -106,7 +106,7 @@ static QString GetLangTerritory()
|
||||
if(!lang_territory_qsettings.isEmpty())
|
||||
lang_territory = lang_territory_qsettings;
|
||||
// 3) -lang command line argument
|
||||
lang_territory = QString::fromStdString(GetArg("-lang", lang_territory.toStdString()));
|
||||
lang_territory = QString::fromStdString(gArgs.GetArg("-lang", lang_territory.toStdString()));
|
||||
return lang_territory;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ BitcoinApplication::BitcoinApplication(int &argc, char **argv):
|
||||
// This must be done inside the BitcoinApplication constructor, or after it, because
|
||||
// PlatformStyle::instantiate requires a QApplication
|
||||
std::string platformName;
|
||||
platformName = GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM);
|
||||
platformName = gArgs.GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM);
|
||||
platformStyle = PlatformStyle::instantiate(QString::fromStdString(platformName));
|
||||
if (!platformStyle) // Fall back to "other" if specified name not found
|
||||
platformStyle = PlatformStyle::instantiate("other");
|
||||
@@ -498,7 +498,7 @@ void BitcoinApplication::initializeResult(bool success)
|
||||
#endif
|
||||
|
||||
// If -min option passed, start window minimized.
|
||||
if(GetBoolArg("-min", false))
|
||||
if(gArgs.GetBoolArg("-min", false))
|
||||
{
|
||||
window->showMinimized();
|
||||
}
|
||||
@@ -550,7 +550,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/// 1. Parse command-line options. These take precedence over anything else.
|
||||
// Command-line options take precedence:
|
||||
ParseParameters(argc, argv);
|
||||
gArgs.ParseParameters(argc, argv);
|
||||
|
||||
// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
|
||||
|
||||
@@ -606,9 +606,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Show help message immediately after parsing command-line options (for "-lang") and setting locale,
|
||||
// but before showing splash screen.
|
||||
if (IsArgSet("-?") || IsArgSet("-h") || IsArgSet("-help") || IsArgSet("-version"))
|
||||
if (gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help") || gArgs.IsArgSet("-version"))
|
||||
{
|
||||
HelpMessageDialog help(nullptr, IsArgSet("-version"));
|
||||
HelpMessageDialog help(nullptr, gArgs.IsArgSet("-version"));
|
||||
help.showOrPrint();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -623,11 +623,11 @@ int main(int argc, char *argv[])
|
||||
if (!fs::is_directory(GetDataDir(false)))
|
||||
{
|
||||
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
|
||||
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(GetArg("-datadir", ""))));
|
||||
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
try {
|
||||
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
gArgs.ReadConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
} catch (const std::exception& e) {
|
||||
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
|
||||
QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
|
||||
@@ -691,12 +691,12 @@ int main(int argc, char *argv[])
|
||||
// Allow parameter interaction before we create the options model
|
||||
app.parameterSetup();
|
||||
// Load GUI settings from QSettings
|
||||
app.createOptionsModel(IsArgSet("-resetguisettings"));
|
||||
app.createOptionsModel(gArgs.IsArgSet("-resetguisettings"));
|
||||
|
||||
// Subscribe to global signals from core
|
||||
uiInterface.InitMessage.connect(InitMessage);
|
||||
|
||||
if (GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !GetBoolArg("-min", false))
|
||||
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
|
||||
app.createSplashScreen(networkStyle.data());
|
||||
|
||||
int rv = EXIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user