[PATCH] Loop refactoring

Richard Kimberly Heck rikiheck at lyx.org
Wed Oct 7 21:43:42 UTC 2020


On 10/7/20 3:09 PM, Yuriy Skalko wrote:
>> I like that. I have to admit that I gave up checking that the loops were equivalent roughly at the first third of the patch :)
>>
>> Is it done by hand or with some tool?
> I used combination of clang-tidy and hands.
>
>
>> There are also in the Qt part things like:
>>
>> +                               for (auto pcat : pcats) {
>>
>> Is skipping the "const &" intended because of some Qt specifities?
> No, it is constified now.
>
>
>> On a different subject:
>>
>> -       QPushButton * okay_;
>> -       QPushButton * apply_;
>> -       QPushButton * cancel_;
>> -       QPushButton * restore_;
>> -       QCheckBox * auto_apply_;
>> -       QPushButton * default_;
>> +       QPushButton * okay_{nullptr};
>> +       QPushButton * apply_{nullptr};
>> +       QPushButton * cancel_{nullptr};
>> +       QPushButton * restore_{nullptr};
>> +       QCheckBox * auto_apply_{nullptr};
>> +       QPushButton * default_{nullptr};
>>
>>
>> We use the form "= nullptr" in the source (for now). Any reason why the weird {} notation is better? 
> Since it is the most modern and uniform way of initialization in C++.
> I corrected to `=` for nullptr's. But using `=` to initialize `policy_`
> (few lines below) gives compilation error in my gcc 7.3.
>
>
> Also did constification of places mentioned by Riki.

OK. This is fine, then, once we have your access working.

By the way, thanks for doing this. It will squash a lot of useless
warnings that I see in QtCreator.

Riki




More information about the lyx-devel mailing list