Summary: | Image wallpaper handling fails if image name contains special chars | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Schlaefer <openmail+kde> |
Component: | Image Wallpaper | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, notmart, qydwhotmail, sloppedmail, this.is.reid, tobiasneisser |
Priority: | NOR | ||
Version: | 5.24.90 | ||
Target Milestone: | 1.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/commit/0c7854a7b587d713f17883003f436af972bb08ff | Version Fixed In: | 5.27 |
Sentry Crash Report: | |||
Attachments: | Issues Image wallpaper files with special chars |
Can reproduce A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1793 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 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 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 *** Bug 440071 has been marked as a duplicate of this bug. *** As of 5.26.4, I've been able to reproduce this with a backslash anywhere in the path of the image file, reopening the bug as it doesn't seem to be completely fixed Operating System: Arch Linux KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.101.0 Qt Version: 5.15.7 Kernel Version: 6.1.1-arch1-1 (64-bit) Graphics Platform: Wayland (In reply to Reiddragon from comment #7) > As of 5.26.4, I've been able to reproduce this with a backslash anywhere in > the path of the image file, reopening the bug as it doesn't seem to be > completely fixed > > Operating System: Arch Linux > KDE Plasma Version: 5.26.4 > KDE Frameworks Version: 5.101.0 > Qt Version: 5.15.7 > Kernel Version: 6.1.1-arch1-1 (64-bit) > Graphics Platform: Wayland Can reproduce but I don't understand why you have to add a backslash to your filename. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2460 Git commit 0c7854a7b587d713f17883003f436af972bb08ff by Fushan Wen. Committed on 25/12/2022 at 14:04. Pushed by fusionfuture into branch 'master'. wallpapers/image: use `QUrl::fromUserInput` to sanitize filename fromUserInput will add file:// for local files, and sanitize some bizzare characters in filenames. FIXED-IN: 5.27 M +2 -1 wallpapers/image/plugin/autotests/commontestdata.h M +1 -0 wallpapers/image/plugin/autotests/test_imagefinder.cpp M +2 -0 wallpapers/image/plugin/autotests/test_imagelistmodel.cpp M +4 -0 wallpapers/image/plugin/autotests/test_imageproxymodel.cpp M +2 -0 wallpapers/image/plugin/autotests/test_slidemodel.cpp A +- -- wallpapers/image/plugin/autotests/testdata/default/\ BUG454692 file name with backslash.png M +6 -0 wallpapers/image/plugin/autotests/tst_imagebackend.cpp M +14 -0 wallpapers/image/plugin/autotests/tst_imagebackend.qml M +1 -1 wallpapers/image/plugin/autotests/tst_imagefrontend.cpp M +4 -4 wallpapers/image/plugin/imagebackend.cpp M +14 -23 wallpapers/image/plugin/utils/mediaproxy.cpp M +0 -3 wallpapers/image/plugin/utils/mediaproxy.h https://invent.kde.org/plasma/plasma-workspace/commit/0c7854a7b587d713f17883003f436af972bb08ff *** Bug 464658 has been marked as a duplicate of this bug. *** |
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