1. kdialog --getsaveurl (or --getsavefilename) 2. Enter "foo#bar" in the file name field 3. Navigate by clicking on a folder, upwards or something like that 4. The filename changes to "foo%23bar", then "foo%2523bar", then "foo%252523bar" and so on This is caused by treating the input to KComboBox as plain string representing a local path in KFileWidgetPrivate::locationEditCurrentText (QDir::fromNativeSeparators(locationEdit->currentText());), but writing a proper URL with QUrl::toDisplayString() in KComboBox::changeUrl. Not sure what to do about that though, as the filename field is supposed to accept full URLs as well as bare filenames. While the URL "foo#bar" would represent the filename "foo" (the #fragment doesn't matter), it would be a valid local filename as-is. The inconsistency between writing and reading the URL from KComboBox causes that on each read->write iteration, it's further encoded.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/178
Git commit f29ce254864ce575d12717896edcf71b35c2a30a by Ahmad Samir. Committed on 22/10/2020 at 09:01. Pushed by dfaure into branch 'master'. kfilewidget: keep the text in the Name box when navigating In _k_urlEntered, if keepLocation is true (which it is in e.g. Saving mode), KComboBox::changeUrl() was called to update the item in the Name KUrlComboBox, AFAIU this is mainly to show the icon of the mimetype of the file in the KComboBox. One issue with that approach is that if the user types "some#file" and then goes up (i.e. navigate in the view) the text will change to "some%23file", the, '#' is encoded to %23, then going up again will encode "%" to '%25', and the text becomes "some%2523file"... etc. Replace changeUrl() with KComboBox::setItemIcon(), this way the icon is updated and the text typed by the user is kept as-is. The same logic is used through out code (e.g. setDummyHistoryEntry). Unit test written by dfaure. FIXED-IN: 5.76 M +26 -0 autotests/kfilewidgettest.cpp M +4 -4 src/filewidgets/kfilewidget.cpp https://invent.kde.org/frameworks/kio/commit/f29ce254864ce575d12717896edcf71b35c2a30a
*** Bug 426485 has been marked as a duplicate of this bug. ***