[Qt] rework setNumBlocks to have blockDate as parameter
- reduces some functional overhead and simplifies the code
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user