summaryrefslogtreecommitdiff
path: root/src/gui/dialogs
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 /src/gui/dialogs
parentd6e87c332c721bbcb86bebc6f4daa8a3125e80c6 (diff)
downloadqt4-tools-d755bb5e8cfd88d0cd909f32d240d18e856bbd36.tar.gz
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 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qsidebar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp
index 26108d7b26..9abefdf9d1 100644
--- a/src/gui/dialogs/qsidebar.cpp
+++ b/src/gui/dialogs/qsidebar.cpp
@@ -249,9 +249,9 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move)
continue;
for (int j = 0; move && j < rowCount(); ++j) {
#if defined(Q_OS_WIN)
- if (index(j, 0).data(UrlRole).toUrl().toLocalFile().toLower() == url.toLocalFile().toLower()) {
+ if (QDir::cleanPath(index(j, 0).data(UrlRole).toUrl().toLocalFile()).toLower() == QDir::cleanPath(url.toLocalFile()).toLower()) {
#else
- if (index(j, 0).data(UrlRole) == url) {
+ if (QDir::cleanPath(index(j, 0).data(UrlRole)) == QDir::cleanPath(url)) {
#endif
removeRow(j);
if (j <= row)