aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-04-17 14:28:39 +0300
committerJarol Rodriguez <jarolrod@tutanota.com>2021-04-22 22:30:05 -0400
commitd2cc3390054616c73f72a59f864700f6de14067b (patch)
tree4c11eefc3ee7a8f58dc952169b2f89de591cc1ff /src/qt/rpcconsole.cpp
parent4f0ae472e22990ad9e734faea4adacef8df449bb (diff)
downloadbitcoin-d2cc3390054616c73f72a59f864700f6de14067b.tar.xz
qt, refactor: Drop redundant history cleaning in RPC console
The default clearHistory=true argument is passed in the RPCConsole ctor only. This is needless, as the history and historyPtr members are initialized properly.
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index c2604d68ea..378328d1b2 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -494,7 +494,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
ui->lineEdit->setMaxLength(16 * 1024 * 1024);
ui->messagesWidget->installEventFilter(this);
- connect(ui->clearButton, &QPushButton::clicked, [this] { clear(/* clearHistory */ false); });
+ connect(ui->clearButton, &QPushButton::clicked, [this] { clear(); });
connect(ui->fontBiggerButton, &QPushButton::clicked, this, &RPCConsole::fontBigger);
connect(ui->fontSmallerButton, &QPushButton::clicked, this, &RPCConsole::fontSmaller);
connect(ui->btnClearTrafficGraph, &QPushButton::clicked, ui->trafficGraph, &TrafficGraphWidget::clear);
@@ -776,19 +776,14 @@ void RPCConsole::setFontSize(int newSize)
// clear console (reset icon sizes, default stylesheet) and re-add the content
float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value();
- clear(false);
+ clear();
ui->messagesWidget->setHtml(str);
ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum());
}
-void RPCConsole::clear(bool clearHistory)
+void RPCConsole::clear()
{
ui->messagesWidget->clear();
- if(clearHistory)
- {
- history.clear();
- historyPtr = 0;
- }
ui->lineEdit->clear();
ui->lineEdit->setFocus();