Qt: Fix selection of filter column in Conversation table

When converting from our columns as displayed to the canonical
list of columns, add 1 for the missing conversation ID if it
is not present (as opposed to if it is present.) Also change the
test for the total packets to account for the new conversation ID
column.

Related to #18738
This commit is contained in:
John Thacker 2023-01-13 18:04:37 -05:00
parent d09460283b
commit 4307d13195
1 changed files with 3 additions and 2 deletions

View File

@ -299,10 +299,11 @@ int TrafficDataFilterProxy::mapToSourceColumn(int proxyColumn) const
column++;
}
ConversationDataModel * convModel = qobject_cast<ConversationDataModel *>(model);
if (convModel->showConversationId() && column > ConversationDataModel::CONV_COLUMN_BYTES)
if (!convModel->showConversationId() && column > ConversationDataModel::CONV_COLUMN_BYTES) {
column++;
}
if (! model->showTotalColumn()) {
if (column > ConversationDataModel::CONV_COLUMN_BYTES)
if (column > ConversationDataModel::CONV_COLUMN_CONV_ID)
column+=2;
}
}