Resolved all issues discovered by the krazy plugins: crashy, explicit.
Other issues remain; I left them alone because I either wasn't sure
they should be addressed or I wasn't sure how to do so.
elvisangelaccio |
Resolved all issues discovered by the krazy plugins: crashy, explicit.
Other issues remain; I left them alone because I either wasn't sure
they should be addressed or I wasn't sure how to do so.
Should build and pass existing tests - confirmed.
No Linters Available |
No Unit Test Coverage |
Buildable 12964 | |
Build 12982: arc lint + arc unit |
src/widgets/krichtextwidget.cpp | ||
---|---|---|
638 | This is unusual, but it's the right way around. The point of this is to check if the dialog has been deleted during the sub-eventloop behind exec(). No idea if that can happen here though, but that's generally the idea behind this pattern. |
src/widgets/krichtextwidget.cpp | ||
---|---|---|
638 | Ah of course. I didn't notice it was exec() that was being called. |
Thank you for the feedback and approval! I don't have the access needed to land a change, what should I do next? I would certainly appreciate someone else landing it for me. Let me know, thanks!
src/widgets/ktextedit.cpp | ||
---|---|---|
373 | You can do dialog->setAttribute(Qt::WA_DeleteOnClose); when creating the dialog instead of an explicit delete call |
src/widgets/krichtextwidget.cpp | ||
---|---|---|
638 | Coming back after two months, even I thought this looked wrong at first. I will endeavor to make my intent clearer, thank you :) | |
src/widgets/ktextedit.cpp | ||
373 | Thank you broulik! Could we use a QScopedPointer here? I see them throughout the KDE source, but not often for dialogs. The krazy analysis looked for QPointer, referencing blog https://blogs.kde.org/node/3919, which appears to have predated the existence of QScopedPointer. |
src/widgets/ktextedit.cpp | ||
---|---|---|
373 | While we are at it, the best way to fix this would be to not use exec() at all, but use open() instead: https://wiki.qt.io/New_Signal_Slot_Syntax#Asynchronous_made_easier |