KURLRequester Problem

Frerich Raabe raabe at kde.org
Mon Feb 9 08:52:56 GMT 2004


On Mon, Feb 09, 2004 at 08:35:42AM +0100, David Faure wrote:
> On Saturday 07 February 2004 20:02, Frerich Raabe wrote:
> > while tackling bug 74485 I came up with the attached patch, but before I
> > commit I'd some reviewal before I commit it since I'm not sure it is a
> > proper fix. 
> It looks a bit weird indeed - but that's because setURL takes a string (instead of
> a KURL), and I suppose uses fromPathOrURL on it? This makes the semantics
> a bit fuzzy imho, but that's not your fault :)

Yes I must admit the KURL semantics still confuse me, I always have to
triple check every single QString<->KURL conversion. It seems it's not
hard to misuse it.

> > In particular, I'm not sure whether there are any other 
> > protocols (other than file:) in which characters with a special
> > meaning in URLs (such as '?', as mentioned in the bug report) should
> > be preserved.
> 
> Might need a && !u.hasRef()   - try a file with a # in it.

Did that, works.

> Oh, and prettyURL takes arguments like StripFileProtocol to do what this patch
> does, in one line. I'm not sure how it handles refs though.

I originally tried that but it did not work - looking at the KURL code it
seems StripFileProtocol does what the name suggests - removing the "file:"
part. It does not touch the special characters at all though.

- Frerich

-- 
if new true friend not protected for explicit private union, break
case and try using this.




More information about the kde-core-devel mailing list