Skip to content

Commit 21e45a0

Browse files
committed
Fix history deletion bug after font change
The history is no longer cleared after the font size is changed
1 parent 0fa88ef commit 21e45a0

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/qt/rpcconsole.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,16 +490,19 @@ void RPCConsole::setFontSize(int newSize)
490490

491491
// clear console (reset icon sizes, default stylesheet) and re-add the content
492492
float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value();
493-
clear();
493+
clear(false);
494494
ui->messagesWidget->setHtml(str);
495495
ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum());
496496
}
497497

498-
void RPCConsole::clear()
498+
void RPCConsole::clear(bool clearHistory)
499499
{
500500
ui->messagesWidget->clear();
501-
history.clear();
502-
historyPtr = 0;
501+
if(clearHistory)
502+
{
503+
history.clear();
504+
historyPtr = 0;
505+
}
503506
ui->lineEdit->clear();
504507
ui->lineEdit->setFocus();
505508

src/qt/rpcconsole.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private Q_SLOTS:
7777
void clearSelectedNode();
7878

7979
public Q_SLOTS:
80-
void clear();
80+
void clear(bool clearHistory = true);
8181
void fontBigger();
8282
void fontSmaller();
8383
void setFontSize(int newSize);

0 commit comments

Comments
 (0)