Skip to content

Commit

Permalink
qt: Refactor to remove unnecessary block in DispatchNotifications
Browse files Browse the repository at this point in the history
Review with --ignore-all-space
  • Loading branch information
promag committed Apr 28, 2021
1 parent 57785fb commit cafef08
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,22 +735,20 @@ void TransactionTablePriv::DispatchNotifications()
{
if (!m_loaded || m_loading) return;

if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
assert(invoked);
}
for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
{
if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
if (vQueueNotifications.size() - i <= 10) {
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
assert(invoked);
}
for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
{
if (vQueueNotifications.size() - i <= 10) {
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
assert(invoked);
}

vQueueNotifications[i].invoke(parent);
}
vQueueNotifications.clear();
vQueueNotifications[i].invoke(parent);
}
vQueueNotifications.clear();
}

void TransactionTableModel::subscribeToCoreSignals()
Expand Down

0 comments on commit cafef08

Please sign in to comment.