Bug 426728 - Cannot save a file named "file".txt (i.e. it includes double quotes)
Summary: Cannot save a file named "file".txt (i.e. it includes double quotes)
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: 5.105.0
Platform: Arch Linux Linux
: VHI normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: regression
: 473764 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-19 13:43 UTC by Patrick Silva
Modified: 2025-04-09 14:13 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.16
Sentry Crash Report:


Attachments
screenshot (143.01 KB, image/png)
2020-09-19 13:43 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-09-19 13:43:20 UTC
Created attachment 131776 [details]
screenshot

STEPS TO REPRODUCE
1. open Kate text editor
2. type anything and press ctrl+s
3. set file name to "file".txt and press enter/return

OBSERVED RESULT
the file is not save and an error message says "You can only select one file".
See the attached screenshot please.

EXPECTED RESULT
the file sohuld be saved

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.0
Comment 1 Nate Graham 2020-09-23 18:23:23 UTC
Heh, can confirm.
Comment 2 Méven Car 2020-10-25 09:12:16 UTC
this concerns saving contrary to https://bugs.kde.org/show_bug.cgi?id=185433
Comment 3 Patrick Silva 2023-08-26 22:41:46 UTC
*** Bug 473764 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2023-08-27 10:25:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1396
Comment 5 Méven Car 2023-09-02 13:00:33 UTC
Git commit a2b5765f64c7a38a683611654e4d0a61de87ef1a by Méven Car, on behalf of Andreas Bontozoglou.
Committed on 02/09/2023 at 14:59.
Pushed by meven into branch 'master'.

[kfilewidget] Fixing saving to files with quotes

- Escaping double quotes in KFileWidgetPrivate::setLocationText(QUrl)
- Adding a test for single-file mode (KFile::File)

M  +108  -0    autotests/kfilewidgettest.cpp
M  +1    -2    src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/-/commit/a2b5765f64c7a38a683611654e4d0a61de87ef1a
Comment 6 Nate Graham 2023-09-11 16:02:52 UTC
Git commit 5812fda982480942b8747fb639fdc654b5fa56da by Nate Graham, on behalf of Andreas Bontozoglou.
Committed on 11/09/2023 at 17:48.
Pushed by ngraham into branch 'kf5'.

[kfilewidget] Fixing saving to files with quotes

- Escaping double quotes in KFileWidgetPrivate::setLocationText(QUrl)
- Adding a test for single-file mode (KFile::File)
(cherry picked from commit 6a5736ce30494f6deab3489725815a7d33e1bacf)

M  +108  -0    autotests/kfilewidgettest.cpp
M  +1    -1    src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/-/commit/5812fda982480942b8747fb639fdc654b5fa56da
Comment 7 Patrick Silva 2023-10-20 17:13:53 UTC
This bug is still reproducible Arch Linux and neon unstable.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Graphics Platform: Wayland
Comment 8 Nate Graham 2023-10-20 19:16:38 UTC
Can also reproduce again. >:(
Comment 9 Nate Graham 2025-03-04 17:15:33 UTC
Aaand fixed for me again.
Comment 10 Patrick Silva 2025-03-04 23:21:39 UTC
it's still reproducible on my system.

Operating System: Arch Linux 
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Graphics Platform: Wayland
Comment 11 Bug Janitor Service 2025-03-14 14:45:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1834
Comment 12 Akseli Lahtinen 2025-03-18 20:13:06 UTC
Git commit b8db3079308d9f5e2141326e07f0bbd73bb2c0e9 by Akseli Lahtinen.
Committed on 18/03/2025 at 20:13.
Pushed by akselmo into branch 'master'.

KFileWidget: Allow saving single file with double quotes

The tokenizer would previously remove any and all double quotes, so
saving with them would be impossible.

In cases where we're saving only one file, make sure to escape the
double quotes for the tokenizer to know they should be kept around

M  +3    -0    autotests/kfilewidgettest.cpp
M  +2    -1    src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/-/commit/b8db3079308d9f5e2141326e07f0bbd73bb2c0e9