New Krazy check: Forbidden Qt classes

Thiago Macieira thiago at kde.org
Thu Apr 26 14:41:33 BST 2007


Sebastian TrĂ¼g said:
> On Thursday 26 April 2007 01:19:06 David Faure wrote:
>> QUrl has dangerous/broken(imho) API, e.g. QUrl::toString() gives a
>> string
>> that cannot be parsed back as a url (like we do in many many places with
>> KUrl::url(), e.g. over DBus), because e.g. a '#' in the path will appear
>> as
>> a '#' in QUrl::toString(), and QUrl(thatstring) will see it as a
>> reference.

> Now this is really a problem. I did it the same way to pass QUrls over
> DBus as
> strings:
>
> QDBusArgument << QUrl.toString

Use QUrl::url() for that. It returns a QString that is parseable.

> QDBusArgument >> QString
> QUrl(QString)

If the string was created using QUrl::url(), this is correct.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358






More information about the kde-core-devel mailing list