summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qsidebar.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-04-22 07:30:00 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-04-22 07:33:38 (GMT)
commit9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e (patch)
tree377258e0cb0d36fbf83890577ce7e78f15a7cf50 /src/gui/dialogs/qsidebar.cpp
parente5fa2cf55c8370ca58f82ba1ef37a54649bd42c8 (diff)
downloadQt-9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e.zip
Qt-9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e.tar.gz
Qt-9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e.tar.bz2
Fix double entries in the sidebar of QFileDialog
The problem is QUrl == operator is case sensitive. On Windows we don't want double entries for C:\dev or c:\dev so i convert the url in lower case and compare them (on Windows only) to avoid duplicate entries. Task-number:226483 Reviewed-by:jasplin
Diffstat (limited to 'src/gui/dialogs/qsidebar.cpp')
-rw-r--r--src/gui/dialogs/qsidebar.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp
index bfdb37e..26108d7 100644
--- a/src/gui/dialogs/qsidebar.cpp
+++ b/src/gui/dialogs/qsidebar.cpp
@@ -248,7 +248,11 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move)
if (!url.isValid() || url.scheme() != QLatin1String("file"))
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()) {
+#else
if (index(j, 0).data(UrlRole) == url) {
+#endif
removeRow(j);
if (j <= row)
row--;