D22147: Better use of Qt APIs in Plasma::Theme

Stefan BrĂ¼ns noreply at phabricator.kde.org
Mon Jul 1 15:38:26 BST 2019


bruns added inline comments.

INLINE COMMENTS

> tcanabrava wrote in svg.cpp:342-349
> looks a good example of code that could be written with an std::find_if

You either have to sort on `bestFit.area()` first, or do the find_if in a nested loop, to find a better match (smaller one) after the first one.

> svg.cpp:346
>                          (!bestFit.isValid() ||
>                           (bestFit.width() * bestFit.height()) > (hint.width() * hint.height()))) {
>                      bestFit = hint;

can you swap bestFit and hint (and reverse the `>`) here, makes it easier to read IMHO (i.e. the comment says "smallest one", so the check should be `<`).

REPOSITORY
  R242 Plasma Framework (Library)

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

To: apol, #plasma, #frameworks, fvogt
Cc: bruns, tcanabrava, fvogt, broulik, kde-frameworks-devel, LeGast00n, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190701/f25dd7c6/attachment.html>


More information about the Kde-frameworks-devel mailing list