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 /src | |
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 'src')
-rw-r--r-- | src/gui/dialogs/qsidebar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index 26108d7..9abefdf 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) |