Update most of the connections of all files inside addons
folder to qt5 pattern.
Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>
cullmann | |
kwrite-devel | |
dhaumann |
Update most of the connections of all files inside addons
folder to qt5 pattern.
Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>
No Linters Available |
No Unit Test Coverage |
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.
Here a some of the lines that I had problem:
https://github.com/KDE/kate/blob/master/addons/filetree/katefiletree.cpp#L162
https://github.com/KDE/kate/blob/master/addons/filetree/katefiletreemodel.cpp#L468
https://github.com/KDE/kate/blob/master/addons/filetree/katefiletreemodel.cpp#L830
https://github.com/KDE/kate/blob/master/addons/filetree/katefiletreeplugin.cpp#L185 (Here I used lambda because the issue was that the slot required more arguments than the signal sends, but the two are void on parameters)
https://github.com/KDE/kate/blob/master/addons/katebuild-plugin/plugin_katebuild.cpp#L919
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.
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.
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? :) |
Maybe it would be more readable with qOverload instead of static_cast? Although, that requires C++14...