diff options
author | Andy <qt-info@nokia.com> | 2009-05-14 13:37:00 (GMT) |
---|---|---|
committer | Andy <qt-info@nokia.com> | 2009-05-14 13:37:00 (GMT) |
commit | d755bb5e8cfd88d0cd909f32d240d18e856bbd36 (patch) | |
tree | 3a990f376a999f271154da17ad745dd1c1aed5eb /tests/auto/qsidebar/tst_qsidebar.cpp | |
parent | d6e87c332c721bbcb86bebc6f4daa8a3125e80c6 (diff) | |
download | Qt-d755bb5e8cfd88d0cd909f32d240d18e856bbd36.zip Qt-d755bb5e8cfd88d0cd909f32d240d18e856bbd36.tar.gz Qt-d755bb5e8cfd88d0cd909f32d240d18e856bbd36.tar.bz2 |
Prevent duplicate entries in the sidebar when the paths are the same
If two urls were added to the sidebar that only differed in how they
referenced the added url (i.e. /foo/bar/. and /foo/bar) then only one
entry should appear.
Task-number: 253532
Reviewed-by: Alexis
Diffstat (limited to 'tests/auto/qsidebar/tst_qsidebar.cpp')
-rw-r--r-- | tests/auto/qsidebar/tst_qsidebar.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp index 705e222..1384391 100644 --- a/tests/auto/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/qsidebar/tst_qsidebar.cpp @@ -185,6 +185,13 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(doubleUrls, 1); QCOMPARE(qsidebar.urls().size(), 1); + // Two paths that are effectively pointing to the same location + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath() + "/."); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); + #if defined(Q_OS_WIN) //Windows is case insensitive so no duplicate entries in that case doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); @@ -200,8 +207,6 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(doubleUrls, 1); QCOMPARE(qsidebar.urls().size(), 2); #endif - - } void tst_QSidebar::goToUrl() |