summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-06-11 15:27:23 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-06-11 15:27:23 (GMT)
commitfa5f3a4464f8265692c2ff50bd03b9b24b6ad912 (patch)
treec93ec85f134eef1944d342d2bc87135244cf0ab0 /src
parentaa2adb8d0072eccb549692d56168b8fde33f7b4f (diff)
downloadQt-fa5f3a4464f8265692c2ff50bd03b9b24b6ad912.zip
Qt-fa5f3a4464f8265692c2ff50bd03b9b24b6ad912.tar.gz
Qt-fa5f3a4464f8265692c2ff50bd03b9b24b6ad912.tar.bz2
Use the original order if two files are equivalent for the sort of QDir
Set back the sort order of QDir::entryList() and entryInfoList(). This complement the change of aa2adb8d0072eccb549692d56168b8fde33f7b4f Reviewed-by: Olivier
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdir.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index b6900bc..8aadf34 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -263,7 +263,8 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt
? f1->filename_cache.localeAwareCompare(f2->filename_cache)
: f1->filename_cache.compare(f2->filename_cache);
}
-
+ if (r == 0) // Enforce an order - the order the items appear in the array
+ r = (&n1) - (&n2);
if (qt_cmp_si_sort_flags & QDir::Reversed)
return r > 0;
return r < 0;