wallpaperselector: Fix previews not loading

The API changed in
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5478,
now we need to use the "preview" property
This commit is contained in:
Devin Lin 2025-10-04 22:11:21 -04:00
parent a0b4ac1e11
commit 5fd7d99b09

View file

@ -9,7 +9,6 @@ import QtQuick.Controls as Controls
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import org.kde.plasma.wallpapers.image 2.0 as Wallpaper import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
import org.kde.kquickcontrolsaddons 2.0 as Addons
import org.kde.plasma.private.mobileshell.wallpaperimageplugin as WallpaperImagePlugin import org.kde.plasma.private.mobileshell.wallpaperimageplugin as WallpaperImagePlugin
import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell as MobileShell
@ -133,12 +132,13 @@ Controls.Drawer {
visible: !walliePreview.visible visible: !walliePreview.visible
} }
Addons.QPixmapItem { Image {
id: walliePreview id: walliePreview
visible: model.screenshot != null
anchors.fill: parent anchors.fill: parent
smooth: true visible: model.preview != null
pixmap: model.screenshot asynchronous: true
cache: false
source: model.preview
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }
} }