qt: Handle exceptions in WalletModel::pollBalanceChanged slot

Actually, the private QTimer::timeout signal has one
QTimer::QPrivateSignal parameter.
This commit is contained in:
Hennadii Stepanov committed 2021-04-05 16:47:08 +03:00
1 parent eb6156ba1b
commit bc00e13bc8
2 files changed
+6 -1

No files matched your search

+4 -1
View File
@@ -65,7 +65,10 @@ WalletModel::~WalletModel()
void WalletModel::startPollBalance()
{
// This timer will be fired repeatedly to update the balance
connect(timer, &QTimer::timeout, this, &WalletModel::pollBalanceChanged);
// Since the QTimer::timeout is a private signal, it cannot be used
// in the GUIUtil::ExceptionSafeConnect directly.
connect(timer, &QTimer::timeout, this, &WalletModel::timerTimeout);
GUIUtil::ExceptionSafeConnect(this, &WalletModel::timerTimeout, this, &WalletModel::pollBalanceChanged);
timer->start(MODEL_UPDATE_DELAY);
}
+2
View File
@@ -223,6 +223,8 @@ Q_SIGNALS:
// Notify that there are now keys in the keypool
void canGetAddressesChanged();
void timerTimeout();
public Q_SLOTS:
/* Starts a timer to periodically update the balance */
void startPollBalance();