Do not restore previously empty location bar URL
Review Request #104982 - Created May 18, 2012 and submitted
The attached patch fixes the issue reported in the aforementioned bug report. Specifically, it stops Konqueror from restoring the location bar to the previous URL if a.) It was empty as in a newly created tab. b.) The user typed in a new URL that cannot be handled by Konqueror. The URL was launched with another application.
Tested the following three scenarios: 1.) Open a new tab in Konqueror and type-in a URL it cannot handle. 2.) Open a new tab, browse to any location, and then type-in a URL Konqueror cannot handle. 3.) Open a new tab, browse to any location, clear the location bar, and then type-in a URL Konqueror cannot handle. Results with the patch: 1.) The typed in URL remains in the location bar. 2.) The previous URL is restored in the location bar. 3.) Same as #2.
I'm ok with the change, but it seems this area is still buggy in any case... "the location bar must be restored to the URL of the content currently displayed" doesn't work here, e.g. when typing ~/foo.exe (yes a windows executable, everything else I tried got embedded) in the location bar in a tab that shows www.kde.org, doesn't result in a "revert" of the location bar url. Generally speaking, I'm not sure that it's such a problem that the location bar doesn't match the contents. This happens all the time -- e.g. when you start typing in the location bar ;) And this even gets saved when switching between tabs, very much on purpose. So maybe we just should not revert the location bar contents, just leave what the user typed. That's what the user in 270723 asks for, that's what my testing with foo.exe shows too (i.e. it's already the current behavior in some cases), and that's consistent with "we preserve what the user has typed" (already the case currently, when editing the location bar, without hitting Enter, and switching tabs).