| 39 | #include <boost/filesystem.hpp> |
| 40 | |
| 41 | WalletModel::WalletModel(const PlatformStyle *platformStyle, CWallet* wallet, OptionsModel* optionsModel, QObject* parent) : QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), |
| 42 | contractTableModel(0), |
| 43 | transactionTableModel(0), |
| 44 | recentRequestsTableModel(0), |
| 45 | cachedBalance(0), |
| 46 | cachedUnconfirmedBalance(0), |
| 47 | cachedImmatureBalance(0), |
| 48 | cachedEncryptionStatus(Unencrypted), |
| 49 | cachedNumBlocks(0) |
| 50 | { |
| 51 | fHaveWatchOnly = wallet->HaveWatchOnly(); |
| 52 | fForceCheckBalanceChanged = false; |
| 53 | addressTableModel = new AddressTableModel(wallet, this); |
| 54 | contractTableModel = new ContractTableModel(wallet, this); |
| 55 | transactionTableModel = new TransactionTableModel(platformStyle, wallet, this); |
| 56 | recentRequestsTableModel = new RecentRequestsTableModel(wallet, this); |
| 57 | tokenItemModel = new TokenItemModel(wallet, this); |
| 58 | tokenTransactionTableModel = new TokenTransactionTableModel(platformStyle, wallet, this); |
| 59 | |
| 60 | // This timer will be fired repeatedly to update the balance |
| 61 | pollTimer = new QTimer(this); |
| 62 | connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollBalanceChanged())); |
| 63 | pollTimer->start(MODEL_UPDATE_DELAY * 4); |
| 64 | |
| 65 | subscribeToCoreSignals(); |
| 66 | } |
| 67 | |
| 68 | WalletModel::~WalletModel() |
| 69 | { |
nothing calls this directly
no test coverage detected