Skip to content

kfilewidget: keep the text in the Name box when navigating

Ahmad Samir requested to merge work/ahmad/kfilewidget-cdup into master

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.

BUG: 418711 FIXED-IN: 5.76

Edited by Ahmad Samir

Merge request reports