diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-22 12:22:21 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-22 12:32:48 (GMT) |
commit | 003ed73811987b1ec5d9496e8ba382c1dc421e79 (patch) | |
tree | 00c4634a4093675cffe38db8de4772e8a0ad163d /tests | |
parent | 0d830dc5b0716bdb4fa7130f724ba5c9593411fa (diff) | |
download | Qt-003ed73811987b1ec5d9496e8ba382c1dc421e79.zip Qt-003ed73811987b1ec5d9496e8ba382c1dc421e79.tar.gz Qt-003ed73811987b1ec5d9496e8ba382c1dc421e79.tar.bz2 |
Workaround a bug in QDirModel in tst_QDirModel::task196768_sorting
The test was reported failing by pulse on many platform, but noone of
us was able to reproduce it locally. The problem was that pulse runs the
tests in a hidden dirrectory. And this exposed a bug in the QDirModel.
We decided anyway that the bug was not worth fixing considered that
QDirModel is kind of deprecated in favor of QFileSystemModel.
(The bug is the one reported in task 255066)
Reviewed-by: mbm
Reviewed-by: Thierry
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdirmodel/tst_qdirmodel.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index a8c298d..7ecadfc 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -611,27 +611,24 @@ void tst_QDirModel::task196768_sorting() QString path = SRCDIR; QDirModel model; - QTreeView view; - QPersistentModelIndex index = model.index(path); - qDebug() << "Path" << path << "count" << model.rowCount(index) << "index" << index; + /* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory + and we don't add QDir::Hidden. But as QDirModel is deprecated, we decided not to fix it. */ + model.setFilter(QDir::AllEntries | QDir::Hidden | QDir::AllDirs); + QTreeView view; + QPersistentModelIndex index = model.index(path); view.setModel(&model); - qDebug() << "After setModel" << index; QModelIndex index2 = model.index(path); - qDebug() << "A" << index << index2; QCOMPARE(index.data(), index2.data()); view.setRootIndex(index); index2 = model.index(path); - qDebug() << "B" << index << index2; QCOMPARE(index.data(), index2.data()); view.setCurrentIndex(index); index2 = model.index(path); - qDebug() << "C" << index << index2; QCOMPARE(index.data(), index2.data()); view.setSortingEnabled(true); index2 = model.index(path); - qDebug() << "After sorting" << index << index2 << "count" << model.rowCount(index2); QCOMPARE(index.data(), index2.data()); } |