Hey all, esp. David.

I'm working on the KDevelop port away from KUrl and have some questions which 
I could not answer myself with the existing porting notes and KUrl 
documentation:

a) What should one do with KUrl::AddTrailingSlash? QUrl::setPath(QUrl::path() 
+ '/'))?
b) What about KUrl::relativePath() and KUrl::relativeUrl()? I found no good 
replacement for either of them. QUrl a; QUrl b; a.mid(b.length()) looks pretty 
wrong to me (was proposed to me as a solution). This will never add the "../" 
parts for sibling paths, no?

Would be nice if someone could answer these questions and add them to the 
porting guide and the KUrl documentation.

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. But that might fail on Windows of course... So 
is there something in Qt which does this without constructing a full QUrl or 
is this still the best approach?

Bye
-- 
Milian Wolff
m...@milianw.de
http://milianw.de

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

Reply via email to