diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2015-02-09 11:19:01 +0100 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2015-03-09 10:58:17 +0100 |
commit | 8517e9709e883ef59603d56b45dd2e06f8b7c7d7 (patch) | |
tree | 7534aee2b8a461e0ff470b9ad2ff95909ff26df4 /src/qt/rpcconsole.cpp | |
parent | 513e0252391688b919f1b08980c5759a515c341b (diff) |
[Qt] rework setNumBlocks to have blockDate as parameter
- reduces some functional overhead and simplifies the code
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 9f3991c4c5..ccde44fb29 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -293,8 +293,8 @@ void RPCConsole::setClientModel(ClientModel *model) setNumConnections(model->getNumConnections()); connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); - setNumBlocks(model->getNumBlocks()); - connect(model, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int))); + setNumBlocks(model->getNumBlocks(), model->getLastBlockDate()); + connect(model, SIGNAL(numBlocksChanged(int,QDateTime)), this, SLOT(setNumBlocks(int,QDateTime))); updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent()); connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64))); @@ -404,11 +404,10 @@ void RPCConsole::setNumConnections(int count) ui->numberOfConnections->setText(connections); } -void RPCConsole::setNumBlocks(int count) +void RPCConsole::setNumBlocks(int count, const QDateTime& blockDate) { ui->numberOfBlocks->setText(QString::number(count)); - if(clientModel) - ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString()); + ui->lastBlockTime->setText(blockDate.toString()); } void RPCConsole::on_lineEdit_returnPressed() |