From fa5f3a4464f8265692c2ff50bd03b9b24b6ad912 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 11 Jun 2009 17:27:23 +0200 Subject: 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 --- src/corelib/io/qdir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v0.12