Avoids loading huge screenshots just to show them in a tiny thumbnail.
It's using GridView.cellWidth instead of width to avoid reloading the image as the layouting is done. Everytime sourceSize changes, the image is reloaded.
Details
- Reviewers
davidedmundson - Group Reviewers
Plasma - Commits
- R119:7c49e1498aab: [Look and Feel and KSplash KCM] Set sourceSize for thumbnail
Saves like 10 MB in both KCMS for me
Verified that the Images are only loaded once upon opening the KCM
Still looks ok, albeit slightly blurrier, as before smooth wasn't set on resizing and now it's done in image reader or so.
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Setting sourceSize +++
Only thing:
qquickimagebase.cpp
211: void QQuickImageBase::load() {
258: d->pix.load(qmlEngine(this), loadUrl, d->sourcesize * d->devicePixelRatio, options, d->providerOptions);
If you need to change this here we're working around something.
I put debug in Qt, in qmlscene it works as you'd expect.
In the system settings case QQuickImage thinks the DPR is always 1.
The relevant window is
QQuickWindow(0x55f9aee446d0, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window), title="Offscreen", geometry=336,21 426x592)
with window()->effectiveDevicePixelRatio() == 1
It's a bug in the window embedding.
I have a consistent rule about working round Qt bugs.
I'll allow it if and only if we understand the root cause and have filed a bug or patch upstream and then reference it.