refactor: add unused ArgsManager to replace gArgs

This commit is contained in:
Ivan Metlushko
2020-07-19 14:31:51 +07:00
parent 2f71a1ea35
commit a316e9ce26
10 changed files with 28 additions and 23 deletions

View File

@@ -411,7 +411,7 @@ WId BitcoinApplication::getMainWinId() const
return window->winId();
}
static void SetupUIArgs()
static void SetupUIArgs(ArgsManager& argsman)
{
gArgs.AddArg("-choosedatadir", strprintf("Choose data directory on startup (default: %u)", DEFAULT_CHOOSE_DATADIR), ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
gArgs.AddArg("-lang=<lang>", "Set language, for example \"de_DE\" (default: system locale)", ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
@@ -454,7 +454,7 @@ int GuiMain(int argc, char* argv[])
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
// Command-line options take precedence:
node->setupServerArgs();
SetupUIArgs();
SetupUIArgs(gArgs);
std::string error;
if (!node->parseParameters(argc, argv, error)) {
node->initError(strprintf(Untranslated("Error parsing command line arguments: %s\n"), error));