diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-08 03:16:46 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-08 03:16:46 (GMT) |
commit | 791a72e880db9886d5d16f053da31a2948ba8631 (patch) | |
tree | dcdae98651b2a8ba549818e53144122c46527814 /tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | |
parent | fe239b32550e83e8a42617457adca8d7922ff92f (diff) | |
parent | cc1f88b869f23bb2855c1ada0fc6187ca21413b6 (diff) | |
download | Qt-791a72e880db9886d5d16f053da31a2948ba8631.zip Qt-791a72e880db9886d5d16f053da31a2948ba8631.tar.gz Qt-791a72e880db9886d5d16f053da31a2948ba8631.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1:
A few trivial optimizations
Rewrote bookmark handling, the previous code was just plain awful.
Small style cleanup.
Fix some warnings.
Designer: Emit QDesignerPropertyEditorInterface::propertyChanged().
Designer: Support the 'windowOpacity'-property for forms.
Expanded tst_QFileSystemModel::rootPath() to check directories ending in "." or ".."
Assistant: Treat "unfiltered" filter in a apecial way.
Assistant: Give meaningful context to translations.
Fixed handling of paths containing ".." in QFileSystemModel on Windows.
QAbstractItemModel docs: Fix typo.
Assistant: Eliminate private tr contexts.
Diffstat (limited to 'tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp')
-rw-r--r-- | tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 287f472..9f67a5e 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -236,6 +236,26 @@ void tst_QFileSystemModel::rootPath() QCOMPARE(model->rootPath(), QString(QDir::homePath())); QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? 0 : 1); QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + model->setRootPath(QDir::rootPath()); + int oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/.")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), QDir::homePath()); + QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? oldCount : oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + QDir newdir = QDir::home(); + if (newdir.cdUp()) { + oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/..")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), newdir.path()); + QCOMPARE(rootChanged.count(), oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), newdir.path()); + } } void tst_QFileSystemModel::naturalCompare_data() |