qt: fetch existing parameters when building parameter list

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
Kittywhiskers Van Gogh 2022-06-02 23:48:27 +05:30
parent b9f1ddf766
commit 104d4d6d99

View File

@ -820,8 +820,17 @@ void RPCConsole::walletReindex()
void RPCConsole::buildParameterlist(QString arg)
{
// Get command-line arguments and remove the application name
QStringList args = QApplication::arguments();
args.removeFirst();
QStringList args;
for (const auto& [key, values] : gArgs.GetCommandLineArgs()) {
for (const auto& value : values) {
if (value.getValStr().empty()) {
args << QString::fromStdString("-" + key);
} else {
args << QString::fromStdString("-" + key + "=" + value.getValStr());
}
}
}
// Remove existing repair-options
args.removeAll(RESCAN1);