KUrl or QUrl bug?

Thiago Macieira thiago at kde.org
Fri Jun 18 17:20:32 BST 2010


Em Sexta-feira 18. Junho 2010, às 17.09.37, Sebastian Trüg escreveu:
> On 06/18/2010 04:47 PM, Hans Meine wrote:
> > On Friday 18 June 2010 16:38:15 Sebastian Trüg wrote:
> >> On 06/18/2010 03:45 PM, David Faure wrote:
> >>> Yes, because "no query" isn't the same as "an empty query", IIRC.
> >>> So after removing the query, you have a url with "an empty query".
> >>> Did you try calling .url() on both urls? I suppose url3 will have a
> >>> trailing '?'.
> >> 
> >> exactly. I just think it is unwanted behavior. What exactly is this good
> >> for? Who would ever want to have an empty query?
> > 
> > Famous last words.. ;-)
> > 
> > Answer: "Broken" (unusual) websites?
> 
> OK, I can see that. But still this is a special case that should IMHO
> not be the default. It should require a dedicated method call or
> something. As you state yourself it is a corner case for "broken" und
> "unusual" web sites.
> 
> I doubt that any user of QUrl would not think that removing all query
> items results in a URL without a query.
> 
> The only place where the behavior is stated in the QUrl documentation is
> setEncodedQuery(), a method very rarely used I assume. So IMHO that
> should be enough to set "the empty query" while removing query items
> should always result in no query at all.

I added support for empty queries because KDE required it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- 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://mail.kde.org/pipermail/kde-core-devel/attachments/20100618/dbf5df7f/attachment.sig>


More information about the kde-core-devel mailing list