Summary: Replacing connect() lines with the new signal/slot syntax in Qt5. Details: https://wiki.qt.io/New_Signal_Slot_Syntax. There many of them. This is just the second part, more will follow.
Details
- Reviewers
nmel - Group Reviewers
Krusader - Commits
- R167:4654ac3bc7dd: Replaced old connect() with QT5 style. Part 2
Diff Detail
- Repository
- R167 Krusader
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Hello,
I have realized now that used lambdas in two ways, with and without this, examples:
connect(new QShortcut(QKeySequence("Ctrl++"), this), &QShortcut::activated, this, [=]() { zoomIn(); });
connect(diskUsage, &DiskUsage::enteringDirectory, [=]() { DiskUsageViewer::slotUpdateStatus(); });
Even compiler didn't complain, I suppose it should be without this.
What is your opinion?
Please use the one with this. In case a slot object is destroyed before a signal object, there will be an automatic disconnect.
If you have time, could you please check this pattern in the project and adjust accordingly using a separate CR? Thanks!
krusader/KViewer/diskusageviewer.cpp | ||
---|---|---|
55–57 | connect(diskUsage, &DiskUsage::enteringDirectory, this, [=]() { slotUpdateStatus(); }); |
You haven't removed DiskUsageViewer:: which is excessive.
The correct description in the commit is more important, of course. Please fix the commit message content before pushing. Thanks!