From 0498c3ba64ace2bd8898a5d0ba3107a2f024c692 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Fri, 7 Oct 2016 00:47:28 +0300 Subject: Transaction history is not crashing and refreshing properly --- src/libwalletqt/Wallet.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/libwalletqt/Wallet.cpp') diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 39d40a17..14e0a868 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -32,7 +32,6 @@ public: virtual void moneyReceived(const std::string &txId, uint64_t amount) { - qDebug() << __FUNCTION__; emit m_wallet->moneyReceived(QString::fromStdString(txId), amount); } @@ -40,14 +39,12 @@ public: virtual void newBlock(uint64_t height) { // qDebug() << __FUNCTION__; - m_wallet->m_history->refresh(); emit m_wallet->newBlock(height); } virtual void updated() { qDebug() << __FUNCTION__; - m_wallet->m_history->refresh(); emit m_wallet->updated(); } @@ -55,7 +52,6 @@ public: virtual void refreshed() { qDebug() << __FUNCTION__; - emit m_wallet->refreshed(); } @@ -93,6 +89,11 @@ bool Wallet::connected() const return m_walletImpl->connected(); } +bool Wallet::synchronized() const +{ + return m_walletImpl->synchronized(); +} + QString Wallet::errorString() const { return QString::fromStdString(m_walletImpl->errorString()); @@ -207,19 +208,16 @@ void Wallet::disposeTransaction(PendingTransaction *t) delete t; } -TransactionHistory *Wallet::history() +TransactionHistory *Wallet::history() const { -// if (m_history->count() == 0) { -// m_history->refresh(); -// } - return m_history; } -TransactionHistoryModel *Wallet::historyModel() +TransactionHistoryModel *Wallet::historyModel() const { if (!m_historyModel) { - m_historyModel = new TransactionHistoryModel(this); + Wallet * w = const_cast(this); + m_historyModel = new TransactionHistoryModel(w); m_historyModel->setTransactionHistory(this->history()); } -- cgit v1.2.3