Utils: Don't reverse FilePath::dirEntries result by default

QDir::NoSort has the value -1 thus all sort bits set.

Change-Id: I543fa68b11269cd4321b22113fc591f5542c2edd
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2022-11-16 18:43:46 +01:00
parent f59ca97a84
commit 9f397de829

View File

@@ -440,7 +440,7 @@ FilePaths FilePath::dirEntries(const FileFilter &filter, QDir::SortFlags sort) c
});
}
if (sort & QDir::Reversed)
if (sort != QDir::NoSort && (sort & QDir::Reversed))
std::reverse(result.begin(), result.end());
return result;