diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-10-26 11:48:15 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-10-27 12:08:36 (GMT) |
commit | 02f3d23bc2cb6f4011918cff50fe157a8523c10b (patch) | |
tree | 573298bdf02b8e2ca59cd284838920e54c47ce43 /src | |
parent | 848bbec851ca1bb83ce43aa07240c28cdcb0125a (diff) | |
download | Qt-02f3d23bc2cb6f4011918cff50fe157a8523c10b.zip Qt-02f3d23bc2cb6f4011918cff50fe157a8523c10b.tar.gz Qt-02f3d23bc2cb6f4011918cff50fe157a8523c10b.tar.bz2 |
Add support for QFileInfo owner() & group() on Windows
Since windows doesn't have the concept of user and group IDs, the name
resolution has to be done differently. If the qt_ntfs_permission_lookup
flag is set (default = 0), the user information is retrieved through the
NTFS object security information.
Reviewed-by: Joao
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qfilesystemengine.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp index 9bfd382..8613dd7 100644 --- a/src/corelib/io/qfilesystemengine.cpp +++ b/src/corelib/io/qfilesystemengine.cpp @@ -349,17 +349,35 @@ void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry) //static QString QFileSystemEngine::resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &metaData) { +#if defined (Q_OS_SYMBIAN) + Q_UNUSED(entry); + Q_UNUSED(metaData); + return QString(); +#elif defined(Q_OS_WIN) + Q_UNUSED(metaData); + return QFileSystemEngine::owner(entry, QAbstractFileEngine::OwnerUser); +#else //(Q_OS_UNIX) if (!metaData.hasFlags(QFileSystemMetaData::UserId)) QFileSystemEngine::fillMetaData(entry, metaData, QFileSystemMetaData::UserId); return resolveGroupName(metaData.userId()); +#endif } //static QString QFileSystemEngine::resolveGroupName(const QFileSystemEntry &entry, QFileSystemMetaData &metaData) { +#if defined (Q_OS_SYMBIAN) + Q_UNUSED(entry); + Q_UNUSED(metaData); + return QString(); +#elif defined(Q_OS_WIN) + Q_UNUSED(metaData); + return QFileSystemEngine::owner(entry, QAbstractFileEngine::OwnerGroup); +#else //(Q_OS_UNIX) if (!metaData.hasFlags(QFileSystemMetaData::GroupId)) QFileSystemEngine::fillMetaData(entry, metaData, QFileSystemMetaData::GroupId); return resolveGroupName(metaData.groupId()); +#endif } QT_END_NAMESPACE |