diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2009-08-11 16:11:27 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-08-11 16:21:30 (GMT) |
commit | f36fb8b2b63b3734cc2bd66b329ca4fef1204845 (patch) | |
tree | 18f7dd3fa9d7a88abdac58d5ac3afe9773eb80f3 /tests/auto | |
parent | 7fe0dfb80efd67886a33fe8b37e9714175925688 (diff) | |
download | Qt-f36fb8b2b63b3734cc2bd66b329ca4fef1204845.zip Qt-f36fb8b2b63b3734cc2bd66b329ca4fef1204845.tar.gz Qt-f36fb8b2b63b3734cc2bd66b329ca4fef1204845.tar.bz2 |
'.' and '..' must not be hidden
_unix code always sets HiddenFlag for special dirs which is wrong;
also there is some inconsistence under win:
* FindFirstFile sets FILE_ATTRIBUTE_HIDDEN flag for ".." of hidden dir
*even* if parent dir is not hidden;
* GetFileAttributes sets FILE_ATTRIBUTE_HIDDEN flag for ".."
*only* if parent dir is hidden.
so, _win part sets HiddenFlag wrong too;
finally, we never test parent dir's flags;
futhermore hidden special dirs (dotAndDotDot) makes dir iterator's filtering a bit more complex
Merge-request: 1176
Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qfileinfo/tst_qfileinfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index e2800e5..fa2bd6e 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -974,9 +974,22 @@ void tst_QFileInfo::isHidden_data() foreach (const QFileInfo& info, QDir::drives()) { QTest::newRow(qPrintable("drive." + info.path())) << info.path() << false; } + +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QTest::newRow("C:/RECYCLER") << QString::fromLatin1("C:/RECYCLER") << true; + QTest::newRow("C:/RECYCLER/.") << QString::fromLatin1("C:/RECYCLER/.") << false; + QTest::newRow("C:/RECYCLER/..") << QString::fromLatin1("C:/RECYCLER/..") << false; +#endif +#if defined(Q_OS_UNIX) + QTest::newRow("~/.qt") << QDir::homePath() + QString("/.qt") << true; + QTest::newRow("~/.qt/.") << QDir::homePath() + QString("/.qt/.") << false; + QTest::newRow("~/.qt/..") << QDir::homePath() + QString("/.qt/..") << false; +#endif + #if !defined(Q_OS_WIN) QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false; #endif + #ifdef Q_OS_MAC QTest::newRow("mac_etc") << QString::fromLatin1("/etc") << true; QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false; |