Related to D24932
Diff Detail
- Repository
- R241 KIO
- Branch
- filelight
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 21168 Build 21186: arc lint + arc unit
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1113 | You can also use the icon from the service |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1455 | service can be nullptr, add a check |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1113 | Does this not work? d->m_sizeDetailsButton->setIcon(QIcon::fromTheme(service->icon()); |
Much better, thanks. Remember to mark inline comments as "Done" once you've addressed them.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1109–1111 | prefer descriptive variable names; "service" is better than "serv" |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1114 | Not sure copying that pointer into the lambda is a good idea? |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1114 | service is a QExplicitlySharedDataPointer<KService> in fact, I guess it covers lambda use cases. |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1114 | OK, it can be a problem since we can have many objects of KFilePropsPlugin thus lambda will extend service ptr life to the process end, which can result in memory leak (it's not leak) But since it's a plugin we don't expect a tons of objects, but i'm fine to make service a class scope var to not outlive the plugin. |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1114 | I'm pretty sure that isn't true. KFilePropsPlugin are the tabs inside the properties dialog. They get instantiated for each dialog and destroyed when the dialog is destroyed. They are not persistent throughout the life time of the process. |