Update Signals&Slots of Addons
ClosedPublic

Authored by laysrodrigues on Sep 16 2017, 3:00 PM.

Details

Summary

Update most of the connections of all files inside addons
folder to qt5 pattern.

Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>

Diff Detail

Repository
R40 Kate
Branch
updateSignals
Lint
No Linters Available
Unit
No Unit Test Coverage
laysrodrigues created this revision.Sep 16 2017, 3:00 PM
Restricted Application added a project: Kate. · View Herald TranscriptSep 16 2017, 3:00 PM

There are a few connections that I wasn't able to do the update. Like a signal isn't on the object class and others that I couldn't do the static _cast of overloaded functions right. But most of the signals were updated. There are some comments on the connects that I had a problem.

I went over the diff, beside the few things not converted I see no obvious faults.
If nobody else objects, I would approve this.

For the parts that can't be converted: I would assume e.g.

connect(job, SIGNAL(data(KIO::Job *, QByteArray)),

this, SLOT(slotData(KIO::Job *, QByteArray)));

​ this, SLOT(slotData(KIO::Job *, QByteArray)));

should be convertable, too, but no time to take a look atm how if the trivial way didn't work.

Are we sure this doesn't add regressions? Somethings connections are also disconnected, and as far as I know, mixing a new-style connect with an old-style disconnect does not work. If we are sure this works, then I'm all for it.

PS: I did not go over the patch.

Are we sure this doesn't add regressions? Somethings connections are also disconnected, and as far as I know, mixing a new-style connect with an old-style disconnect does not work. If we are sure this works, then I'm all for it.

PS: I did not go over the patch.

If I wasn't able to change the 'connect' to the new pattern, the disconnect was also not changed. Now about the regression, I can't say much. I know that this is a big patch and is hard to review all the changes.

dhaumann accepted this revision.Oct 1 2017, 1:17 PM

All in all, looks good to me as well.

Personally, I am not a big fan of keeping commented out source code, so I added some inline comments.

addons/filetree/katefiletreeplugin.cpp
179–181 ↗(On Diff #19588)

Are there an reasons for this comment? It likely is more irritating than helpful.

189 ↗(On Diff #19588)

Same here, can we simply delete this line?

addons/gdbplugin/plugin_kategdb.cpp
144–145 ↗(On Diff #19588)

Remove this comment?

addons/katebuild-plugin/plugin_katebuild.cpp
918 ↗(On Diff #19588)

delete?

addons/search/plugin_search.cpp
143–144 ↗(On Diff #19588)

which is ok - just remove this comment.

addons/xmltools/plugin_katexmltools.cpp
483–484 ↗(On Diff #19588)

also remove? :)

This revision is now accepted and ready to land.Oct 1 2017, 1:17 PM

Rebase on master and remove comments pointed
by dhaumann

stikonas added a subscriber: stikonas.EditedOct 12 2017, 3:59 PM

Maybe it would be more readable with qOverload instead of static_cast? Although, that requires C++14...

kfunk added a subscriber: kfunk.Oct 12 2017, 4:05 PM

Maybe it would be more readable with qOverload instead of static_cast? Although, that requires C++14...

... and Qt 5.7 => not feasible.

dhaumann accepted this revision.Oct 13 2017, 6:50 PM

Lgtm, please go ahead and commit.

This revision was automatically updated to reflect the committed changes.