summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfileinfogatherer.cpp
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2010-03-09 13:57:28 (GMT)
committerJoão Abecasis <joao@trolltech.com>2010-03-09 15:46:30 (GMT)
commit204f389f9296cc742153b38dea67128d38514b66 (patch)
tree7fcfd54baaa1d7d7ba08572eec30d4c12faaf8a7 /src/gui/dialogs/qfileinfogatherer.cpp
parent1a682690ee31409223249cb0dd7c7ef588f6bdff (diff)
downloadQt-204f389f9296cc742153b38dea67128d38514b66.zip
Qt-204f389f9296cc742153b38dea67128d38514b66.tar.gz
Qt-204f389f9296cc742153b38dea67128d38514b66.tar.bz2
remove unneeded "permissions normalization" code from QFileInfoGatherer
Since the file engine now properly calculates user permissions, there's no need to check the owner and group IDs here. Merge-request: 428 Reviewed-by: João Abecasis <joao@trolltech.com>
Diffstat (limited to 'src/gui/dialogs/qfileinfogatherer.cpp')
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index c75cdfd..3b08bf6 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -216,41 +216,10 @@ void QFileInfoGatherer::run()
}
}
-/*
- QFileInfo::permissions is different depending upon your platform.
-
- "normalize this" so they can mean the same to us.
-*/
-QFile::Permissions QFileInfoGatherer::translatePermissions(const QFileInfo &fileInfo) const {
- QFile::Permissions permissions = fileInfo.permissions();
-#ifdef Q_OS_WIN
- return permissions;
-#else
- QFile::Permissions p = permissions;
- p &= ~(QFile::ReadUser|QFile::WriteUser|QFile::ExeUser);
- if ( permissions & QFile::ReadOther
- || (fileInfo.ownerId() == userId && permissions & QFile::ReadOwner)
- || (fileInfo.groupId() == groupId && permissions & QFile::ReadGroup))
- p |= QFile::ReadUser;
-
- if ( permissions & QFile::WriteOther
- || (fileInfo.ownerId() == userId && permissions & QFile::WriteOwner)
- || (fileInfo.groupId() == groupId && permissions & QFile::WriteGroup))
- p |= QFile::WriteUser;
-
- if ( permissions & QFile::ExeOther
- || (fileInfo.ownerId() == userId && permissions & QFile::ExeOwner)
- || (fileInfo.groupId() == groupId && permissions & QFile::ExeGroup))
- p |= QFile::ExeUser;
- return p;
-#endif
-}
-
QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
{
QExtendedInformation info(fileInfo);
info.icon = m_iconProvider->icon(fileInfo);
- info.setPermissions(translatePermissions(fileInfo));
info.displayType = m_iconProvider->type(fileInfo);
#ifndef QT_NO_FILESYSTEMWATCHER
// ### Not ready to listen all modifications