Browse Source

Merge pull request #5775

deda3e1 [Qt] remove unused getNumBlocksAtStartup() from ClientModel (Philip Kaufmann)
47ee8cf [Qt] use qint64 in BitcoinGUI::setNumBlocks (Philip Kaufmann)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
3dfcdf46c2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/qt/bitcoingui.cpp
  2. 11
      src/qt/clientmodel.cpp
  3. 3
      src/qt/clientmodel.h

6
src/qt/bitcoingui.cpp

@ -682,7 +682,7 @@ void BitcoinGUI::setNumBlocks(int count)
QDateTime lastBlockDate = clientModel->getLastBlockDate(); QDateTime lastBlockDate = clientModel->getLastBlockDate();
QDateTime currentDate = QDateTime::currentDateTime(); QDateTime currentDate = QDateTime::currentDateTime();
int secs = lastBlockDate.secsTo(currentDate); qint64 secs = lastBlockDate.secsTo(currentDate);
tooltip = tr("Processed %n blocks of transaction history.", "", count); tooltip = tr("Processed %n blocks of transaction history.", "", count);
@ -722,8 +722,8 @@ void BitcoinGUI::setNumBlocks(int count)
} }
else else
{ {
int years = secs / YEAR_IN_SECONDS; qint64 years = secs / YEAR_IN_SECONDS;
int remainder = secs % YEAR_IN_SECONDS; qint64 remainder = secs % YEAR_IN_SECONDS;
timeBehindText = tr("%1 and %2").arg(tr("%n year(s)", "", years)).arg(tr("%n week(s)","", remainder/WEEK_IN_SECONDS)); timeBehindText = tr("%1 and %2").arg(tr("%n year(s)", "", years)).arg(tr("%n week(s)","", remainder/WEEK_IN_SECONDS));
} }

11
src/qt/clientmodel.cpp

@ -29,8 +29,9 @@ ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
optionsModel(optionsModel), optionsModel(optionsModel),
peerTableModel(0), peerTableModel(0),
cachedNumBlocks(0), cachedNumBlocks(0),
cachedReindexing(0), cachedImporting(0), cachedReindexing(0),
numBlocksAtStartup(-1), pollTimer(0) cachedImporting(0),
pollTimer(0)
{ {
peerTableModel = new PeerTableModel(this); peerTableModel = new PeerTableModel(this);
pollTimer = new QTimer(this); pollTimer = new QTimer(this);
@ -65,12 +66,6 @@ int ClientModel::getNumBlocks() const
return chainActive.Height(); return chainActive.Height();
} }
int ClientModel::getNumBlocksAtStartup()
{
if (numBlocksAtStartup == -1) numBlocksAtStartup = getNumBlocks();
return numBlocksAtStartup;
}
quint64 ClientModel::getTotalBytesRecv() const quint64 ClientModel::getTotalBytesRecv() const
{ {
return CNode::GetTotalBytesRecv(); return CNode::GetTotalBytesRecv();

3
src/qt/clientmodel.h

@ -48,7 +48,6 @@ public:
//! Return number of connections, default is in- and outbound (total) //! Return number of connections, default is in- and outbound (total)
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const; int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
int getNumBlocks() const; int getNumBlocks() const;
int getNumBlocksAtStartup();
quint64 getTotalBytesRecv() const; quint64 getTotalBytesRecv() const;
quint64 getTotalBytesSent() const; quint64 getTotalBytesSent() const;
@ -77,8 +76,6 @@ private:
bool cachedReindexing; bool cachedReindexing;
bool cachedImporting; bool cachedImporting;
int numBlocksAtStartup;
QTimer *pollTimer; QTimer *pollTimer;
void subscribeToCoreSignals(); void subscribeToCoreSignals();

Loading…
Cancel
Save