Text highlighting in the url bar simplified
Review Request #100154 - Created Nov. 16, 2010 and discarded
|Jon Ander Peñalba|
I've simplified text highlighting. I think the behaviour hasn't changed, but a second opinion is welcome :) I've removed the Qt::escape (and updated the test accordingly) because I find it useless, but if it needs to be there for any reason there's no problem in putting it back.
The 'listitem_test' test passes.
I have to admit, that's way more readable. :) I'll test that tomorrow for stuff like "foo" with an url or title in "foofoofoo", but other than that, I think the tests cover all the other crappy cases I can think of (or Andrea could think of). ;) We probably still need a Qt::escape at some point, mostly for page titles that have stupid characters like '<' and '>', twiki(http://twiki.org/cgi-bin/view/TWiki/WhatIsTWiki) is good at that ! But I agree ideally the urls have no reason to be escaped. I guess we could refine that in another commit
I am not convinced by the patch, it looks like a side effect paradise. For example what if there is two words like this: "foo( )bar", the regexp would not be what you expect. Not to mention all the control character of regexps: . * [ ] + ( ), etc