Details
- Reviewers
elvisangelaccio - Group Reviewers
Dolphin
Diff Detail
- Repository
- R318 Dolphin
- Branch
- new (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 1304 Build 1322: arc lint + arc unit
+1
It's good to have that!
Also note that you "can" do that in a one-liner with C++14 with a little known library feature.
delete std::exchange(object, nullptr);
But it might be too new and unknown to use throughout the code... I leave it up to you to decide.
Thanks for your advice I appreciate it and I will keep it in mind for the future, but let's keep it "old".
Just out of curiosity, what is the motivation for this change? What do we gain by assigning pointers to nullptr? Would it instead make sense to use a smart pointer? Maybe unique_ptr or a Qt version?
Yes, porting to smart pointers (wherever possible) would be the best. But setting deleted pointers to null is a common practice because it will help to find some kind of bugs (even though it will hide a double delete, which isn't that good).
src/kitemviews/kitemlistview.cpp | ||
---|---|---|
310 | Not needed, widgetCreator is a local variable that's going out of scope. | |
325 | Same here. | |
2712 | Same here. | |
src/kitemviews/kstandarditemmodel.cpp | ||
68 | Same here, but ok. This one could make sense in case one day someone removes the return. | |
238 | Unrelated whitespace change | |
src/kitemviews/private/kitemlistviewanimation.cpp | ||
189 | Same here, not needed. | |
236 | Unrelated whitespace change | |
src/panels/folders/folderspanel.cpp | ||
65 | Not needed. | |
369 | Unrelated whitespace change | |
src/panels/places/placespanel.cpp | ||
484 | Not needed. | |
src/tests/kfileitemmodeltest.cpp | ||
1645 | Not needed. | |
src/views/dolphinview.cpp | ||
999 | Not needed. | |
src/views/dolphinviewactionhandler.cpp | ||
581 | Not needed. | |
src/views/tooltips/tooltipmanager.cpp | ||
86 | Not needed, we are already assigning it one line below. | |
212 | Unrelated whitespace change |