From 51ed9ec971614aebdbfbd9527aba365dd0afd437 Mon Sep 17 00:00:00 2001 From: Brandon Dahler Date: Sat, 13 Apr 2013 00:13:08 -0500 Subject: Cleanup code using forward declarations. Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files. --- src/qt/walletmodel.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/qt/walletmodel.cpp') diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 1c24ffb20b..b1d770e1a7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -3,18 +3,25 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletmodel.h" -#include "guiconstants.h" -#include "optionsmodel.h" + #include "addresstablemodel.h" +#include "guiconstants.h" #include "transactiontablemodel.h" +#include "base58.h" +#include "db.h" +#include "keystore.h" +#include "main.h" +#include "sync.h" #include "ui_interface.h" +#include "wallet.h" #include "walletdb.h" // for BackupWallet -#include "base58.h" +#include + +#include #include #include -#include WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) : QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), @@ -133,7 +140,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact { qint64 total = 0; QList recipients = transaction.getRecipients(); - std::vector > vecSend; + std::vector > vecSend; if(recipients.empty()) { @@ -148,7 +155,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact { if (rcp.paymentRequest.IsInitialized()) { // PaymentRequest... - int64 subtotal = 0; + int64_t subtotal = 0; const payments::PaymentDetails& details = rcp.paymentRequest.getDetails(); for (int i = 0; i < details.outputs_size(); i++) { @@ -157,7 +164,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact subtotal += out.amount(); const unsigned char* scriptStr = (const unsigned char*)out.script().data(); CScript scriptPubKey(scriptStr, scriptStr+out.script().size()); - vecSend.push_back(std::pair(scriptPubKey, out.amount())); + vecSend.push_back(std::pair(scriptPubKey, out.amount())); } if (subtotal <= 0) { @@ -180,7 +187,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact CScript scriptPubKey; scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get()); - vecSend.push_back(std::pair(scriptPubKey, rcp.amount)); + vecSend.push_back(std::pair(scriptPubKey, rcp.amount)); total += rcp.amount; } @@ -205,7 +212,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact LOCK2(cs_main, wallet->cs_wallet); transaction.newPossibleKeyChange(wallet); - int64 nFeeRequired = 0; + int64_t nFeeRequired = 0; std::string strFailReason; CWalletTx *newTx = transaction.getTransaction(); -- cgit v1.2.3