Hi,

> > Bonus question: During the port I see lots of old code which did something
> > like KUrl(somePathOrUrlString).fileName() to get the basename of a path.
> > Assuming we only have paths or urls without query parts or hash fragments,
> > this should be as simple as getting the mid of the string after the last
> > occurrence of a '/' character.

Since Qt 5.2 there is a QUrl::fileName() method [1].

It also says "Note that, if this QUrl object is given a path ending in a 
slash, the name of the file is considered empty." so don't do trailing 
slashes.

Cheers,
Kai Uwe

[1] http://qt-project.org/doc/qt-5/qurl.html#fileName


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to