Bug 454692 - Image wallpaper handling fails if image name contains special chars
Summary: Image wallpaper handling fails if image name contains special chars
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image Wallpaper (show other bugs)
Version: 5.24.90
Platform: Archlinux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 440071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-01 09:40 UTC by Schlaefer
Modified: 2022-06-02 19:02 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26


Attachments
Issues Image wallpaper files with special chars (1.84 MB, video/webm)
2022-06-01 09:40 UTC, Schlaefer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Schlaefer 2022-06-01 09:40:45 UTC
Created attachment 149372 [details]
Issues Image wallpaper files with special chars

STEPS TO REPRODUCE
1. Have an image file which contains special chars e.g. an "#" ala "test #1.jpg" and try to use with in the Image wallpaper plugin

OBSERVED RESULT

- Adding an image via Drag and Drop onto the wallpaper dialog fails
- Setting the image via "Set as Wallpaper" context menu fails
- Setting an existing image in Image wallpaper fails
- Deleting an existing image in Image wallpaper fails

EXPECTED RESULT

All of the above shouldn't fail.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.18.1-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 5500 XT
Comment 1 Fushan Wen 2022-06-01 13:00:12 UTC
Can reproduce
Comment 2 Bug Janitor Service 2022-06-01 15:13:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1793
Comment 3 Fushan Wen 2022-06-01 15:35:01 UTC
Git commit 9a2657668384a5b2396d3375733d7b8662b99ccc by Fushan Wen.
Committed on 01/06/2022 at 15:14.
Pushed by fusionfuture into branch 'master'.

wallpapers/image: use url argument type in `addUsersWallpaper`

The hash sign # will be converted to % when using string argument type.

M  +2    -2    wallpapers/image/plugin/imagebackend.cpp
M  +1    -1    wallpapers/image/plugin/imagebackend.h

https://invent.kde.org/plasma/plasma-workspace/commit/9a2657668384a5b2396d3375733d7b8662b99ccc
Comment 4 Fushan Wen 2022-06-01 15:35:09 UTC
Git commit 31b7090224770e7879c901433c0423817f285aec by Fushan Wen.
Committed on 01/06/2022 at 15:14.
Pushed by fusionfuture into branch 'master'.

wallpapers/image: use string data type for `image` property

`wallpaper.configuration.Image` has string type, and assigning a string
value from QML to a url in C++ will truncate the string at the hash char.
This changes `image` data type to string to fix the bug.
FIXED-IN: 5.26

M  +1    -1    wallpapers/image/imagepackage/contents/ui/main.qml
M  +5    -5    wallpapers/image/plugin/imagebackend.cpp
M  +3    -3    wallpapers/image/plugin/imagebackend.h

https://invent.kde.org/plasma/plasma-workspace/commit/31b7090224770e7879c901433c0423817f285aec
Comment 5 Fushan Wen 2022-06-01 15:35:17 UTC
Git commit 79e55866472dcd812f8cde4830e89a4bcaf47263 by Fushan Wen.
Committed on 01/06/2022 at 15:14.
Pushed by fusionfuture into branch 'master'.

wallpapers/image: update tests

A new image is added to the default folder.

A  +27   -0    wallpapers/image/plugin/autotests/commontestdata.h     [License: GPL(v2.0+)]
M  +6    -3    wallpapers/image/plugin/autotests/test_imagefinder.cpp
M  +17   -13   wallpapers/image/plugin/autotests/test_imagelistmodel.cpp
M  +28   -24   wallpapers/image/plugin/autotests/test_imageproxymodel.cpp
M  +2    -1    wallpapers/image/plugin/autotests/test_imagesizefinder.cpp
M  +6    -3    wallpapers/image/plugin/autotests/test_packagefinder.cpp
M  +7    -6    wallpapers/image/plugin/autotests/test_packagelistmodel.cpp
M  +2    -1    wallpapers/image/plugin/autotests/test_slidefiltermodel.cpp
M  +12   -9    wallpapers/image/plugin/autotests/test_slidemodel.cpp
A  +-    --    wallpapers/image/plugin/autotests/testdata/default/# BUG454692 file name with hash char.png
M  +4    -3    wallpapers/image/plugin/autotests/tst_imagebackend.qml

https://invent.kde.org/plasma/plasma-workspace/commit/79e55866472dcd812f8cde4830e89a4bcaf47263
Comment 6 Nate Graham 2022-06-02 19:02:29 UTC
*** Bug 440071 has been marked as a duplicate of this bug. ***