Add warning and fixit for use of uic autoconnected slots
Needs ReviewPublic

Authored by nyalldawson on Oct 8 2017, 8:05 AM.

Details

Reviewers
smartins
Summary

See https://bugs.kde.org/show_bug.cgi?id=385476

Introduce autoconnect-slot, for detection of uic autoconnected slots

Warns for use of slots with the naming convention "on_btnRefresh_clicked", which calls to the uic generated setupUi() method will automatically connect to the corresponding widget's signals.

These connections are very fragile, and do not trigger compile time or run time warnings when changes to the ui file (such as renaming, removal of widgets, or changing widget type) cause the autoconnection to fail.

Better to use explicit connections instead, which the included FIXIT does.

Test Plan

Unit tests included

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
nyalldawson created this revision.Oct 8 2017, 8:05 AM
smartins added inline comments.Oct 8 2017, 3:06 PM
checks.json
157

, "bug"

src/checks/level1/autoconnect-slot.cpp
45

no spaces after (
use 4 space indent

51

auto =

smartins requested changes to this revision.Oct 8 2017, 3:06 PM
This revision now requires changes to proceed.Oct 8 2017, 3:06 PM
nyalldawson updated this revision to Diff 20503.Oct 8 2017, 9:57 PM

Addressed feedback

I've pushed this work to WIP-autoconnect-slot, to have a closer look soon (TM)