Bug 506465

Summary: Double quotes in the path cause images to fail to open in Koko
Product: [Applications] Koko Reporter: Nate Graham <nate>
Component: GeneralAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: carl, olib141
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nate Graham 2025-07-02 02:07:18 UTC
STEPS TO REPRODUCE
1. Create a folder called "something" (including the double quotes) in your home folder and put a picture in it
2. Navigate there and open the picture in Koko


OBSERVED RESULT
Error message saying "The file or folder /home/[you]/%22something%22 does not exist".


EXPECTED RESULT
The file is opened


ADDITIONAL INFORMATION
Koko is built from today's git master
Comment 1 Bug Janitor Service 2025-08-06 21:27:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/koko/-/merge_requests/206
Comment 2 Oliver Beard 2025-08-07 14:12:16 UTC
Git commit 73b351653ed1842afd99ce7c7a790d588da20234 by Oliver Beard.
Committed on 07/08/2025 at 14:10.
Pushed by olib into branch 'master'.

Fix mishandling of URL containing quotes in QUrl–QString dance

Rather than keep converting a path between QUrl and QString, just keep it as a QUrl and do the right things: we have a QUrl, ImageFolderModel wants a QUrl. Keep it as a QUrl.

We can instead use QUrl functionality to get the parent directory, rather than manipulate a string. This fixes an issue where 'Open With'/arguments to a file where a parent directory has quotes, literally "something", causes an error in ImageFolderModel.

M  +2    -3    src/dirmodelutils.cpp
M  +1    -1    src/dirmodelutils.h
M  +3    -4    src/qml/Main.qml

https://invent.kde.org/graphics/koko/-/commit/73b351653ed1842afd99ce7c7a790d588da20234