Skip to content

Commit cafef08

Browse files
committed
qt: Refactor to remove unnecessary block in DispatchNotifications
Review with --ignore-all-space
1 parent 57785fb commit cafef08

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/qt/transactiontablemodel.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -735,22 +735,20 @@ void TransactionTablePriv::DispatchNotifications()
735735
{
736736
if (!m_loaded || m_loading) return;
737737

738+
if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
739+
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
740+
assert(invoked);
741+
}
742+
for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
738743
{
739-
if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
740-
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
744+
if (vQueueNotifications.size() - i <= 10) {
745+
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
741746
assert(invoked);
742747
}
743-
for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
744-
{
745-
if (vQueueNotifications.size() - i <= 10) {
746-
bool invoked = QMetaObject::invokeMethod(parent, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
747-
assert(invoked);
748-
}
749748

750-
vQueueNotifications[i].invoke(parent);
751-
}
752-
vQueueNotifications.clear();
749+
vQueueNotifications[i].invoke(parent);
753750
}
751+
vQueueNotifications.clear();
754752
}
755753

756754
void TransactionTableModel::subscribeToCoreSignals()

0 commit comments

Comments
 (0)