'lightweight' QDir::isAbsolutePath replacement ?

Jos van den Oever jvdoever at gmail.com
Thu Mar 6 14:17:39 GMT 2008


2008/3/6, Ralf Habacker <ralf.habacker at freenet.de>:
>     return (path.startsWith(QLatin1Char('/')) || (path.[0].isLetter() &&
>  path[1] == QLatin1Char(':')) ) ;

This does not work for a path to a network drive on windows which has the form:
 \\server\share\dir\subdir\file

See:
http://en.wikipedia.org/wiki/Path_(computing)#Uniform_Naming_Convention

Also '\' on Windows means, 'root of active drive'. So 'dir \' gives
you the same as 'dir d:' if you are in a directory on disk d:.

Cheers,
Jos




More information about the kde-core-devel mailing list