D19913: [plasma-desktop] make it compiles without foreach

David Faure noreply at phabricator.kde.org
Tue Apr 14 21:59:59 BST 2020


dfaure accepted this revision.
dfaure added a comment.
This revision is now accepted and ready to land.


  Looks like this got lost/abandoned? It's painful to review (because it's so long), but it shouldn't be lost work...
  
  Can you rebase and see if it still applies?
  
  Maybe in the future better split this up into multiple patches so it can land in chunks instead of getting stuck forever....

INLINE COMMENTS

> broulik wrote in daysmodel.cpp:171
> While at it `const QDate &`

Actually better not, a QDate is just a wrapper for a qint64, with a generated copy constructor (so it's just "copying" a qint64)

> corona.cpp:467
>      KConfigGroup containmentsGroup(cg, "Containments");
> -    foreach (const Containment *containment, containments) {
> +    for (const Containment *containment : qAsConst(containments)) {
>          QString cid = QString::number(containment->id());

(already const, this method is const)

> apol wrote in pluginloader.cpp:567
> shouldn't it be const?

(it is now)

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  compile_without_foreach (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D19913

To: mlaurent, dfaure
Cc: broulik, apol, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200414/08eca782/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list