Add support for automatically set url location bar to non-editable when focus out
Review Request #107748 - Created Dec. 16, 2012 and submitted
after edit the url the location bar always kept editable is very annoying. since crumb-bread location is much more useful for navigation. BTW this is also the default behavior in Finder (Mac FM) AFAIK. This patch add support to reset the location bar to non-editable when it's focus out, and also add an option to set it back to the old behavior.
localily tested, no problem.
Great feature, Thanks :) I tested the patch and it worked without problems. But I discovered a small usability bug - When the user enables "Editable location bar" and "Automatically set location bar to non-editable if focus out" then the behavior of Dolphin is wrong, because in this case the location bar should always be in the editable-mode. In my mind, the behavior of "Automatically set location bar to non-editable if focus out" should be the common behavior of the location bar, when "Editable location bar" is disabled. And when "Editable location bar" is enabled, the location bar should always stay in the editable-mode (current behavior) => With this approach, we can remove the settings-option "Automatically set location bar to non-editable if focus out". What do you think?
I strongly recommend reading this bug report before doing anything: https://bugs.kde.org/show_bug.cgi?id=214730 Peter closed it because there doesn't seem to be any demand for it. So i guess it's a decision for Frank to make now.
First of all, thanks for the patch! I would not like to add an option for this, but the approach to change back to 'breadbrumb' mode when the 'Editable location bar' setting is set to false looks interesting. I would guess that this satisfies the vast majority of users. However, I see a problem: when editing the URL and then switching to another application (maybe to look up a directory name), the URL navigator switches back to 'breadcrumb' mode. What's worse, if you un-focus the URL navigator while you're in the middle of entering something, the input is lost. Maybe it would be better to only switch back to 'breadcrumb' mode after the URL is changed (i.e., when the navigator's urlChanged(QUrl) signal has been received)? This would also make the eventFilter unnecessary.
Review request changed
use urlChanged to reset the status. looks ok, seems it only emitted after url changed. It make sense to reset to breakcrumb if user click edit, but enter another directoy via mouse.
Revision 3 (+12)
Thanks for the new patch! Looks good, there is just one thing I noticed: When I click the location bar and then do not edit the URL, but just press "Enter", I think that I would also expect that the location bar is restored to "breadcrumb" mode. Or maybe I'm wrong? What do others think?