Commit 51107d9a authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: add current image to list if it's not in list

The current wallpaper image can be set by a Plasma script. In that case,
the wallpaper is not added to the list, so also check the current image
is already added after opening the config dialog.

BUG: 458364
FIXED-IN: 5.26
parent 01a57636
Pipeline #223394 passed with stage
in 6 minutes and 10 seconds
......@@ -24,9 +24,13 @@ Item {
Connections {
target: imageWallpaper
function onLoadingChanged() {
if (!imageWallpaper.loading) {
wallpapersGrid.resetCurrentIndex();
if (imageWallpaper.loading) {
return;
}
if (configDialog.currentWallpaper === "org.kde.image" && imageModel.indexOf(cfg_Image) < 0) {
imageWallpaper.addUsersWallpaper(cfg_Image);
}
wallpapersGrid.resetCurrentIndex();
}
function onWallpaperBrowseCompleted() {
......
......@@ -376,7 +376,7 @@ void ImageBackend::slotWallpaperBrowseCompleted()
QString ImageBackend::addUsersWallpaper(const QUrl &url)
{
auto results = static_cast<ImageProxyModel *>(wallpaperModel())->addBackground(url.toLocalFile());
auto results = static_cast<ImageProxyModel *>(wallpaperModel())->addBackground(url.isLocalFile() ? url.toLocalFile() : url.toString());
if (!m_usedInConfig) {
m_model->commitAddition();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment