KUrl or QUrl bug?

Thiago Macieira thiago at kde.org
Sat Jun 19 09:12:56 BST 2010


Em Sábado 19. Junho 2010, às 08.53.27, Sebastian Trüg escreveu:
> On 06/18/2010 11:28 PM, Ingo Klöcker wrote:
> > On Friday 18 June 2010, Sebastian Trüg wrote:
> >> On 06/18/2010 03:45 PM, David Faure wrote:
> >>> On Thursday 17 June 2010, Sebastian Trüg wrote:
> >>>> Hi guys,
> >>>> 
> >>>> please find attached a patch to the kurltest which will make it
> >>>> fail since an url on which you add a query item and then remove
> >>>> it are not equal anymore.
> >>> 
> >>> 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?
> > 
> > Who would ever want to remove a query item from a query? I assume you
> > need this because otherwise you wouldn't have filed this bug report. But
> > why exactly do you need this?
> 
> Well, maybe this can be seen as a corner case, too. But then it should
> at least be documented that removing all query items will not remove the
> query.
> As for why I need it: I am cleaning up query URLs for saving them
> without options. IMHO a stright-forward usecase. :)

Use setEncodedQuery to clear 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/20100619/db637fb9/attachment.sig>


More information about the kde-core-devel mailing list