summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy <qt-info@nokia.com>2009-05-14 15:37:00 +0200
committerAndy <qt-info@nokia.com>2009-05-14 15:37:00 +0200
commitd755bb5e8cfd88d0cd909f32d240d18e856bbd36 (patch)
tree3a990f376a999f271154da17ad745dd1c1aed5eb /tests
parentd6e87c332c721bbcb86bebc6f4daa8a3125e80c6 (diff)
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')
-rw-r--r--tests/auto/qsidebar/tst_qsidebar.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp
index 705e2227f1..13843919e0 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()