[Development] New QUrl implementation

Thiago Macieira thiago.macieira at intel.com
Fri Dec 23 20:22:38 CET 2011


On Friday, 23 de December de 2011 11.29.34, Thiago Macieira wrote:
> https://qt.gitorious.org/~thiago-intel/qt/thiago-intels-qtbase/commits/new-
> qurl

Convert tst_qurl.cpp from Latin-1 to UTF-8
Change-Id: If21658bd5e4af0fdcc403b054fc1b8f46b5fcfb0

This was a very, very old file, encoded in Latin 1. It was created before we 
came to our senses. By the way, loading it in Qt Creator in Latin 1 mode 
exposes a bug with dead keys on X11.

Move the QByteArray-based percent-encoding activities to QByteArray
Change-Id: I6639ea566d82dabeb91280177a854e89e18f6f8d

The new URL recoder does not operate on 8-bit, but on 16-bit. So all the 8-bit 
percent-encoding functions and tests are moved to QByteArray and its unit 
test. Previously, this commit deprecated QUrl::fromPercentEncoded and 
QUrl::toPercentEncoded. Based on our discussion on the mailing list, I've un-
deprecated them.

Mark QUrl::{to,from}Punycode as deprecated since 5.0
Change-Id: I9b95b4bd07b4425344a5c6ef5cce7cfcb9846d3e

    These functions are now aliases to {to,from}Ace, which are usually
    what you want. The original functions from Qt 4.0 had the wrong
    semantics and wrong name. The new ones from Qt 4.2 execute the ACE
    processing from IDNA (specifically, the ToASCII and ToUnicode
    operations described in the RFC).

Add the code that recodes URLs.
Change-Id: I997eccfd2f9ad8487305670b18d6c806f4cf6717
and
Remove the tolerant parsing function and make the recoder tolerant
Change-Id: I68a0c9fda6765de05914cbd6ba7d3cea560a7cd6

This is the core of the new QUrl functionality, which is the URL recoder. I 
call it "recoder" because it doesn't encode or decode, it simply transforms 
from different styles of encoding. As I expressed many moons ago, there is no 
more "fully-decoded" mode.

It's in two commits because the first implementation was strict, with a 
tolerant front-end. The new implementation is tolerant, which is the 99% use-
case. The strict mode, which I still haven't implemented, will be done by 
doing checks on the data.

Long live QUrlQuery
Change-Id: Ia61096fe5060b486196ffb8532e7494eff58fec1

The new QUrlQuery class, which deals with the query in a URL. This allows QUrl 
to be simpler and handle the query as one single string.

The next three commits deal with updating the recoder so that it's more 
efficient with the use-case intended.

Then we have:
Change QUrlQuery to keep the order
Change-Id: Id4ca02130fd6235b32fb971a8b448211e609986a

As discussed previously, keeping the order is important. This commit 
implements that.

I can squash the commit series above so we have only one adding the recoder 
and only one adding QUrlQuery.

Then the work in QUrl starts:

Move some of qurl.cpp ino other files for ease of maintenance
Change-Id: I0b32c0bf0ee6c2f08dc3200c44af3c9d1504a3df
    
    The parsing code is now in qurlparser.cpp, whereas the IDNA related
    code is in qurlidna.cpp.
    
Remove the methods dealing with the break-down of the query from QUrl
Change-Id: I34820b3101424593d0715841a2057ac3f74d74f0

Long live the new QUrl implementation.
Change-Id: I6d340b19c1a11b98a48145152513ffec58fb3fe3

The main implementation

QUrl: Always lowercase the scheme
Change-Id: I8d467014d22384f1be15fdd746e20b1153a82a4e

Do we want this? I think so.

Then there are a couple more commits.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111223/b864024a/attachment.sig>


More information about the Development mailing list