[Patch] KUrl::prettyUrl and xmpp: url

David Faure faure at kde.org
Mon Oct 8 22:40:52 BST 2007


On Monday 08 October 2007, Hans Meine wrote:
> Am Montag, 08. Oktober 2007 16:37:53 schrieb Olivier Goffart:
> > > This cries for two versions of pathOrUrl, doesn't it?  Or prettyUrl()
> > > with some argument.. or prettyUrlOrPath() (which I would like if the
> > > order wasn't inconsistent with pathOrUrl()).
> >
> > The problem is that the most of the current codebase already use pathOrUrl
> > for display. According to lxr.kde.org , there is 300 reference of it.
> > It's a bit late to change the meaning of it.
> > I think that all theses method make a confusing API anyway.
> 
> Right.  I wanted to propose to add the other version, but then I came up with 
> the name prettyUrlOrPath(), which only proves that it is confusing.
> 
> To clarify: I'd propose to *add* something along fullUrlOrPath() [name open to 
> discussion] which does not throw away any information but mostly resembles 
> url().
> 
> BTW: Another use case (apart from krun) for that would be drag&drop into 
> konsole - I keep removing file:// prefixes there..

I fail to see why pathOrUrl (with the call to prettyUrl) wouldn't be OK for e.g. konsole.
The pasted url will obviously appear to the user, so better prettyUrl() than url()
(less ugly, and no password being exposed to the user passing by).

KRun should use if (local) then path() else url(). It's a special case (because of
the compat with non-kde apps which want a path for local files instead of a url),
that doesn't need a new KUrl method. 

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




More information about the kde-core-devel mailing list