Qt: copy correct hidden state to device

The IFTREE_COL_HIDDEN is in fact a "Show" column (should the
names be changed?) so when saving the data the hidden state
is the opposite of the checked status.

We were doing the inverted logic when writing to the preferences,
but not when changing the device interface_t struct directly.
However, before 6e12e504b9
we always re-read the hidden state from the preferences after
changing it in the Manage Interfaces Dialog, so this bug wasn't
exposed until we stopped doing that and used the current status.

Fix #19672
This commit is contained in:
John Thacker 2024-02-26 09:17:52 -05:00
parent 4d6941caa6
commit 09f6a3aaa6
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ void InterfaceTreeCacheModel::save()
if (col == IFTREE_COL_HIDDEN)
{
device->hidden = saveValue.toBool();
/* Hidden is de-selection, therefore inverted logic here */
device->hidden = (saveValue == Qt::Unchecked);
}
else if (device->if_info.type == IF_EXTCAP)
{