Bug 512559 - Slideshow (Non Random) does not remember the last shown picture
Summary: Slideshow (Non Random) does not remember the last shown picture
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image & Slideshow wallpaper plugins (other bugs)
Version First Reported In: 6.5.3
Platform: CachyOS Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-11-24 14:46 UTC by IT-KB
Modified: 2026-06-11 16:59 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.7.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description IT-KB 2025-11-24 14:46:15 UTC
Slideshow (Set to "A-Z") restarts from first picture after reboot/shutdown or logout. From my understanding it should remember the last shown picture and continue from there.
Comment 1 IT-KB 2025-11-26 10:33:02 UTC
this did not happen on plasma 6.3.6 and 6.4.5
Comment 2 IT-KB 2025-11-28 10:31:13 UTC
STEPS TO REPRODUCE
1. Select Folder trough GUI to run as slideshow (A-Z)
2. Select "Next Wallaper" from desktop or wait.
3. restart/logoff
4. Slideshow starts from first picture in selected folder

OBSERVED RESULT
Slideshow restarts at first picture of selected folder

EXPECTED RESULT
Slideshow should show the last picture shown, before logoff/shutdow/restart

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux 
KDE Plasma Version: 6.5.3

ADDITIONAL INFORMATION
i tested other versions of KDE (6.3.6, 6.4.5). The Expected result is given there.
Comment 3 kde-bugtracking 2025-12-07 13:50:07 UTC
I can confirm the behavior for sorting order "A to Z" and also for "Z to A", "Date modified (newest first)", and "Date modified (oldest first)".
In addition to the behavior occuring on restart and logoff, it also happens after the screen was locked and the displays turned off for a while (due to powersaving options).

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Comment 4 Fushan Wen 2026-06-07 06:35:42 UTC
The bug was introduced in commit 471c56e1f9 ("wallpapers/image: Port image model to QUrl"). When a slideshow wallpaper saves its state, the image URL is stored as "file:///path/to/image.jpg". QUrl::fromLocalFile() incorrectly treated this URL string as a local file path, creating a malformed URL "file:file:///path/to/image.jpg", causing the image lookup to fail and the slideshow to restart from the first image
Comment 5 Bug Janitor Service 2026-06-07 08:17:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6690
Comment 6 Bug Janitor Service 2026-06-09 14:21:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6709
Comment 7 Tobias Fella 2026-06-10 09:24:13 UTC
Git commit 39244fbe255eabc00c19d88ef05e1dd9fb216878 by Tobias Fella, on behalf of Fushan Wen.
Committed on 10/06/2026 at 09:24.
Pushed by tfella into branch 'Plasma/6.7'.

wallpapers/image: Fix slideshow not remembering the last shown picture

When a slideshow wallpaper is saved, the image URL is stored as a string
like "file:///path/to/image.jpg". When Plasma restarts, this URL string
is passed to SlideModel::indexOf().

The previous code used QUrl::fromLocalFile(packagePath) which incorrectly
treats the URL string as a local file path, creating a malformed URL like
"file:file:///path/to/image.jpg". This caused the image lookup to fail
(indexOf() returned -1), making the slideshow restart from the first image
instead of the last shown one.

Fix this by using QUrl::fromUserInput(packagePath) which correctly handles
both local file paths and URL strings.

Also add a unit test to verify indexOf() works correctly with URL strings.
Assisted-by: Kilo Code: glm-5
(cherry picked from commit e21f6d5c79ef018ff6bab3eafd1cb1491d47391e)

M  +21   -0    wallpapers/image/plugin/autotests/test_slidemodel.cpp
M  +1    -1    wallpapers/image/plugin/slidemodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/39244fbe255eabc00c19d88ef05e1dd9fb216878