aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2019-07-06 17:16:01 +0100
committerJoão Barbosa <[email protected]>2019-07-09 14:16:23 +0100
commitdf695db3237571c662a4e199709f9c6615ffa0c5 (patch)
tree27297b24e99388a7182235bfb5402d468ea7981c /src/qt/clientmodel.cpp
parentgui: Fix missing qRegisterMetaType(WalletModel*) (diff)
downloaddiscoin-df695db3237571c662a4e199709f9c6615ffa0c5.tar.xz
discoin-df695db3237571c662a4e199709f9c6615ffa0c5.zip
qt: Assert QMetaObject::invokeMethod result
Github-Pull: #16348 Rebased-From: 64fee489448c62319e77941c30152084695b5a5d
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 27b4c182f..99c0a4d95 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -191,34 +191,39 @@ void ClientModel::updateBanlist()
static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress)
{
// emits signal "showProgress"
- QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection,
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(title)),
Q_ARG(int, nProgress));
+ assert(invoked);
}
static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections)
{
// Too noisy: qDebug() << "NotifyNumConnectionsChanged: " + QString::number(newNumConnections);
- QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection,
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection,
Q_ARG(int, newNumConnections));
+ assert(invoked);
}
static void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive)
{
- QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection,
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection,
Q_ARG(bool, networkActive));
+ assert(invoked);
}
static void NotifyAlertChanged(ClientModel *clientmodel)
{
qDebug() << "NotifyAlertChanged";
- QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection);
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection);
+ assert(invoked);
}
static void BannedListChanged(ClientModel *clientmodel)
{
qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__);
- QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection);
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection);
+ assert(invoked);
}
static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int height, int64_t blockTime, double verificationProgress, bool fHeader)
@@ -240,11 +245,12 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
// if we are in-sync or if we notify a header update, update the UI regardless of last update time
if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
//pass an async signal to the UI thread
- QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
+ bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
Q_ARG(int, height),
Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)),
Q_ARG(double, verificationProgress),
Q_ARG(bool, fHeader));
+ assert(invoked);
nLastUpdateNotification = now;
}
}