Wireshark-dev: Re: [Wireshark-dev] Issues with extcap arguments type radio

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Sat, 6 Aug 2022 13:50:05 +0200
Hi Guy,

I’ll go with the idea of replacing takeAt() with at() in the ExtArgRadio::value method for now.
Next is to find out why the saved setting for the radio button is not being restored when reopening the extcap configuration dialog.

Thanks,
Jaap


> On 6 Aug 2022, at 12:55, Guy Harris <gharris@xxxxxxxxx> wrote:
> 
> On Aug 6, 2022, at 2:55 AM, Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
> 
>> It uses QList::takeAt() to retrieve the value. But according to the documentation it does:
>> 
>>     T t = at(i);
>>     remove(i);
>>     return t;
>> 
>> 
>> So it in fact removes the value from the list.
> 
> Yes - the documentation for QList::takeAt(), at
> 
> 	https://doc.qt.io/qt-5/qlist.html#takeAt
> 
> explicitly uses the word "removes":
> 
> 	Removes the item at index position i and returns it.
> 
> So, yes, unless the intent is to modify the list, use QList::at().