From 75ef105869e5ff9a37111f2edeb86aba028b780f Mon Sep 17 00:00:00 2001 From: adityapk Date: Tue, 30 Oct 2018 14:36:41 -0700 Subject: [PATCH] qint64 for MSVC compiler --- src/rpc.h | 2 +- src/senttxstore.cpp | 2 +- src/txtablemodel.cpp | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/rpc.h b/src/rpc.h index a11beef..d875b8c 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -15,7 +15,7 @@ class Turnstile; struct TransactionItem { QString type; - unsigned long datetime; + qint64 datetime; QString address; QString txid; double amount; diff --git a/src/senttxstore.cpp b/src/senttxstore.cpp index b915d68..feeaee5 100644 --- a/src/senttxstore.cpp +++ b/src/senttxstore.cpp @@ -87,7 +87,7 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) { QJsonObject txItem; txItem["type"] = "sent"; txItem["from"] = tx.fromAddr; - txItem["datetime"] = QDateTime().currentMSecsSinceEpoch() / 1000; + txItem["datetime"] = QDateTime().currentMSecsSinceEpoch() / (qint64)1000; txItem["address"] = QString(); // The sent address is blank, to be consistent with t-Addr sent behaviour txItem["txid"] = txid; txItem["amount"] = -totalAmount; diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index b0030cd..7a3bc00 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -98,10 +98,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: { - qDebug() << modeldata->at(index.row()).datetime; - return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * 1000).toLocalTime().toString(); - } + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * (qint64)1000).toLocalTime().toString(); case 3: return Settings::getInstance()->getZECDisplayFormat(modeldata->at(index.row()).amount); } } @@ -117,7 +114,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * 1000).toLocalTime().toString(); + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * (qint64)1000).toLocalTime().toString(); case 3: return Settings::getInstance()->getUSDFormat(modeldata->at(index.row()).amount); } }