Review Request: Clean up KUrl::setFileName and do not add a slash at the beginning when there is no slash in the path
Raphael Kubo da Costa
kubito at gmail.com
Sat Apr 4 21:55:43 BST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/523/
-----------------------------------------------------------
Review request for kdelibs.
Summary
-------
Currently, if you have:
KUrl test("foo.txt");
Then test.path() returns "foo.txt" and so does test.pathOrUrl(). But after you call test.setFileName("bar.txt"), test.path() and
test.pathOrUrl() both return "/bar.txt".
This patch makes setFileName not add this extra slash when there is no directory in the current path, and also cleans up some dead code.
Diffs
-----
/trunk/KDE/kdelibs/kdecore/io/kurl.cpp 948757
Diff: http://reviewboard.kde.org/r/523/diff
Testing
-------
I have tested it with local files as in the example given in the description. Using a path like "http://www.kde.org/test/foo.txt" and later calling setFileName maintains its correct behaviour -- path() returns "/test/bar.txt" and pathOrUrl() returns "http://www.kde.org/test/bar.txt".
Thanks,
Raphael
More information about the kde-core-devel
mailing list