Question about KUrl::equals/cmp...

David Faure faure at kde.org
Wed Nov 4 15:34:25 GMT 2009


On Wednesday 04 November 2009, Dawit A. wrote:
> Is there a reason why KUrl::equals with its second parameter set to
> KUrl::CompareWithoutTrailingSlash or KUrl::cmp's second parameter set to
>  true returns "http://www.kde.org/" and "http://www.kde.org" are not equal
>  to each other ?
 
Ah, I think I know. Tricky: with http these urls are equal, while with e.g. 
FTP they are not, since ftp://user@host redirects to ftp://user@host/home/user
(on a linux server), while ftp://user@host/ is the root dir.
Basically we treat "no path" as "please go to the default starting directory".
But I'm ok with an exception for HTTP, where indeed people expect these
two urls to be the same.
Please add a unit test if you fix it.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).




More information about the kde-core-devel mailing list