On Monday 15 August 2011 15:42:20 Thiago Macieira wrote:
> Hello all
>
> So I've given some thought on QUrl in Qt 5, based on experience with
> improving it in Qt 4 as well as KUrl. Here's the major guidelines:
Good plans.
> - the setters will take an extra flag of type QUrl::ParsingMode (StrictMode
> and TolerantMode). Default should be TolerantMode.
What about the QUrl(QString) constructor? Can you make it parse in tolerant
mode? Ideally, could it accept both local paths and urls, like KUrl does? This
is extremely convenient, compared to having to sprinkle the code with
fromLocalFile() everywhere, and getting runtime bugs when forgetting to do so.
And it should accept both encoded and non-encoded urls (see
KUrl::_setEncodedUrl and related tests).
Generally, we have little control over urls from the web, so better have a as-
tolerant-as-possible constructor. More useful than getting an invalid url and
having to work around it in a thousand apps.
> - I'm wondering: should I add a mode that returns the entry non-normalised?
> i.e., if you write:
> QUrl("http://localhost/%66%6f%6f")
> usually:
> path() = "/foo"
> but should we have this?
> path(Original) = "/%66%6f%6f"
Is this what encodedPath() used to do? I forgot what the usefulness might be
though, maybe this is for sending to http servers (broken ones, which don't
consider /foo and /%66%6f%6f as equivalent)?
> [...]
OK.
My real feedback will come from kurltest once ported to Q5Url :-)
--
David Faure, [email protected], http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback