New santizer warning in KF 5.98 headers

Ingo Klöcker kloecker at kde.org
Wed Jan 11 10:26:42 GMT 2023


On Mittwoch, 11. Januar 2023 11:02:04 CET Milian Wolff wrote:
> On Dienstag, 10. Januar 2023 23:45:26 CET Michael Reeves wrote:
> > Thanks. I would say your right there this would definitely have caught
> > someone's attention if didn't work in practice with what kde needs.
> > Santizers are by design quite pedantic as serves there purpose well.
> 
> I agree, the code is clearly wrong and it's unclear what it's trying to
> achieve here. Does anyone know what this is trying to do?
> 
> Qt::ConnectionType connectionType = static_cast<Qt::ConnectionType>(-1)
> 
> Should this maybe just be changed to use Qt::AutoConnection?

The code:
https://invent.kde.org/frameworks/kconfigwidgets/-/blob/master/src/
kstandardaction.h#L253

What the code does:
The default value `static_cast<Qt::ConnectionType>(-1)` serves as hint that 
the function should decide what kind of connection type to use and for some 
reason the `ConfigureToolbars` action explicitly needs to use a 
`Qt::QueuedConnection` instead of a `Qt::AutoConnection`. This could be 
changed to a std::optional (for KF6) to make the intention clear.

Why the code does what it does:
One could question whether this special casing for `ConfigureToolbars` is still 
necessary. The bug report about the crash that this seems to have fixed is from 
2009: https://bugs.kde.org/show_bug.cgi?id=200815

Regards,
Ingo


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20230111/ad17e4e7/attachment.sig>


More information about the kde-core-devel mailing list