D20736: Make artwork selection more standards-compliant and smarter

Fabian Vogt noreply at phabricator.kde.org
Tue Apr 23 10:15:09 BST 2019


fvogt requested changes to this revision.
fvogt added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> mprisplugin.cpp:489
> +            // now parse the size...
> +            const QVector<QStringRef> sizeSegments = size.splitRef(QLatin1Char('x'), QString::SkipEmptyParts, Qt::CaseInsensitive);
> +            if (sizeSegments.count() == 2) {

Why change this line? With auto it was easier to read, just the `&` should be removed for clarity. Now it also accepts `xx42xx42xx" as valid size, while it didn't before.

> mprisplugin.cpp:498
> +
> +            auto dist = std::numeric_limits<qreal>::max() - 1;
> +

That's still equal to `std::numeric_limits<qreal>::max()` due to lacking precision.

> mprisplugin.cpp:510
> +
> +                dist = targetSamples - effectiveSamples;
> +            }

This algorithm only looks at the aspect ratio of the image, not the resolution. For 4096x4096, 1024x1024 and 512x512 you'll get the same `effectiveSamples` value, so it will load huge thumbnails again.

REPOSITORY
  R856 Plasma Browser Integration

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

To: broulik, #plasma, fvogt
Cc: ngraham, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190423/36f796d0/attachment.html>


More information about the Plasma-devel mailing list