Bug 327898

Summary: KFileDialog locationEdit reset undo history when there are more than one characters
Product: [Frameworks and Libraries] frameworks-kio Reporter: Yichao Yu <yyc1992>
Component: Open/save dialogsAssignee: David Faure <faure>
Status: CONFIRMED ---    
Severity: normal CC: groszdanielpub, kdelibs-bugs, nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Yichao Yu 2013-11-21 13:47:22 UTC
(I'm not sure if kdecore is the right component but I cannot find kfile...)

In KFileDialog, whenever (except when typing the first character) the location in the locationEdit combobox changes, the undo history is reset. For selecting one item from the dropdown menu in the combobox, this reset seems to be the (default) behavior of the combobox (which is ... fine). However, the reset also happens whenever one changes directory, edit the combobox, and selects a file in the view above.

The direct cause of the reset seems to be QLineEdit::setText.
For the reset when typing and selecting a file, the bug path seems to be the call of `locationEdit->setItemIcon` and `locationEdit->setItemText` in KFileWidgetPrivate::setDummyHistoryEntry. For changing directory, it looks a lot more complicated (resets 3 - 4 times).

From what I have seen, it seems that the bug is pretty deep in how KFileDialog handles url changes and I'm not sure how to fix it.
Comment 1 Nate Graham 2018-04-10 21:59:13 UTC
Can you still reproduce this with KDE Frameworks 5.45?
Comment 2 Yichao Yu 2018-04-10 22:14:13 UTC
I'm actually pretty confused by the version number scheme right now so I'm not really sure which version I have. The kdialog package version is 17.12.1 installed from Feburary and kdialog --version gives me 2.0. I can still reproduce exactly this problem with these version.
Comment 3 Yichao Yu 2018-04-10 22:17:58 UTC
Actually I can't reproduce this for the location but I can for the filename box.
Comment 4 Nate Graham 2018-04-16 04:02:54 UTC
Thanks for testing again!