summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-02-23 15:28:54 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-02-24 16:43:07 (GMT)
commit8d1ee3335f4c1bf262fb3a85fd4cc7e837129b8c (patch)
tree58c68ef568605b3b8904f156b9269d54ee714373
parentdc01a7829255a41bda606fb59f546d599b6654ba (diff)
downloadQt-8d1ee3335f4c1bf262fb3a85fd4cc7e837129b8c.zip
Qt-8d1ee3335f4c1bf262fb3a85fd4cc7e837129b8c.tar.gz
Qt-8d1ee3335f4c1bf262fb3a85fd4cc7e837129b8c.tar.bz2
bugfix: QDir::entryList(Files|Readable) not listing writable files
Mistake in the qfilesystemiterator_symbian implementation. Readable without Writable was thought to mean show only read-only files, but this isn't the expected behaviour of QDir[Iterator] Added an autotest, as this was only covered by ssl tests in the network layer. Reviewed-by: joao
-rw-r--r--src/corelib/io/qfilesystemiterator_symbian.cpp2
-rw-r--r--tests/auto/qdir/tst_qdir.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemiterator_symbian.cpp b/src/corelib/io/qfilesystemiterator_symbian.cpp
index e316526..0adc26d 100644
--- a/src/corelib/io/qfilesystemiterator_symbian.cpp
+++ b/src/corelib/io/qfilesystemiterator_symbian.cpp
@@ -88,8 +88,6 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &path, QDir::Fil
else if (symbianMask == 0) {
if ((filters & QDir::PermissionMask) == QDir::Writable)
symbianMask = KEntryAttMatchExclude | KEntryAttReadOnly;
- else if ((filters & QDir::PermissionMask) == QDir::Readable)
- symbianMask = KEntryAttMatchExclusive | KEntryAttReadOnly;
}
lastError = dirHandle.Open(fs, qt_QString2TPtrC(absPath), symbianMask);
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 2fa0c24..21460be 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -571,6 +571,12 @@ void tst_QDir::entryList_data()
<< int(QDir::AllEntries | QDir::Writable) << int(QDir::Name)
<< filterLinks(QString(".,..,directory,linktodirectory.lnk,writable").split(','));
#endif
+ QTest::newRow("QDir::Files | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*")
+ << int(QDir::Files | QDir::Readable) << int(QDir::Name)
+ << filterLinks(QString("file,linktofile.lnk,writable").split(','));
+ QTest::newRow("QDir::Dirs | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*")
+ << int(QDir::Dirs | QDir::Readable) << int(QDir::Name)
+ << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(','));
QTest::newRow("Namefilters b*") << SRCDIR "entrylist/" << QStringList("d*")
<< int(QDir::NoFilter) << int(QDir::Name)
<< filterLinks(QString("directory").split(','));