Add QFileInfo::isNativePath
authorJoão Abecasis <joao.abecasis@nokia.com>
Wed, 8 Feb 2012 10:28:30 +0000 (11:28 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 14 Feb 2012 01:48:35 +0000 (02:48 +0100)
commit5c637e9171975a86ec1a3982579cd6f371b1d5ce
tree34c669c25e8a16abc7066097f30ca3805123de50
parent3f74aea9bb67bcd2ec463792ee111402f10825d5
Add QFileInfo::isNativePath

This function returns true if the file path can be used directly with
native APIs, modulo encoding and path separator conversions. This is
important for applications that interface with other libraries or simply
need to use native APIs together with Qt.

Traditionally, this information was available in QAbstractFileEngine and
forced users to explicitly create an engine or use internal API such as
QFile::fileEngine to access the underlying engine and this piece of
information.

Given its usefulness, exposing the information in a more visible place
is more appropriate. This reduces the need for people to know or care
about implementation details, like file engines...

The existing isLocalFs test was updated and repurposed to use the new
API, instead of relying on file engines and internal implementation
details of QFileInfo.

Change-Id: I65f497bb25741f6f7ea4d2c3b3562c8c4aab8bea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/corelib/io/qfileinfo.cpp
src/corelib/io/qfileinfo.h
tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp