Update libs/widgets to c++11
ClosedPublic

Authored by ognarb on Feb 18 2019, 8:16 PM.

Details

Summary

Use clang-tidy to:

  • Use default when possible for constructor and destructor
  • Use nullptr instead of 0 or NULL
  • Use Q_DECL_OVERRIDE

if this patch is acepted, if will do the same for the entire calligra codebase.

Test Plan

Compile and run

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ognarb created this revision.Feb 18 2019, 8:16 PM
Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptFeb 18 2019, 8:16 PM
Restricted Application added a subscriber: Calligra-Devel-list. · View Herald Transcript
ognarb requested review of this revision.Feb 18 2019, 8:16 PM
ognarb edited the summary of this revision. (Show Details)Feb 18 2019, 11:00 PM
danders added a subscriber: danders.

Hmmm. wasn't it somethng with ms windows and for loops, leinir?
Also, I think there may be detachment issues with them, clazy can tell.
There is a qAsConst() solution but that is not supported in the qt version we need to support.
If there are issues, maybe drop the for loops for now.

There is an issue with Qt's foreach, however if the author would be so nice as to check that this version using C++11 iteration does not break building on Windows, then it can go in... Though, yes, it most certainly wants testing, and i don't currently have a functioning windows build system. 2890f2a929034d613c4b4a8f3e6ad77c23162d41 is one of the commits which did the q_foreach/for loop change previously, to see what actually got changed.

ognarb updated this revision to Diff 52119.Feb 19 2019, 11:16 PM
  • Revert foreach modifications
  • Fix some forgotten 0 as nullptr instances
ognarb edited the summary of this revision. (Show Details)Feb 19 2019, 11:16 PM
ognarb edited the test plan for this revision. (Show Details)
ognarb edited the summary of this revision. (Show Details)Feb 19 2019, 11:22 PM
ognarb updated this revision to Diff 52121.Feb 19 2019, 11:25 PM

Fix build

danders accepted this revision.Feb 21 2019, 9:53 AM

Ok, I can't say I have scrutinized every change, but...
Could you give a heads up when you continue with other parts or else there may be merge problems.
I'm working on karbon and pageapp atm, so please keep off :)

This revision is now accepted and ready to land.Feb 21 2019, 9:53 AM

Ok, I can't say I have scrutinized every change, but...
Could you give a heads up when you continue with other parts or else there may be merge problems.
I'm working on karbon and pageapp atm, so please keep off :)

Thanks for the review, I will work next on libs/{pigment,version,widgetutils}.

Thanks for the review, I will work next on libs/{pigment,version,widgetutils}.

Hmm, maybe wait with pigment, according to rempt, only krita actually used it.
I haven't looked into it, but if that is the case probably we should dump it.

This revision was automatically updated to reflect the committed changes.