diff options
author | Bernhard Rosenkraenzer <br@blankpage.ch> | 2010-03-23 15:27:42 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-03-23 15:27:42 (GMT) |
commit | c6ef7c0cbd2ad7ac486cd6bcabaac4d090df0c03 (patch) | |
tree | a01625662210a0d2ce629463bb52be5e164d9852 /tests | |
parent | b4996ab8e3a26d45ee55593da281e4b798c04dd2 (diff) | |
download | Qt-c6ef7c0cbd2ad7ac486cd6bcabaac4d090df0c03.zip Qt-c6ef7c0cbd2ad7ac486cd6bcabaac4d090df0c03.tar.gz Qt-c6ef7c0cbd2ad7ac486cd6bcabaac4d090df0c03.tar.bz2 |
Split QDir::NoDotAndDotDot into QDir::NoDot and QDir::NoDotDot
This creates QDir::NoDot and QDir::NoDotDot filters -- in many cases,
one may want the .. entry (e.g. to navigate to the parent directory)
but not the . entry (useless for navigation).
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdiriterator/tst_qdiriterator.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index f6fce32..5dc17f3 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -198,6 +198,54 @@ void tst_QDirIterator::iterateRelativeDirectory_data() #endif "entrylist/writable").split(','); + QTest::newRow("NoDot") + << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QDir::Filters(QDir::NoDot) << QStringList("*") + << QString( +#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) + "entrylist/..," +#endif + "entrylist/file," +#ifndef Q_NO_SYMLINKS + "entrylist/linktofile.lnk," +#endif + "entrylist/directory," +#if !defined(Q_NO_SYMLINKS) && !defined(Q_NO_SYMLINKS_TO_DIRS) + "entrylist/linktodirectory.lnk," +#endif + "entrylist/writable").split(','); + + QTest::newRow("NoDotDot") + << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QDir::Filters(QDir::NoDotDot) << QStringList("*") + << QString( +#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) + "entrylist/.," +#endif + "entrylist/file," +#ifndef Q_NO_SYMLINKS + "entrylist/linktofile.lnk," +#endif + "entrylist/directory," +#if !defined(Q_NO_SYMLINKS) && !defined(Q_NO_SYMLINKS_TO_DIRS) + "entrylist/linktodirectory.lnk," +#endif + "entrylist/writable").split(','); + + QTest::newRow("NoDotAndDotDot") + << QString("entrylist") << QDirIterator::IteratorFlags(0) + << QDir::Filters(QDir::NoDotAndDotDot) << QStringList("*") + << QString( + "entrylist/file," +#ifndef Q_NO_SYMLINKS + "entrylist/linktofile.lnk," +#endif + "entrylist/directory," +#if !defined(Q_NO_SYMLINKS) && !defined(Q_NO_SYMLINKS_TO_DIRS) + "entrylist/linktodirectory.lnk," +#endif + "entrylist/writable").split(','); + QTest::newRow("QDir::Subdirectories | QDir::FollowSymlinks") << QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) << QDir::Filters(QDir::NoFilter) << QStringList("*") |