Qt: only half of enabled/disabled protocols list is processed

In Only enabled/disabled protocols lists, the rowCount decreases
as item state is changed in the parent. An equlibrium point is
reached at halfway when rows processed == remaining size of list.
Grab a static rowcount before entering the loop.
This commit is contained in:
Chuck Craft 2022-09-15 00:46:47 -05:00 committed by A Wireshark GitLab Utility
parent 223748d23c
commit 248955d614
1 changed files with 2 additions and 1 deletions

View File

@ -484,7 +484,8 @@ void EnabledProtocolsProxyModel::setItemsEnable(EnabledProtocolsProxyModel::Enab
if (! parent.isValid())
beginResetModel();
for (int row = 0; row < rowCount(parent); row++)
int rowcount = rowCount(parent);
for (int row = 0; row < rowcount; row++)
{
QModelIndex idx = index(row, EnabledProtocolsModel::colProtocol, parent);