Replace boost::variant with std::variant
[novacoin.git] / src / qt / mintingtablemodel.cpp
index 7eece74..5f82578 100644 (file)
@@ -74,7 +74,7 @@ public:
             for(std::map<uint256, CWalletTx>::iterator it = wallet->mapWallet.begin(); it != wallet->mapWallet.end(); ++it)
             {
                 std::vector<KernelRecord> txList = KernelRecord::decomposeOutput(wallet, it->second);
-                BOOST_FOREACH(KernelRecord& kr, txList) {
+                for (KernelRecord& kr : txList) {
                     if(!kr.spent) {
                         cachedWallet.append(kr);
                     }
@@ -137,7 +137,7 @@ public:
                     if(!toInsert.empty()) /* only if something to insert */
                     {
                         int insert_idx = lowerIndex;
-                        BOOST_FOREACH(const KernelRecord &rec, toInsert)
+                        for (const KernelRecord &rec : toInsert)
                         {
                             if(!rec.spent) 
                             {
@@ -160,7 +160,7 @@ public:
                 {               
                     // Updated -- remove spent coins from table
                     std::vector<KernelRecord> toCheck = KernelRecord::decomposeOutput(wallet, mi->second);
-                    BOOST_FOREACH(const KernelRecord &rec, toCheck)
+                    for (const KernelRecord &rec : toCheck)
                     {
                         if(rec.spent)
                         {
@@ -247,7 +247,7 @@ void MintingTableModel::update()
         TRY_LOCK(wallet->cs_wallet, lockWallet);
         if (lockWallet && !wallet->vMintingWalletUpdated.empty())
         {
-            BOOST_FOREACH(uint256 hash, wallet->vMintingWalletUpdated)
+            for (uint256 hash : wallet->vMintingWalletUpdated)
             {
                 updated.append(hash);
 
@@ -255,7 +255,7 @@ void MintingTableModel::update()
                 CWalletTx wtx;
                 if(wallet->GetTransaction(hash, wtx))
                 {
-                    BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+                    for (const CTxIn& txin : wtx.vin)
                     {
                         updated.append(txin.prevout.hash);
                     }
@@ -350,11 +350,11 @@ QVariant MintingTableModel::data(const QModelIndex &index, int role) const
         case TxHash:
             return formatTxHash(rec);
         case Age:
-            return rec->getAge();
+            return static_cast<qlonglong>(rec->getAge());
         case CoinDay:
-            return rec->coinAge;
+            return static_cast<qlonglong>(rec->getCoinDay());
         case Balance:
-            return rec->nValue;
+            return static_cast<qlonglong>(rec->nValue);
         case MintProbability:
             return getDayToMint(rec);
         case MintReward:
@@ -444,7 +444,7 @@ QString MintingTableModel::formatTxCoinDay(const KernelRecord *wtx) const
 
 QString MintingTableModel::formatTxAge(const KernelRecord *wtx) const
 {
-    int64 nAge = wtx->getAge();
+    int64_t nAge = wtx->getAge();
     return QString::number(nAge);
 }