[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Request to change signature of a KUrl method
From:       David Faure <faure () kde ! org>
Date:       2009-09-16 21:22:58
Message-ID: 200909162322.58981.faure () kde ! org
[Download RAW message or body]

On Wednesday 16 September 2009, Aurélien Gâteau wrote:
> Ramon Zarazua wrote:
> > Hello.
> >
> > I have been working with KUrls frequently, and often I Need to clean the
> > path of a URL before passing it in as an argument into a function. I am
> > just suggesting having cleanPath return a reference to itself, to allow
> > chaining, and avoid having to create temporaries to call the function.
> 
> I suggest introducing a "KUrl::cleanedPath(const CleanPathOption&
> options) const" method which would not alter the current url and return
> a cleaned version. This is BC and quite consistent with other Qt API
> (example, QRect::adjust() and QRect::adjusted())

Except that the name "cleanedPath" would make one think that this method
returns a path.... not a url.

I don't really see the problem with having to call cleanPath on a separate 
line. It's a rather expensive method, too, so "I have to call it everywhere" 
sounds a bit wrong anyway ;)
Plus, you can always make a wrapper function...

-- 
David Faure, faure@kde.org, sponsored by Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic