From 21e45a097e154be6be4a503f2181896c5f761385 Mon Sep 17 00:00:00 2001 From: Andrew C Date: Fri, 11 Mar 2016 11:57:10 -0500 Subject: [PATCH] Fix history deletion bug after font change The history is no longer cleared after the font size is changed --- src/qt/rpcconsole.cpp | 11 +++++++---- src/qt/rpcconsole.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 4e2530ffab3..90c555ccc83 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -490,16 +490,19 @@ 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(); + clear(false); ui->messagesWidget->setHtml(str); ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); } -void RPCConsole::clear() +void RPCConsole::clear(bool clearHistory) { ui->messagesWidget->clear(); - history.clear(); - historyPtr = 0; + if(clearHistory) + { + history.clear(); + historyPtr = 0; + } ui->lineEdit->clear(); ui->lineEdit->setFocus(); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 648e32638fd..b7a786822b7 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -77,7 +77,7 @@ private Q_SLOTS: void clearSelectedNode(); public Q_SLOTS: - void clear(); + void clear(bool clearHistory = true); void fontBigger(); void fontSmaller(); void setFontSize(int newSize);