Merge #17750: util: change GetWarnings parameter to bool
7aab8d1024[style] Code style fixups in GetWarnings() (John Newbery)492c6dc1e7util: change GetWarnings parameter to bool (John Newbery)869b6314fd[qt] remove unused parameter from getWarnings() (John Newbery) Pull request description: `GetWarnings()` changes the format of the output warning string based on a passed-in string argument that can be set to "gui" or "statusbar". Change the argument to a bool: - there are only two types of behaviour, so a bool is a more natural argument type - changing the name to `verbose` does not set any expectations for the how the calling code will use the returned string (currently, `statusbar` is used for RPC warnings, not a status bar) - removes some error-handling code for when the passed-in string is not one of the two strings expected. ACKs for top commit: laanwj: code review ACK7aab8d1024practicalswift: ACK7aab8d1024-- diff looks correct :) MarcoFalke: ACK7aab8d1024otherwise. promag: Code review ACK7aab8d1024. Tree-SHA512: 75882c6e3e44aa9586411b803149b36ba487f4eb9cac3f5c8f07cd9f586870bba4488a51e674cf8147f05718534f482836e6a4e3f66e0d4ef6821900c7dfd04e
This commit is contained in:
10 files changed
+33
-40
No files matched your search
+3
-3
@@ -135,7 +135,7 @@ BitcoinCore::BitcoinCore(interfaces::Node& node) :
|
||||
void BitcoinCore::handleRunawayException(const std::exception *e)
|
||||
{
|
||||
PrintExceptionContinue(e, "Runaway exception");
|
||||
Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings("gui")));
|
||||
Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings()));
|
||||
}
|
||||
|
||||
void BitcoinCore::initialize()
|
||||
@@ -589,10 +589,10 @@ int GuiMain(int argc, char* argv[])
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, "Runaway exception");
|
||||
app.handleRunawayException(QString::fromStdString(node->getWarnings("gui")));
|
||||
app.handleRunawayException(QString::fromStdString(node->getWarnings()));
|
||||
} catch (...) {
|
||||
PrintExceptionContinue(nullptr, "Runaway exception");
|
||||
app.handleRunawayException(QString::fromStdString(node->getWarnings("gui")));
|
||||
app.handleRunawayException(QString::fromStdString(node->getWarnings()));
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ enum BlockSource ClientModel::getBlockSource() const
|
||||
|
||||
QString ClientModel::getStatusBarWarnings() const
|
||||
{
|
||||
return QString::fromStdString(m_node.getWarnings("gui"));
|
||||
return QString::fromStdString(m_node.getWarnings());
|
||||
}
|
||||
|
||||
OptionsModel *ClientModel::getOptionsModel()
|
||||
|
||||
Reference in new issue
Block a user